Skip to content

Commit

Permalink
Cassandra data source implementation, walk Where
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Raddon committed Jul 11, 2016
1 parent da4855e commit 67e71ba
Show file tree
Hide file tree
Showing 8 changed files with 523 additions and 146 deletions.
16 changes: 8 additions & 8 deletions GLOCKFILE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github.com/araddon/dateparse a19b713c2e31cec89903deb95b4d053e9e7b4db5
github.com/araddon/gou 50a94aa4a3fb69e8fbde05df290fcb49fa685e07
github.com/araddon/qlbridge b890cc9b548b80c97574b870ac8507ee2c7a4db9
github.com/araddon/qlbridge c3afaa6b00a9a4d83f08fc5f7e59fbce41dfdc36
github.com/bitly/go-hostpool d0e59c22a56e8dadfed24f74f452cea5a52722d2
github.com/bmizerany/assert b7ed37b82869576c289d7d97fb2bbd8b64a0cb28
github.com/coreos/etcd 207c92b62785d220edc74ed791fd8a22a18e378e
Expand All @@ -14,7 +14,7 @@ github.com/hashicorp/go-immutable-radix afc5a0dbb18abdf82c277a7bc01533e81fa1d6b8
github.com/hashicorp/go-memdb 98f52f52d7a476958fa9da671354d270c50661a7
github.com/hashicorp/golang-lru a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4
github.com/jmoiron/sqlx bdae0c3219c3bdb92f3d7c70825018712787c933
github.com/kr/pretty add1dbc86daf0f983cd4a48ceb39deb95c729b67
github.com/kr/pretty 737b74a46c4bf788349f72cb256fed10aea4d0ac
github.com/kr/text 7cafcd837844e784b526369c9bce262804aebc60
github.com/leekchan/timeutil 28917288c48df3d2c1cfe468c273e0b2adda0aa5
github.com/lytics/cloudstorage 08dcbf0c85da78d1bd02f6d548b83e1ca4763671
Expand All @@ -27,15 +27,15 @@ github.com/lytics/sereno f6128b640de0742892a439b3672ac88637df977d
github.com/mattbaird/elastigo 34c4c4d8425cbdcbc8e257943a2044d5e9f7dab5
github.com/mb0/glob 1eb79d2de6c448664e7272f8b9fe1938239e3aaa
github.com/nats-io/gnatsd 8e99354b8ca40ae921463cea076abf460dd12d62
github.com/nats-io/nats d498de06529cce1536449f220f54217a10c319e5
github.com/nats-io/nats 495efc04e982cdb69ffc655b142973f1f1a47323
github.com/nats-io/nuid 4f84f5f3b2786224e336af2e13dba0a0a80b76fa
github.com/pborman/uuid c55201b036063326c5b1b89ccfe45a184973d073
github.com/sony/sonyflake fa881fb1052b152e977c41023052c2f2a1c475e9
github.com/ugorji/go 45ce7596ace4534e47b69051a92aef7b64ec7b3f
golang.org/x/crypto 1f22c0103821b9390939b6776727195525381532
golang.org/x/net b400c2eff1badec7022a8c8f5bea058b6315eed7
golang.org/x/oauth2 df5b72659a3b1789a345ea643bb7c28442681652
google.golang.org/api 57212573ccf9e4f69f4caa0336831697e29adcd6
google.golang.org/cloud ebfe3819c9ab4acaf086ae57e4cbd7dee683baf0
google.golang.org/grpc a0ff1e78a98cd140c2d18a0210ab0a2a183a2b4c
golang.org/x/net f841c39de738b1d0df95b5a7187744f0e03d8112
golang.org/x/oauth2 7357e96168422ba1e6e7f21075713b72d58764e7
google.golang.org/api c13a21ee847eca050f08db8373d8737494a1170e
google.golang.org/cloud 83ee71d0fec26977bad1662134fa1e8c91268025
google.golang.org/grpc 461dac99975b211ed3eda7eb45b997d82da4345a
gopkg.in/mgo.v2 22287bab4379e1fbf6002fb4eb769888f3fb224c
151 changes: 151 additions & 0 deletions backends/cassandra/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@




```
cqlsh:datauxtest> select * from system.schema_columnfamilies WHERE keyspace_name = "datauxtest";
SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:65 no viable alternative at input 'datauxtest' (...system.schema_columnfamilies WHERE keyspace_name = ["datauxtes]...)">
cqlsh:datauxtest> select * from system.schema_columnfamilies WHERE keyspace_name = 'datauxtest';
keyspace_name | columnfamily_name | bloom_filter_fp_chance | caching | cf_id | column_aliases | comment | compaction_strategy_class | compaction_strategy_options | comparator | compression_parameters | default_time_to_live | default_validator | dropped_columns | gc_grace_seconds | index_interval | is_dense | key_aliases | key_validator | local_read_repair_chance | max_compaction_threshold | max_index_interval | memtable_flush_period_in_ms | min_compaction_threshold | min_index_interval | read_repair_chance | speculative_retry | subcomparator | type | value_alias
---------------+-------------------+------------------------+---------------------------------------------+--------------------------------------+----------------+---------+-----------------------------------------------------------------+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+----------------------+-------------------------------------------+-----------------+------------------+----------------+----------+----------------+----------------------------------------------------------------------------------------------------------------------------------+--------------------------+--------------------------+--------------------+-----------------------------+--------------------------+--------------------+--------------------+-------------------+---------------+----------+-------------
datauxtest | article | 0.01 | {"keys":"ALL", "rows_per_partition":"NONE"} | bfd51db0-4628-11e6-a329-4f04994f1f6a | [] | | org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy | {} | org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.ColumnToCollectionType(63617465676f7279:org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type))) | {"sstable_compression":"org.apache.cassandra.io.compress.LZ4Compressor"} | 0 | org.apache.cassandra.db.marshal.BytesType | null | 864000 | null | False | ["author"] | org.apache.cassandra.db.marshal.UTF8Type | 0.1 | 32 | 2048 | 0 | 4 | 128 | 0 | 99.0PERCENTILE | null | Standard | null
datauxtest | event | 0.01 | {"keys":"ALL", "rows_per_partition":"NONE"} | 5d461c00-46cb-11e6-a329-4f04994f1f6a | ["ts"] | | org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy | {} | org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.TimestampType,org.apache.cassandra.db.marshal.UTF8Type) | {"sstable_compression":"org.apache.cassandra.io.compress.LZ4Compressor"} | 0 | org.apache.cassandra.db.marshal.BytesType | null | 864000 | null | False | ["date","url"] | org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type) | 0.1 | 32 | 2048 | 0 | 4 | 128 | 0 | 99.0PERCENTILE | null | Standard | null
datauxtest | user | 0.01 | {"keys":"ALL", "rows_per_partition":"NONE"} | bfe91ae0-4628-11e6-a329-4f04994f1f6a | [] | | org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy | {} | org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.ColumnToCollectionType(726f6c6573:org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type))) | {"sstable_compression":"org.apache.cassandra.io.compress.LZ4Compressor"} | 0 | org.apache.cassandra.db.marshal.BytesType | null | 864000 | null | False | ["id"] | org.apache.cassandra.db.marshal.UTF8Type | 0.1 | 32 | 2048 | 0 | 4 | 128 | 0 | 99.0PERCENTILE | null | Standard | null
select columnfamily_name AS cf, key_aliases from system.schema_columnfamilies WHERE keyspace_name = 'datauxtest';
-- Events Table
CREATE TABLE event (
url varchar,
ts timestamp,
date text,
jsondata text,
PRIMARY KEY ((date, url), ts)
);
cqlsh:datauxtest> describe table datauxtest.event;
CREATE TABLE datauxtest.event (
date text,
url text,
ts timestamp,
jsondata text,
PRIMARY KEY ((date, url), ts)
) WITH CLUSTERING ORDER BY (ts ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
# this is from a cassandra 2.2.6
cqlsh:system> describe table system.schema_columnfamilies;
CREATE TABLE system.schema_columnfamilies (
keyspace_name text,
columnfamily_name text,
bloom_filter_fp_chance double,
caching text,
cf_id uuid,
comment text,
compaction_strategy_class text,
compaction_strategy_options text,
comparator text,
compression_parameters text,
default_time_to_live int,
default_validator text,
dropped_columns map<text, bigint>,
gc_grace_seconds int,
is_dense boolean,
key_validator text,
local_read_repair_chance double,
max_compaction_threshold int,
max_index_interval int,
memtable_flush_period_in_ms int,
min_compaction_threshold int,
min_index_interval int,
read_repair_chance double,
speculative_retry text,
subcomparator text,
type text,
PRIMARY KEY (keyspace_name, columnfamily_name)
) WITH CLUSTERING ORDER BY (columnfamily_name ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
AND comment = 'table definitions'
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND dclocal_read_repair_chance = 0.0
AND default_time_to_live = 0
AND gc_grace_seconds = 604800
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 3600000
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
# this is from cassandra 2.1.8
cqlsh:datauxtest> describe table system.schema_columnfamilies;
CREATE TABLE system.schema_columnfamilies (
keyspace_name text,
columnfamily_name text,
bloom_filter_fp_chance double,
caching text,
cf_id uuid,
column_aliases text,
comment text,
compaction_strategy_class text,
compaction_strategy_options text,
comparator text,
compression_parameters text,
default_time_to_live int,
default_validator text,
dropped_columns map<text, bigint>,
gc_grace_seconds int,
index_interval int,
is_dense boolean,
key_aliases text,
key_validator text,
local_read_repair_chance double,
max_compaction_threshold int,
max_index_interval int,
memtable_flush_period_in_ms int,
min_compaction_threshold int,
min_index_interval int,
read_repair_chance double,
speculative_retry text,
subcomparator text,
type text,
value_alias text,
PRIMARY KEY (keyspace_name, columnfamily_name)
) WITH CLUSTERING ORDER BY (columnfamily_name ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
AND comment = 'ColumnFamily definitions'
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND dclocal_read_repair_chance = 0.0
AND default_time_to_live = 0
AND gc_grace_seconds = 604800
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 3600000
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
```
Loading

0 comments on commit 67e71ba

Please sign in to comment.