Skip to content

Commit

Permalink
Fixes a test referencing ExprRow
Browse files Browse the repository at this point in the history
  • Loading branch information
johnedquinn committed Nov 27, 2024
1 parent b288d2d commit 4035919
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import org.partiql.ast.expr.ExprOverlay
import org.partiql.ast.expr.ExprPath
import org.partiql.ast.expr.ExprPosition
import org.partiql.ast.expr.ExprQuerySet
import org.partiql.ast.expr.ExprRow
import org.partiql.ast.expr.ExprSessionAttribute
import org.partiql.ast.expr.ExprStruct
import org.partiql.ast.expr.ExprSubstring
Expand Down Expand Up @@ -126,6 +127,12 @@ internal object RexConverter {
override fun defaultReturn(node: AstNode, context: Env): Rex =
throw IllegalArgumentException("unsupported rex $node")

override fun visitExprRow(node: ExprRow, ctx: Env): Rex {
val values = node.values.map { visitExprCoerce(it, ctx) }
val op = rexOpCollection(values)
return rex(LIST, op) // TODO: We only do this for legacy reasons. This should return a rexOpRow!
}

override fun visitExprLit(node: ExprLit, context: Env): Rex {
val type = when (val value = node.value) {
// Specifically handle the lack of an infinite precision/scale
Expand Down

0 comments on commit 4035919

Please sign in to comment.