mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
Merge pull request #844 from nosqlbench/nosqlbench-843-cqlgen-mv
nosqlbench-843-cqlgen-mv
This commit is contained in:
commit
875d0d9606
@ -21,6 +21,8 @@
|
|||||||
* Project : cql-parser; an ANTLR4 grammar for Apache Cassandra CQL https://github.com/kdcro101cql-parser
|
* Project : cql-parser; an ANTLR4 grammar for Apache Cassandra CQL https://github.com/kdcro101cql-parser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// TODO: Add support for
|
||||||
|
// CREATE CUSTOM INDEX idxname ON ksname.tbname (fieldname) USING 'StorageAttachedIndex';
|
||||||
parser grammar CqlParser;
|
parser grammar CqlParser;
|
||||||
|
|
||||||
options
|
options
|
||||||
|
@ -175,7 +175,11 @@ public class CqlModelBuilder extends CqlParserBaseListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exitTableOptionItem(CqlParser.TableOptionItemContext ctx) {
|
public void exitTableOptionItem(CqlParser.TableOptionItemContext ctx) {
|
||||||
table.setCompactStorage(ctx.kwCompactStorage() != null);
|
if (table!=null) {
|
||||||
|
table.setCompactStorage(ctx.kwCompactStorage() != null);
|
||||||
|
} else {
|
||||||
|
logger.debug("table option item found with no table, this is likely for a materialized view");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -196,8 +200,12 @@ public class CqlModelBuilder extends CqlParserBaseListener {
|
|||||||
.map(c -> c.getText())
|
.map(c -> c.getText())
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
IntStream.range(0, columns.size())
|
if (table!=null) {
|
||||||
.forEach(i -> table.addTableClusteringOrder(columns.get(i), orders.get(i)));
|
IntStream.range(0, columns.size())
|
||||||
|
.forEach(i -> table.addTableClusteringOrder(columns.get(i), orders.get(i)));
|
||||||
|
} else {
|
||||||
|
logger.debug("clustering order found, but not active table. This is likely for a materialized view.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String textOf(ParserRuleContext ctx) {
|
private String textOf(ParserRuleContext ctx) {
|
||||||
|
@ -13,11 +13,14 @@ bindings:
|
|||||||
float: ToFloat();
|
float: ToFloat();
|
||||||
map<text,timestamp>: MapSized(3,Combinations('A-Z;0-9', ToJavaInstant()));
|
map<text,timestamp>: MapSized(3,Combinations('A-Z;0-9', ToJavaInstant()));
|
||||||
frozen<list<int>>: ListSizedHashed(HashRange(3,7),ToInt()));
|
frozen<list<int>>: ListSizedHashed(HashRange(3,7),ToInt()));
|
||||||
list<text>: ListStepped(ToString(),ToString())
|
list<text>: ListStepped(ToString(),ToString());
|
||||||
|
list<ascii>: ListStepped(ToString(),ToString())
|
||||||
map<text,text>: MapSized(3, Combinations('A-Z;0-9'), ToString(), ToString());
|
map<text,text>: MapSized(3, Combinations('A-Z;0-9'), ToString(), ToString());
|
||||||
|
map<ascii,text>: MapSized(3, Combinations('A-Z;0-9'), ToString(), ToString());
|
||||||
map<int,int>: MapSized(3, ToInt(), ToInt());
|
map<int,int>: MapSized(3, ToInt(), ToInt());
|
||||||
counter: HashRange(1,3);
|
counter: HashRange(1,3);
|
||||||
set<text>: SetSized(HashRange(3,4),ToString()));
|
set<text>: SetSized(HashRange(3,4),ToString()));
|
||||||
|
set<ascii>: SetSized(HashRange(3,4),ToString()));
|
||||||
smallint: ToShort();
|
smallint: ToShort();
|
||||||
time: StartingEpochMillis('2022-01-01 00:00:00'); ToLocalTime();
|
time: StartingEpochMillis('2022-01-01 00:00:00'); ToLocalTime();
|
||||||
timestamp: ToJavaInstant();
|
timestamp: ToJavaInstant();
|
||||||
|
Loading…
Reference in New Issue
Block a user