@@ -26,6 +26,7 @@ import org.partiql.eval.internal.operator.rex.ExprCast
26
26
import org.partiql.eval.internal.operator.rex.ExprCoalesce
27
27
import org.partiql.eval.internal.operator.rex.ExprCollection
28
28
import org.partiql.eval.internal.operator.rex.ExprLiteral
29
+ import org.partiql.eval.internal.operator.rex.ExprMissing
29
30
import org.partiql.eval.internal.operator.rex.ExprNullIf
30
31
import org.partiql.eval.internal.operator.rex.ExprPathIndex
31
32
import org.partiql.eval.internal.operator.rex.ExprPathKey
@@ -47,6 +48,7 @@ import org.partiql.plan.Rel
47
48
import org.partiql.plan.Rex
48
49
import org.partiql.plan.Statement
49
50
import org.partiql.plan.debug.PlanPrinter
51
+ import org.partiql.plan.rexOpErr
50
52
import org.partiql.plan.visitor.PlanBaseVisitor
51
53
import org.partiql.spi.fn.Agg
52
54
import org.partiql.spi.fn.FnExperimental
@@ -233,6 +235,19 @@ internal class Compiler(
233
235
return ExprCast (visitRex(node.arg, ctx), node.cast)
234
236
}
235
237
238
+ override fun visitRexOpMissing (node : Rex .Op .Missing , ctx : StaticType ? ): Operator {
239
+ return when (session.mode) {
240
+ PartiQLEngine .Mode .PERMISSIVE -> {
241
+ // Make a runtime TypeCheckException.
242
+ ExprMissing (node.message)
243
+ }
244
+ PartiQLEngine .Mode .STRICT -> {
245
+ // Promote to error.
246
+ visitRexOpErr(rexOpErr(node.message, node.causes), null )
247
+ }
248
+ }
249
+ }
250
+
236
251
// REL
237
252
override fun visitRel (node : Rel , ctx : StaticType ? ): Operator .Relation {
238
253
return super .visitRelOp(node.op, ctx) as Operator .Relation
0 commit comments