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
Modifier and TypeFieldDescriptionstatic final SqlAggFunction
AGG_M2M
aggregate function takes a measure as its argument and returns a measure.static final SqlAggFunction
AGG_M2V
aggregate function takes a measure as its argument and returns value.static final SqlRowOperator
Similar toSqlStdOperatorTable.ROW
, but does not print "ROW".static final SqlRowOperator
Similar toANONYMOUS_ROW
, but does not print "ROW" or parentheses.static final SqlBetweenOperator
A BETWEEN operator for Druid, analogous toDRUID_IN
.static final SqlInOperator
An IN operator for Druid.static final SqlInOperator
A NOT IN operator for Druid, analogous toDRUID_IN
.static final SqlOperator
Fetch operator is ONLY used for its precedence during unparsing.static final SqlInternalOperator
DISTINCT
operator, occurs withinGROUP BY
clause.static final SqlAggFunction
Aggregate function that always returns a given literal.static final SqlOperator
V2M
operator converts a measure to a value.static final SqlOperator
M2X
operator evaluates an expression in a context.static final SqlMeasureOperator
MEASURE
operator wraps an expression in the SELECT clause that is a measure.static final SqlDatetimeSubtractionOperator
2-argument form of the special minus-date operator to be used with BigQuery subtraction functions.static final SqlOperator
Offset operator is ONLY used for its precedence during unparsing.static final SqlOperator
SAME_PARTITION
operator 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 SqlOperator
Separator 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 SqlOperator
V2M
operator 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
MEASURE
operator wraps an expression in the SELECT clause that is a measure. It always occurs inside a call to "AS". -
M2V
V2M
operator converts a measure to a value. -
V2M
V2M
operator converts a value to a measure. -
M2X
M2X
operator 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_M2M
aggregate function takes a measure as its argument and returns a measure. It is used to propagate measures through theAggregate
relational operator.- See Also:
-
AGG_M2V
AGG_M2V
aggregate function takes a measure as its argument and returns value. -
SAME_PARTITION
SAME_PARTITION
operator 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
M2X
is the same as thePARTITION BY
clause 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
BOOLEAN
expression in terms of theANCHOR
record; 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.IN
operator 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
DISTINCT
operator, occurs withinGROUP BY
clause. -
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.
-