Skip to content

Commit

Permalink
Fix relOpProject bug and TPC-DS schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
RCHowell committed Oct 10, 2023
1 parent fa364ef commit 325d885
Show file tree
Hide file tree
Showing 31 changed files with 3,159 additions and 3,329 deletions.
1 change: 1 addition & 0 deletions partiql-planner/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
implementation(Deps.ionElement)
// Test
testImplementation(project(":partiql-parser"))
testImplementation(project(":plugins:partiql-local"))
// Test Fixtures
testFixturesImplementation(project(":partiql-spi"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ internal class PlanTyper(
val projections = node.projections.map { it.type(typeEnv) }
// compute output schema
val schema = projections.map { it.type }
val type = input.type.copyWithSchema(schema)
val type = ctx!!.copyWithSchema(schema)
// rewrite
val op = relOpProject(input, projections)
return rel(type, op)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import org.partiql.plan.Statement
import org.partiql.planner.test.PlannerTest
import org.partiql.planner.test.PlannerTestProvider
import org.partiql.planner.test.PlannerTestSuite
import org.partiql.planner.test.plugin.FsPlugin
import org.partiql.planner.test.toIon
import org.partiql.types.TypingMode
import org.partiql.plugins.local.LocalPlugin
import java.util.stream.Stream
import kotlin.io.path.pathString
import kotlin.io.path.toPath

class PlannerTestJunit {
Expand All @@ -33,19 +33,20 @@ class PlannerTestJunit {

companion object {

private val root = PlannerTest::class.java.getResource("/catalogs")!!.toURI().toPath().pathString

private val parser = PartiQLParserBuilder.standard().build()

private val catalogConfig = mapOf(
"default" to ionStructOf(
field("connector_name", ionString("fs")),
)
field("connector_name", ionString("local")),
field("root", ionString("$root/default")),
),
)

private fun suiteNode(suite: PlannerTestSuite): DynamicContainer {
val schemaRoot = PlannerTest::class.java.getResource("/catalogs")!!.toURI().toPath()
val plugin = FsPlugin(schemaRoot)
val plugin = LocalPlugin()
val planner = PartiQLPlannerBuilder()
.mode(TypingMode.STRICT)
.plugins(listOf(plugin))
.build()
val tests = suite.tests.map { (name, test) ->
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 325d885

Please sign in to comment.