Skip to content

Commit

Permalink
Adds support for evaluation of RexOpMissing
Browse files Browse the repository at this point in the history
  • Loading branch information
johnedquinn committed Apr 11, 2024
1 parent a6168f2 commit 88b9e26
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import org.partiql.spi.fn.FnExperimental
import org.partiql.types.StaticType
import org.partiql.value.PartiQLValueExperimental
import org.partiql.value.PartiQLValueType
import org.partiql.value.missingValue
import java.lang.IllegalStateException

internal class Compiler(
Expand All @@ -72,7 +73,6 @@ internal class Compiler(
* [Rex.Op.Err] comes from the inability for the planner to resolve a variable/function/etc. Depending on the
* configuration, this will either return MISSING or throw an error.
*/
@OptIn(PartiQLValueExperimental::class)
override fun visitRexOpErr(node: Rex.Op.Err, ctx: StaticType?): Operator {
return when (session.errorHandling) {
PartiQLEngine.CompilationErrorHandling.QUIET -> ExprError()
Expand Down Expand Up @@ -117,6 +117,11 @@ internal class Compiler(
return ExprStruct(fields)
}

@OptIn(PartiQLValueExperimental::class)
override fun visitRexOpMissing(node: Rex.Op.Missing, ctx: StaticType?): Operator {
return ExprLiteral(missingValue())
}

override fun visitRexOpSelect(node: Rex.Op.Select, ctx: StaticType?): Operator {
val rel = visitRel(node.rel, ctx)
val ordered = node.rel.type.props.contains(Rel.Prop.ORDERED)
Expand Down

0 comments on commit 88b9e26

Please sign in to comment.