Skip to content

Commit

Permalink
Reverts changes for RexOpErr
Browse files Browse the repository at this point in the history
  • Loading branch information
johnedquinn committed Apr 18, 2024
1 parent 3c80d0e commit 5b2ab76
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions partiql-eval/src/main/kotlin/org/partiql/eval/internal/Compiler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import org.partiql.eval.internal.operator.rex.ExprCase
import org.partiql.eval.internal.operator.rex.ExprCast
import org.partiql.eval.internal.operator.rex.ExprCoalesce
import org.partiql.eval.internal.operator.rex.ExprCollection
import org.partiql.eval.internal.operator.rex.ExprError
import org.partiql.eval.internal.operator.rex.ExprLiteral
import org.partiql.eval.internal.operator.rex.ExprNullIf
import org.partiql.eval.internal.operator.rex.ExprPathIndex
Expand All @@ -47,6 +46,7 @@ import org.partiql.plan.Ref
import org.partiql.plan.Rel
import org.partiql.plan.Rex
import org.partiql.plan.Statement
import org.partiql.plan.debug.PlanPrinter
import org.partiql.plan.visitor.PlanBaseVisitor
import org.partiql.spi.fn.Agg
import org.partiql.spi.fn.FnExperimental
Expand All @@ -69,17 +69,12 @@ internal class Compiler(
TODO("Not yet implemented")
}

/**
* Realistically, this should never execute -- since the problems of severity ERROR are sent to the problem handler
* at planning time. Implementors SHOULD fail compilation, however, if they decide not to, we will allow its execution
* and will treat this identically to [visitRexOpMissing].
*/
override fun visitRexOpErr(node: Rex.Op.Err, ctx: StaticType?): Operator {
return ExprError(node.message)
}

override fun visitRexOpMissing(node: Rex.Op.Missing, ctx: StaticType?): Operator {
return ExprError(node.message)
val message = buildString {
this.appendLine(node.message)
PlanPrinter.append(this, plan)
}
throw IllegalStateException(message)
}

override fun visitRelOpErr(node: Rel.Op.Err, ctx: StaticType?): Operator {
Expand Down

0 comments on commit 5b2ab76

Please sign in to comment.