Class SqlInternalOperators
These operators are always created directly, not by looking up a function
or operator by name or syntax, and therefore this class does not implement
interface SqlOperatorTable.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SqlAggFunctionAGG_M2Maggregate function takes a measure as its argument and returns a measure.static final SqlAggFunctionAGG_M2Vaggregate function takes a measure as its argument and returns value.static final SqlRowOperatorSimilar toSqlStdOperatorTable.ROW, but does not print "ROW".static final SqlRowOperatorSimilar toANONYMOUS_ROW, but does not print "ROW" or parentheses.static final SqlBetweenOperatorA BETWEEN operator for Druid, analogous toDRUID_IN.static final SqlInOperatorAn IN operator for Druid.static final SqlInOperatorA NOT IN operator for Druid, analogous toDRUID_IN.static final SqlOperatorFetch operator is ONLY used for its precedence during unparsing.static final SqlInternalOperatorDISTINCToperator, occurs withinGROUP BYclause.static final SqlAggFunctionAggregate function that always returns a given literal.static final SqlOperatorV2Moperator converts a measure to a value.static final SqlOperatorM2Xoperator evaluates an expression in a context.static final SqlMeasureOperatorMEASUREoperator wraps an expression in the SELECT clause that is a measure.static final SqlDatetimeSubtractionOperator2-argument form of the special minus-date operator to be used with BigQuery subtraction functions.static final SqlOperatorOffset operator is ONLY used for its precedence during unparsing.static final SqlOperatorSAME_PARTITIONoperator takes a number of expressions and returns whether the values of those expressions in current row are all the same as the values of those expressions in the 'anchor' row of a call toM2X.static final SqlOperatorSeparator expression inside GROUP_CONCAT, e.g.static final SqlInternalOperator"$THROW_UNLESS(condition, message)" throws an error with the given message if condition is not TRUE, otherwise returns TRUE.static final SqlOperatorV2Moperator converts a value to a measure. -
Method Summary
-
Field Details
-
ANONYMOUS_ROW
Similar toSqlStdOperatorTable.ROW, but does not print "ROW".For arguments [1, TRUE], ROW would print "
ROW (1, TRUE)", but this operator prints "(1, TRUE)". -
ANONYMOUS_ROW_NO_PARENTHESES
Similar toANONYMOUS_ROW, but does not print "ROW" or parentheses.For arguments [1, TRUE], prints "
1, TRUE". It is used in contexts where parentheses have been printed (because we thought we were about to print "(ROW (1, TRUE))") and we wish we had not. -
THROW_UNLESS
"$THROW_UNLESS(condition, message)" throws an error with the given message if condition is not TRUE, otherwise returns TRUE. -
MEASURE
MEASUREoperator wraps an expression in the SELECT clause that is a measure. It always occurs inside a call to "AS". -
M2V
V2Moperator converts a measure to a value. -
V2M
V2Moperator converts a value to a measure. -
M2X
M2Xoperator evaluates an expression in a context. As forV2M, the expression may involve aggregate functions, so that it can be evaluated in any aggregation context. -
AGG_M2M
AGG_M2Maggregate function takes a measure as its argument and returns a measure. It is used to propagate measures through theAggregaterelational operator.- See Also:
-
AGG_M2V
AGG_M2Vaggregate function takes a measure as its argument and returns value. -
SAME_PARTITION
SAME_PARTITIONoperator takes a number of expressions and returns whether the values of those expressions in current row are all the same as the values of those expressions in the 'anchor' row of a call toM2X.Its role in
M2Xis the same as thePARTITION BYclause of a windowed aggregate. For example,SUM(sal) OVER (PARTITION BY deptno, job)is equivalent to
M2X(SUM(sal), SAME_PARTITION(deptno, job))You may think of it as expanding to a
BOOLEANexpression in terms of theANCHORrecord; for example,SAME_PARTITION(deptno, job)expands to
deptno IS NOT DISTINCT FROM anchor.deptno AND job IS NOT DISTINCT FROM anchor.job AND GROUPING(deptno, job) = GROUPING(anchor.deptno, anchor.job)But we prefer to leave it intact for easier matching and eventual elimination in transformation rules.
-
DRUID_IN
An IN operator for Druid.Unlike the regular
SqlStdOperatorTable.INoperator it may be used inRexCall. It does not require that its operands have consistent types. -
DRUID_NOT_IN
A NOT IN operator for Druid, analogous toDRUID_IN. -
DRUID_BETWEEN
A BETWEEN operator for Druid, analogous toDRUID_IN. -
SEPARATOR
Separator expression inside GROUP_CONCAT, e.g. 'SEPARATOR ',''. -
GROUP_BY_DISTINCT
DISTINCToperator, occurs withinGROUP BYclause. -
FETCH
Fetch operator is ONLY used for its precedence during unparsing. -
MINUS_DATE2
2-argument form of the special minus-date operator to be used with BigQuery subtraction functions. It differs from the standard MINUS_DATE operator in that it has 2 arguments, and subtracts an interval from a datetime. -
OFFSET
Offset operator is ONLY used for its precedence during unparsing. -
LITERAL_AGG
Aggregate function that always returns a given literal.
-