Merge branch 'master' into westmann/one_dataset_arg
diff --git a/asterix-app/src/test/resources/AQLTS/queries/3.aql b/asterix-app/src/test/resources/AQLTS/queries/3.aql
deleted file mode 100644
index 3d71b27..0000000
--- a/asterix-app/src/test/resources/AQLTS/queries/3.aql
+++ /dev/null
@@ -1,5 +0,0 @@
-for $current_sig in dataset('SIGroup')
-where
- every $old_sig in dataset('SIGroup', getCurrentDateTime() - dtduration(0, 24, 0, 0))
- satisfies $old_sig.name != $current_sig.name
-return $current_sig
diff --git a/asterix-aql/src/main/javacc/AQL.jj b/asterix-aql/src/main/javacc/AQL.jj
index bba35cb..a19a15f 100644
--- a/asterix-aql/src/main/javacc/AQL.jj
+++ b/asterix-aql/src/main/javacc/AQL.jj
@@ -1713,49 +1713,34 @@
Expression DatasetAccessExpression() throws ParseException:
{
- CallExpr callExpr;
- List<Expression> argList = new ArrayList<Expression>();
String funcName;
- String dataverse;
String arg1 = null;
String arg2 = null;
- LiteralExpr ds;
Expression nameArg;
- int arity = 0;
}
{
<DATASET>
{
- dataverse = MetadataConstants.METADATA_DATAVERSE_NAME;
funcName = token.image;
}
( ( arg1 = Identifier() ( "." arg2 = Identifier() )? )
{
String name = arg2 == null ? arg1 : arg1 + "." + arg2;
- ds = new LiteralExpr();
+ LiteralExpr ds = new LiteralExpr();
ds.setValue( new StringLiteral(name) );
- argList.add(ds);
- arity ++;
+ nameArg = ds;
}
- | ( <LEFTPAREN> nameArg = Expression()
+ | ( <LEFTPAREN> nameArg = Expression() <RIGHTPAREN> ) )
{
+ String dataverse = MetadataConstants.METADATA_DATAVERSE_NAME;
+ FunctionSignature signature = lookupFunctionSignature(dataverse, funcName, 1);
+ if (signature == null) {
+ signature = new FunctionSignature(dataverse, funcName, 1);
+ }
+ List<Expression> argList = new ArrayList<Expression>();
argList.add(nameArg);
- arity ++;
+ return new CallExpr(signature, argList);
}
- ( "," nameArg = Expression()
- {
- argList.add(nameArg);
- arity++;
- }
- )* <RIGHTPAREN> ) )
- {
- FunctionSignature signature = lookupFunctionSignature(dataverse, funcName, arity);
- if (signature == null) {
- signature = new FunctionSignature(dataverse, funcName, arity);
- }
- callExpr = new CallExpr(signature,argList);
- return callExpr;
- }
}
Expression ParenthesizedExpression() throws ParseException: