|
@@ -111,6 +111,7 @@ static void eclsyntaxerror(HqlGram * parser, const char * s, short yystate, int
|
|
|
ACOS
|
|
|
AFTER
|
|
|
AGGREGATE
|
|
|
+ ALGORITHM
|
|
|
ALIAS
|
|
|
ALL
|
|
|
ALLNODES
|
|
@@ -241,7 +242,6 @@ static void eclsyntaxerror(HqlGram * parser, const char * s, short yystate, int
|
|
|
HAVING
|
|
|
HEADING
|
|
|
HINT
|
|
|
- HOLE
|
|
|
HTTPCALL
|
|
|
HTTPHEADER
|
|
|
IF
|
|
@@ -2860,8 +2860,7 @@ buildFlags
|
|
|
;
|
|
|
|
|
|
buildFlag
|
|
|
- : PARALLEL { $$.setExpr(createAttribute(parallelAtom)); $$.setPosition($1); }
|
|
|
- | OVERWRITE { $$.setExpr(createAttribute(overwriteAtom)); $$.setPosition($1); }
|
|
|
+ : OVERWRITE { $$.setExpr(createAttribute(overwriteAtom)); $$.setPosition($1); }
|
|
|
| NOOVERWRITE { $$.setExpr(createAttribute(noOverwriteAtom)); $$.setPosition($1); }
|
|
|
| BACKUP { $$.setExpr(createAttribute(backupAtom)); $$.setPosition($1); }
|
|
|
| NAMED '(' constExpression ')'
|
|
@@ -2999,6 +2998,7 @@ optCommonAttrs
|
|
|
commonAttribute
|
|
|
: localAttribute
|
|
|
| hintAttribute
|
|
|
+ | orderAttribute
|
|
|
;
|
|
|
|
|
|
hintAttribute
|
|
@@ -3079,6 +3079,79 @@ hintExpr
|
|
|
}
|
|
|
;
|
|
|
|
|
|
+orderAttribute
|
|
|
+ : UNORDERED
|
|
|
+ {
|
|
|
+ $$.setExpr(createExprAttribute(orderedAtom, createConstant(false)), $1);
|
|
|
+ }
|
|
|
+ | ORDERED
|
|
|
+ {
|
|
|
+ $$.setExpr(createExprAttribute(orderedAtom), $1);
|
|
|
+ }
|
|
|
+ | ORDERED '(' expression ')'
|
|
|
+ {
|
|
|
+ parser->normalizeExpression($3, type_boolean, true);
|
|
|
+ $$.setExpr(createExprAttribute(orderedAtom, $3.getExpr()), $1);
|
|
|
+ }
|
|
|
+ | PARALLEL
|
|
|
+ {
|
|
|
+ $$.setExpr(createExprAttribute(parallelAtom), $1);
|
|
|
+ }
|
|
|
+ | PARALLEL '(' expression ')'
|
|
|
+ {
|
|
|
+ parser->normalizeExpression($3, type_int, true);
|
|
|
+ $$.setExpr(createExprAttribute(parallelAtom, $3.getExpr()), $1);
|
|
|
+ }
|
|
|
+ | STABLE
|
|
|
+ {
|
|
|
+ $$.setExpr(createExprAttribute(stableAtom));
|
|
|
+ $$.setPosition($1);
|
|
|
+ }
|
|
|
+ | STABLE '(' expression ')'
|
|
|
+ {
|
|
|
+ parser->normalizeExpression($3, type_string, false);
|
|
|
+ $$.setExpr(createExprAttribute(stableAtom, $3.getExpr()));
|
|
|
+ $$.setPosition($1);
|
|
|
+ }
|
|
|
+ | UNSTABLE
|
|
|
+ {
|
|
|
+ $$.setExpr(createExprAttribute(unstableAtom));
|
|
|
+ $$.setPosition($1);
|
|
|
+ }
|
|
|
+ | UNSTABLE '(' expression ')'
|
|
|
+ {
|
|
|
+ parser->normalizeExpression($3, type_string, false);
|
|
|
+ $$.setExpr(createExprAttribute(unstableAtom, $3.getExpr()));
|
|
|
+ $$.setPosition($1);
|
|
|
+ }
|
|
|
+ | ALGORITHM '(' expression ')'
|
|
|
+ {
|
|
|
+ parser->normalizeExpression($3, type_string, true);
|
|
|
+ $$.setExpr(createExprAttribute(algorithmAtom, $3.getExpr()), $1);
|
|
|
+ }
|
|
|
+ ;
|
|
|
+
|
|
|
+optAppendAttrs
|
|
|
+ : { $$.setNullExpr(); }
|
|
|
+ | ',' commonAttribute optCommonAttrs
|
|
|
+ {
|
|
|
+ $$.setExpr(createComma($2.getExpr(), $3.getExpr()));
|
|
|
+ $$.setPosition($3);
|
|
|
+ }
|
|
|
+ | ',' pullAttr optCommonAttrs
|
|
|
+ {
|
|
|
+ $$.setExpr(createComma($2.getExpr(), $3.getExpr()));
|
|
|
+ $$.setPosition($3);
|
|
|
+ }
|
|
|
+ ;
|
|
|
+
|
|
|
+pullAttr
|
|
|
+ : PULL
|
|
|
+ {
|
|
|
+ $$.setExpr(createComma(createAttribute(pullAtom),createExprAttribute(orderedAtom)), $1);
|
|
|
+ }
|
|
|
+ ;
|
|
|
+
|
|
|
expireAttr
|
|
|
: EXPIRE {
|
|
|
$$.setExpr(createAttribute(expireAtom));
|
|
@@ -3171,7 +3244,6 @@ indexFlag
|
|
|
$$.setExpr(createAttribute(dynamicAtom));
|
|
|
$$.setPosition($1);
|
|
|
}
|
|
|
- | UNORDERED { $$.setExpr(createAttribute(unorderedAtom)); $$.setPosition($1); }
|
|
|
| FILEPOSITION optConstBoolArg
|
|
|
{
|
|
|
$$.setExpr(createExprAttribute(filepositionAtom, $2.getExpr()), $1);
|
|
@@ -3373,12 +3445,6 @@ soapFlag
|
|
|
$$.setExpr(createExprAttribute(mergeAtom, $3.getExpr()));
|
|
|
$$.setPosition($1);
|
|
|
}
|
|
|
- | PARALLEL '(' expression ')'
|
|
|
- {
|
|
|
- parser->normalizeExpression($3, type_int, false);
|
|
|
- $$.setExpr(createExprAttribute(parallelAtom, $3.getExpr()));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
| RETRY '(' expression ')'
|
|
|
{
|
|
|
parser->normalizeExpression($3, type_int, false);
|
|
@@ -5140,6 +5206,13 @@ endInlineFunctionToken
|
|
|
| '}' // see above
|
|
|
;
|
|
|
|
|
|
+optCondList
|
|
|
+ : {
|
|
|
+ $$.setExpr(NULL);
|
|
|
+ }
|
|
|
+ | condList
|
|
|
+ ;
|
|
|
+
|
|
|
condList
|
|
|
: booleanExpr {
|
|
|
parser->normalizeExpression($1, type_boolean, false);
|
|
@@ -6145,12 +6218,13 @@ primexpr1
|
|
|
parser->normalizeExpression($7, type_numeric, false);
|
|
|
$$.setExpr(createValue(no_corrgroup, makeRealType(8), $5.getExpr(), $7.getExpr(), $8.getExpr()));
|
|
|
}
|
|
|
- | WHICH conditions {
|
|
|
- $$.setExpr(createList(no_which, LINK(parser->uint4Type), $2.getExpr()));
|
|
|
+ | WHICH '(' optCondList ')'
|
|
|
+ {
|
|
|
+ $$.setExpr(createList(no_which, LINK(parser->uint4Type), $3.getExpr()), $1);
|
|
|
}
|
|
|
- | REJECTED conditions
|
|
|
+ | REJECTED '(' optCondList ')'
|
|
|
{
|
|
|
- $$.setExpr(createList(no_rejected, LINK(parser->uint4Type), $2.getExpr()));
|
|
|
+ $$.setExpr(createList(no_rejected, LINK(parser->uint4Type), $3.getExpr()), $1);
|
|
|
}
|
|
|
| SIZEOF '(' sizeof_type_target optMaxMin ')'
|
|
|
{
|
|
@@ -7102,6 +7176,22 @@ globalValueAttribute
|
|
|
}
|
|
|
;
|
|
|
|
|
|
+dataSetOrRowList
|
|
|
+ : dataSetOrRow
|
|
|
+ | dataSetOrRowList ',' dataSetOrRow
|
|
|
+ {
|
|
|
+ OwnedHqlExpr lhs = $1.getExpr();
|
|
|
+ OwnedHqlExpr rhs = $3.getExpr();
|
|
|
+ OwnedHqlExpr normRhs = parser->checkEnsureRecordsMatch(lhs, rhs, $2.pos, rhs->isDatarow());
|
|
|
+ $$.setExpr(createComma(lhs.getClear(), normRhs.getClear()), $1);
|
|
|
+ }
|
|
|
+ ;
|
|
|
+
|
|
|
+dataSetOrRow
|
|
|
+ : dataSet
|
|
|
+ | dataRow
|
|
|
+ ;
|
|
|
+
|
|
|
dataRow
|
|
|
: dataSet '[' expression ']'
|
|
|
{
|
|
@@ -7723,25 +7813,25 @@ dataSet
|
|
|
| dataSet '&' dataSet
|
|
|
{ parser->createAppendFiles($$, $1, $3, _ordered_Atom); }
|
|
|
| dataSet ANDAND dataSet
|
|
|
- { parser->createAppendFiles($$, $1, $3, _orderedPull_Atom); }
|
|
|
+ { parser->createAppendFiles($$, $1, $3, pullAtom); }
|
|
|
| dataSet '+' dataRow
|
|
|
{ parser->createAppendFiles($$, $1, $3, NULL); }
|
|
|
| dataSet '&' dataRow
|
|
|
{ parser->createAppendFiles($$, $1, $3, _ordered_Atom); }
|
|
|
| dataSet ANDAND dataRow
|
|
|
- { parser->createAppendFiles($$, $1, $3, _orderedPull_Atom); }
|
|
|
+ { parser->createAppendFiles($$, $1, $3, pullAtom); }
|
|
|
| dataRow '+' dataSet
|
|
|
{ parser->createAppendFiles($$, $1, $3, NULL); }
|
|
|
| dataRow '&' dataSet
|
|
|
{ parser->createAppendFiles($$, $1, $3, _ordered_Atom); }
|
|
|
| dataRow ANDAND dataSet
|
|
|
- { parser->createAppendFiles($$, $1, $3, _orderedPull_Atom); }
|
|
|
+ { parser->createAppendFiles($$, $1, $3, pullAtom); }
|
|
|
| dataRow '+' dataRow
|
|
|
{ parser->createAppendFiles($$, $1, $3, NULL); }
|
|
|
| dataRow '&' dataRow
|
|
|
{ parser->createAppendFiles($$, $1, $3, _ordered_Atom); }
|
|
|
| dataRow ANDAND dataRow
|
|
|
- { parser->createAppendFiles($$, $1, $3, _orderedPull_Atom); }
|
|
|
+ { parser->createAppendFiles($$, $1, $3, pullAtom); }
|
|
|
| dataSet '[' expression DOTDOT expression ']'
|
|
|
{
|
|
|
parser->normalizeExpression($3, type_int, false);
|
|
@@ -7779,6 +7869,12 @@ simpleDataSet
|
|
|
$$.setExpr(createDataset(no_rowsetindex, $1.getExpr(), $3.getExpr()));
|
|
|
$$.setPosition($1);
|
|
|
}
|
|
|
+ // Prefix form of the dataset append operator.
|
|
|
+ // There are no equivalents to '&' and '&&' - the operator below defaults to ordered, and options can be used to change that
|
|
|
+ | '(' '+' ')' '(' dataSetOrRowList optAppendAttrs ')'
|
|
|
+ {
|
|
|
+ $$.setExpr(parser->createAppendFiles($5, $6.getExpr()), $1);
|
|
|
+ }
|
|
|
| ALIAS '(' dataSet ')'
|
|
|
{
|
|
|
$$.setExpr(createDataset(no_dataset_alias, $3.getExpr(), ::createUniqueId()), $1);
|
|
@@ -8503,11 +8599,11 @@ simpleDataSet
|
|
|
$$.setExpr(createDataset(no_regroup, args));
|
|
|
$$.setPosition($1);
|
|
|
}
|
|
|
- | HAVING '(' startLeftRowsSeqFilter ',' condList ')' endRowsGroup endSelectorSequence
|
|
|
+ | HAVING '(' startLeftRowsSeqFilter ',' condList optCommonAttrs ')' endRowsGroup endSelectorSequence
|
|
|
{
|
|
|
parser->checkGrouped($3);
|
|
|
- IHqlExpression *attr = NULL; // possibly local may make sense if thor supported it as a global operation, but it would be too painful.
|
|
|
- $$.setExpr(createDataset(no_filtergroup, $3.getExpr(), createComma($5.getExpr(), attr, $7.getExpr(), $8.getExpr())));
|
|
|
+ IHqlExpression *attr = $6.getExpr();
|
|
|
+ $$.setExpr(createDataset(no_filtergroup, $3.getExpr(), createComma($5.getExpr(), attr, $8.getExpr(), $9.getExpr())));
|
|
|
$$.setPosition($1);
|
|
|
}
|
|
|
| KEYED '(' dataSet indexListOpt ')' endTopFilter
|
|
@@ -9320,11 +9416,11 @@ simpleDataSet
|
|
|
OwnedHqlExpr ds = $3.getExpr();
|
|
|
$$.setExpr(parser->resolveRows($1, ds), $1);
|
|
|
}
|
|
|
- | XMLPROJECT '(' expression ',' transform ')'
|
|
|
+ | XMLPROJECT '(' expression ',' transform optCommonAttrs ')'
|
|
|
{
|
|
|
parser->normalizeExpression($3, type_string, false);
|
|
|
parser->validateXPath($3);
|
|
|
- $$.setExpr(createDatasetF(no_xmlproject, $3.getExpr(), $5.getExpr(), parser->createUniqueId(), NULL));
|
|
|
+ $$.setExpr(createDatasetF(no_xmlproject, $3.getExpr(), $5.getExpr(), parser->createUniqueId(), $6.getExpr(), NULL));
|
|
|
$$.setPosition($1);
|
|
|
}
|
|
|
| MAP '(' mapDatarowSpec ',' dataRow ')'
|
|
@@ -9403,25 +9499,10 @@ simpleDataSet
|
|
|
OwnedHqlExpr transform = parser->createDefaultAssignTransform(ds->queryRecord(), leftSelect, $1);
|
|
|
$$.setExpr(createDatasetF(no_quantile, ds.getClear(), $5.getExpr(), sortlist.getClear(), transform.getClear(), selSeq.getClear(), options.getClear(), NULL), $1);
|
|
|
}
|
|
|
-/*
|
|
|
- //This may cause s/r problems with the attribute version if a dataset name clashes with a hint id
|
|
|
- | HINT '(' dataSet ',' hintList ')'
|
|
|
+ | UNORDERED '(' startTopFilter ')' endTopFilter
|
|
|
{
|
|
|
- HqlExprArray hints;
|
|
|
- $5.unwindCommaList(hints);
|
|
|
- OwnedHqlExpr hint = createExprAttribute(hintAtom, hints);
|
|
|
-
|
|
|
- //Add a hint attribute to the dataset
|
|
|
- OwnedHqlExpr ds = $3.getExpr();
|
|
|
- $$.setExpr(appendOwnedOperand(ds, hint.getClear()), $1);
|
|
|
-
|
|
|
- //An alternative implementation is to add an annotation to the dataset, but these will then get commoned
|
|
|
- //up, and generally I suspect hints should be treated as not commoned up. Maybe there should be a flag!
|
|
|
- //The code generator also doesn't yet preserve annotations from multiple branches.
|
|
|
- //$$.setExpr(createMetaAnnotation($3.getExpr(), args), $1);
|
|
|
+ $$.setExpr(createDataset(no_unordered, $3.getExpr()), $1);
|
|
|
}
|
|
|
-
|
|
|
-*/
|
|
|
;
|
|
|
|
|
|
|
|
@@ -9629,20 +9710,7 @@ loopOptions
|
|
|
;
|
|
|
|
|
|
loopOption
|
|
|
- : PARALLEL '(' expression ')'
|
|
|
- {
|
|
|
- parser->normalizeExpression($3); // could check more...
|
|
|
- $$.setExpr(createExprAttribute(parallelAtom, $3.getExpr()));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
- | PARALLEL '(' expression ',' expression ')'
|
|
|
- {
|
|
|
- parser->normalizeExpression($3, type_set, false);
|
|
|
- parser->normalizeExpression($5, type_int, false);
|
|
|
- $$.setExpr(createExprAttribute(parallelAtom, $3.getExpr(), $5.getExpr()));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
- | commonAttribute
|
|
|
+ : commonAttribute
|
|
|
;
|
|
|
|
|
|
graphOptions
|
|
@@ -9656,12 +9724,7 @@ graphOptions
|
|
|
;
|
|
|
|
|
|
graphOption
|
|
|
- : PARALLEL
|
|
|
- {
|
|
|
- $$.setExpr(createExprAttribute(parallelAtom));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
- | commonAttribute
|
|
|
+ : commonAttribute
|
|
|
;
|
|
|
|
|
|
remoteOptions
|
|
@@ -10496,21 +10559,11 @@ JoinFlag
|
|
|
$$.setPosition($1);
|
|
|
}
|
|
|
| onFailAction
|
|
|
- | PARALLEL
|
|
|
- {
|
|
|
- $$.setExpr(createAttribute(parallelAtom));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
| SEQUENTIAL
|
|
|
{
|
|
|
$$.setExpr(createAttribute(sequentialAtom));
|
|
|
$$.setPosition($1);
|
|
|
}
|
|
|
- | UNORDERED
|
|
|
- {
|
|
|
- $$.setExpr(createAttribute(unorderedAtom));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
| GROUP '(' startSortOrder heterogeneous_expr_list ')' endSortOrder
|
|
|
{
|
|
|
HqlExprArray args;
|
|
@@ -10520,16 +10573,6 @@ JoinFlag
|
|
|
OwnedHqlExpr impliedAttr = createComma(createAttribute(lookupAtom), createAttribute(manyAtom));
|
|
|
$$.setExpr(createComma(groupAttr.getClear(), impliedAttr.getClear()), $1);
|
|
|
}
|
|
|
- | STABLE
|
|
|
- {
|
|
|
- $$.setExpr(createExprAttribute(stableAtom));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
- | UNSTABLE
|
|
|
- {
|
|
|
- $$.setExpr(createExprAttribute(unstableAtom));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
| STREAMED { $$.setExpr(createAttribute(streamedAtom)); $$.setPosition($1); }
|
|
|
;
|
|
|
|
|
@@ -10808,12 +10851,7 @@ parseFlag
|
|
|
parser->normalizeExpression($3, type_numeric, false);
|
|
|
$$.setExpr(createExprAttribute(maxLengthAtom, $3.getExpr()));
|
|
|
}
|
|
|
- | PARALLEL
|
|
|
- {
|
|
|
- $$.setExpr(createAttribute(parallelAtom));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
- | hintAttribute
|
|
|
+ | commonAttribute
|
|
|
;
|
|
|
|
|
|
xmlParseFlags
|
|
@@ -11559,22 +11597,6 @@ sortItem
|
|
|
$$.setExpr(createExprAttribute(bestAtom, args));
|
|
|
}
|
|
|
| mergeJoinFlag
|
|
|
- | STABLE
|
|
|
- {
|
|
|
- $$.setExpr(createExprAttribute(stableAtom));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
- | STABLE '(' expression ')'
|
|
|
- {
|
|
|
- parser->normalizeExpression($3, type_string, false);
|
|
|
- $$.setExpr(createExprAttribute(stableAtom, $3.getExpr()));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
- | UNSTABLE
|
|
|
- {
|
|
|
- $$.setExpr(createExprAttribute(unstableAtom));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
| KEYED
|
|
|
{
|
|
|
$$.setExpr(createAttribute(keyedAtom));
|
|
@@ -11584,16 +11606,6 @@ sortItem
|
|
|
{
|
|
|
$$.setExpr(createAttribute(groupedAtom), $1);
|
|
|
}
|
|
|
- | UNSTABLE '(' expression ')'
|
|
|
- {
|
|
|
- parser->normalizeExpression($3, type_string, false);
|
|
|
- $$.setExpr(createExprAttribute(unstableAtom, $3.getExpr()));
|
|
|
- $$.setPosition($1);
|
|
|
- }
|
|
|
- | PARALLEL
|
|
|
- {
|
|
|
- $$.setExpr(createAttribute(parallelAtom), $1);
|
|
|
- }
|
|
|
| prefetchAttribute
|
|
|
;
|
|
|
|
|
@@ -11684,8 +11696,9 @@ rollupFlag
|
|
|
;
|
|
|
|
|
|
conditions
|
|
|
- : '(' condList ')' {
|
|
|
- $$.setExpr($2.getExpr());
|
|
|
+ : '(' condList optCommonAttrs ')'
|
|
|
+ {
|
|
|
+ $$.setExpr(createComma($2.getExpr(), $3.getExpr()));
|
|
|
}
|
|
|
| '(' ')' {
|
|
|
$$.setNullExpr();
|