Skip to content

Commit

Permalink
Fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnedquinn committed Feb 7, 2025
1 parent f81ca51 commit 285973a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ class PartiQLEvaluatorTest {
val tc =
SuccessTestCase(
input = """
WITH x AS (SELECT * FROM <<1, 2, 3>>) SELECT * FROM x;
non_existing_column = 1
""".trimIndent(),
expected = Datum.nullValue(PType.bool())
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ internal object RelConverter {
val orderBy = node.orderBy
val limit = node.limit
val offset = node.offset
val with = node.with
when (body) {
is QueryBody.SFW -> {
var sel = body
Expand Down Expand Up @@ -203,7 +204,7 @@ internal object RelConverter {
is SelectPivot -> rel // Skip PIVOT
else -> error("Unexpected Select type: $projection")
}
rel = convertWith(rel, node.with)
rel = convertWith(rel, with)
return rel
}
is QueryBody.SetOp -> {
Expand Down Expand Up @@ -601,6 +602,9 @@ internal object RelConverter {
if (with == null) {
return input
}
if (with.isRecursive) {
env.listener.report(PErrors.featureNotSupported("WITH RECURSIVE"))
}
val type = input.type
val elements = with.elements.map { element ->
if (element.columnList != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.partiql.planner.internal.ir.rex
import org.partiql.planner.internal.ir.rexOpLit
import org.partiql.planner.internal.ir.rexOpPathKey
import org.partiql.planner.internal.ir.rexOpPathSymbol
import org.partiql.planner.internal.ir.rexOpSelect
import org.partiql.planner.internal.ir.rexOpVarLocal
import org.partiql.planner.internal.typer.PlanTyper.Companion.toCType
import org.partiql.spi.catalog.Identifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4058,10 +4058,10 @@ internal class PlanTyperTestsPorted {

private val parameters = listOf(
ErrorTestCase(
name = "WITH not supported yet",
query = "WITH x AS (SELECT * FROM <<1, 2, 3>>) SELECT * FROM x",
name = "WITH RECURSIVE not supported yet",
query = "WITH RECURSIVE x AS (SELECT * FROM <<1, 2, 3>>) SELECT * FROM x",
problemHandler = assertProblemExists(
PErrors.featureNotSupported("WITH clause")
PErrors.featureNotSupported("WITH RECURSIVE")
)
),
ErrorTestCase(
Expand Down

0 comments on commit 285973a

Please sign in to comment.