public class SqlCoalesceOperatorRewriter extends java.lang.Object implements SqlOperatorRewriter
Turns COALESCE(a, b, c)
into:
CASE
WHEN a IS NOT NULL THEN a
WHEN b IS NOT NULL THEN b
ELSE c
END
There is also a special case for the single-argument case: COALESCE(a)
becomes
just a
.
Constructor and Description |
---|
SqlCoalesceOperatorRewriter() |
Modifier and Type | Method and Description |
---|---|
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rex.RexNode |
apply(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rex.RexBuilder rexBuilder,
java.util.List<org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rex.RexNode> operands)
Create and return a new
RexNode that represents a call to this operator with the
specified operands. |
public org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rex.RexNode apply(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rex.RexBuilder rexBuilder, java.util.List<org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rex.RexNode> operands)
SqlOperatorRewriter
RexNode
that represents a call to this operator with the
specified operands.apply
in interface SqlOperatorRewriter
rexBuilder
- A RexBuilder
instance to use for creating new RexNode
soperands
- The original list of RexNode
operands passed to this operator call