Class SqlInternalOperators

java.lang.Object
org.apache.calcite.sql.fun.SqlInternalOperators

public abstract class SqlInternalOperators extends Object
Contains internal operators.

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 Details

    • ANONYMOUS_ROW

      public static final SqlRowOperator ANONYMOUS_ROW
      Similar to SqlStdOperatorTable.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

      public static final SqlRowOperator ANONYMOUS_ROW_NO_PARENTHESES
      Similar to ANONYMOUS_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

      public static final SqlInternalOperator THROW_UNLESS
      "$THROW_UNLESS(condition, message)" throws an error with the given message if condition is not TRUE, otherwise returns TRUE.
    • MEASURE

      public static final SqlMeasureOperator MEASURE
      MEASURE operator wraps an expression in the SELECT clause that is a measure. It always occurs inside a call to "AS".
    • M2V

      public static final SqlOperator M2V
      V2M operator converts a measure to a value.
    • V2M

      public static final SqlOperator V2M
      V2M operator converts a value to a measure.
    • M2X

      public static final SqlOperator M2X
      M2X operator evaluates an expression in a context. As for V2M, the expression may involve aggregate functions, so that it can be evaluated in any aggregation context.
    • AGG_M2M

      public static final SqlAggFunction AGG_M2M
      AGG_M2M aggregate function takes a measure as its argument and returns a measure. It is used to propagate measures through the Aggregate relational operator.
      See Also:
    • AGG_M2V

      public static final SqlAggFunction AGG_M2V
      AGG_M2V aggregate function takes a measure as its argument and returns value.
    • SAME_PARTITION

      public static final SqlOperator 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 to M2X.

      Its role in M2X is the same as the PARTITION 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 the ANCHOR 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

      public static final SqlInOperator DRUID_IN
      An IN operator for Druid.

      Unlike the regular SqlStdOperatorTable.IN operator it may be used in RexCall. It does not require that its operands have consistent types.

    • DRUID_NOT_IN

      public static final SqlInOperator DRUID_NOT_IN
      A NOT IN operator for Druid, analogous to DRUID_IN.
    • DRUID_BETWEEN

      public static final SqlBetweenOperator DRUID_BETWEEN
      A BETWEEN operator for Druid, analogous to DRUID_IN.
    • SEPARATOR

      public static final SqlOperator SEPARATOR
      Separator expression inside GROUP_CONCAT, e.g. 'SEPARATOR ',''.
    • GROUP_BY_DISTINCT

      public static final SqlInternalOperator GROUP_BY_DISTINCT
      DISTINCT operator, occurs within GROUP BY clause.
    • FETCH

      public static final SqlOperator FETCH
      Fetch operator is ONLY used for its precedence during unparsing.
    • MINUS_DATE2

      public static final SqlDatetimeSubtractionOperator 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

      public static final SqlOperator OFFSET
      Offset operator is ONLY used for its precedence during unparsing.
    • LITERAL_AGG

      public static final SqlAggFunction LITERAL_AGG
      Aggregate function that always returns a given literal.