diff --git a/partiql-planner/build.gradle.kts b/partiql-planner/build.gradle.kts index 888e0e0ff7..5cade1ebb4 100644 --- a/partiql-planner/build.gradle.kts +++ b/partiql-planner/build.gradle.kts @@ -29,6 +29,7 @@ dependencies { implementation(Deps.ionElement) // Test testImplementation(project(":partiql-parser")) + testImplementation(project(":plugins:partiql-local")) // Test Fixtures testFixturesImplementation(project(":partiql-spi")) } diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/typer/PlanTyper.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/typer/PlanTyper.kt index 02e0c25556..cc16b86ad0 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/typer/PlanTyper.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/typer/PlanTyper.kt @@ -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) diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/PlannerTestJunit.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/PlannerTestJunit.kt index 4aeb9055a1..e752ec0033 100644 --- a/partiql-planner/src/test/kotlin/org/partiql/planner/PlannerTestJunit.kt +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/PlannerTestJunit.kt @@ -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 { @@ -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) -> diff --git a/partiql-planner/src/testFixtures/kotlin/org/partiql/planner/test/plugin/FsCatalog.kt b/partiql-planner/src/testFixtures/kotlin/org/partiql/planner/test/plugin/FsCatalog.kt deleted file mode 100644 index fc8afa1023..0000000000 --- a/partiql-planner/src/testFixtures/kotlin/org/partiql/planner/test/plugin/FsCatalog.kt +++ /dev/null @@ -1,92 +0,0 @@ -package org.partiql.planner.test.plugin - -import com.amazon.ionelement.api.loadSingleElement -import org.partiql.planner.test.toStaticType -import org.partiql.spi.BindingCase -import org.partiql.spi.BindingName -import org.partiql.spi.BindingPath -import org.partiql.types.StaticType -import java.io.File -import java.nio.file.Path - -private sealed class FsTree(val name: String) { - - // "Directory" node - class D(name: String, val children: List) : FsTree(name) - - // Type node - class T(name: String, val type: StaticType) : FsTree(name) -} - -/** - * Build a memoized catalog tree from local schema definitions. - */ -public class FsCatalog private constructor(private val root: FsTree.D) { - - /** - * Search the tree for the type. - */ - public fun lookup(path: BindingPath): FsObject? { - val match = mutableListOf() - var curr: FsTree? = root - for (step in path.steps) { - if (curr == null) return null - match.add(curr.name) - when (curr) { - is FsTree.T -> break - is FsTree.D -> curr = curr.children.firstOrNull { step.isEquivalentTo(it.name) } - } - } - // All steps matched and we're at a leaf - if (match.size == path.steps.size && curr is FsTree.T) { - match.add(curr.name) - return FsObject(match, curr.type) - } - return null - } - - public fun listObjects(): List = sequence { search(emptyList(), root) }.toList() - - private suspend fun SequenceScope.search(acc: List, node: FsTree) = - when (node) { - is FsTree.D -> search(acc, node) - is FsTree.T -> search(acc, node) - } - - private suspend fun SequenceScope.search(acc: List, node: FsTree.D) { - val steps = acc + BindingName(node.name, BindingCase.INSENSITIVE) - for (child in node.children) { - search(steps, child) - } - } - - private suspend fun SequenceScope.search(acc: List, node: FsTree.T) { - val steps = acc + BindingName(node.name, BindingCase.INSENSITIVE) - this.yield(BindingPath(steps)) - } - - companion object { - - /** - * Builds a FsTree from the given root. - */ - public fun load(root: Path): FsCatalog = FsCatalog(root.toFile().tree() as FsTree.D) - - private fun File.tree(): FsTree = when (this.isDirectory) { - true -> d() - else -> t() - } - - private fun File.d(): FsTree.D { - val children = listFiles()!!.map { it.tree() } - return FsTree.D(name, children) - } - - private fun File.t(): FsTree.T { - val text = readText() - val ion = loadSingleElement(text) - val type = ion.toStaticType() - return FsTree.T(nameWithoutExtension, type) - } - } -} diff --git a/partiql-planner/src/testFixtures/kotlin/org/partiql/planner/test/plugin/FsConnector.kt b/partiql-planner/src/testFixtures/kotlin/org/partiql/planner/test/plugin/FsConnector.kt deleted file mode 100644 index c8c6fba26c..0000000000 --- a/partiql-planner/src/testFixtures/kotlin/org/partiql/planner/test/plugin/FsConnector.kt +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.planner.test.plugin - -import com.amazon.ionelement.api.StructElement -import org.partiql.spi.BindingPath -import org.partiql.spi.connector.Connector -import org.partiql.spi.connector.ConnectorMetadata -import org.partiql.spi.connector.ConnectorObject -import org.partiql.spi.connector.ConnectorObjectHandle -import org.partiql.spi.connector.ConnectorObjectPath -import org.partiql.spi.connector.ConnectorSession -import org.partiql.types.StaticType -import java.nio.file.Path -import kotlin.io.path.notExists - -/** - * Associate a resolved path with a [StaticType] - * - * @property path - * @property type - */ -class FsObject( - public val path: List, - public val type: StaticType, -) : ConnectorObject { - public fun getDescriptor(): StaticType = type -} - -/** - * PlannerConnector - * - * @property catalogRoot Catalog root path - * @property catalogName Catalog name - * @property config Catalog configuration - */ -class FsConnector( - private val catalogRoot: Path, - private val catalogName: String, - private val config: StructElement, -) : Connector { - - private val metadata = Metadata(catalogRoot) - - // not yet defined in SPI - public fun listObjects(): List = metadata.listObjects() - - override fun getMetadata(session: ConnectorSession): ConnectorMetadata = metadata - - class Factory(private val root: Path) : Connector.Factory { - - override fun getName(): String = "fs" - - override fun create(catalogName: String, config: StructElement): Connector { - val catalogRoot = root.resolve(catalogName).toAbsolutePath() - if (catalogRoot.notExists()) { - error("Invalid catalog `$catalogRoot`") - } - return FsConnector(catalogRoot, catalogName, config) - } - } - - class Metadata(root: Path) : ConnectorMetadata { - - private val catalog = FsCatalog.load(root) - - override fun getObjectType(session: ConnectorSession, handle: ConnectorObjectHandle): StaticType { - val obj = handle.value as FsObject - return obj.getDescriptor() - } - - override fun getObjectHandle(session: ConnectorSession, path: BindingPath): ConnectorObjectHandle? { - val value = catalog.lookup(path) ?: return null - return ConnectorObjectHandle( - absolutePath = ConnectorObjectPath(value.path), - value = value, - ) - } - - internal fun listObjects(): List = catalog.listObjects() - } -} diff --git a/partiql-planner/src/testFixtures/kotlin/org/partiql/planner/test/plugin/FsPlugin.kt b/partiql-planner/src/testFixtures/kotlin/org/partiql/planner/test/plugin/FsPlugin.kt deleted file mode 100644 index b278679f0b..0000000000 --- a/partiql-planner/src/testFixtures/kotlin/org/partiql/planner/test/plugin/FsPlugin.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.planner.test.plugin - -import org.partiql.spi.Plugin -import org.partiql.spi.connector.Connector -import org.partiql.spi.function.PartiQLFunction -import org.partiql.spi.function.PartiQLFunctionExperimental -import java.nio.file.Path - -/** - * FsPlugin is a PartiQL plugin that provides schemas written in PartiQL Value Schema. - * - * Backed by a memoized catalog tree from the given root dir; global bindings are files. - */ -class FsPlugin(private val root: Path) : Plugin { - - override fun getConnectorFactories(): List = listOf(FsConnector.Factory(root)) - - @PartiQLFunctionExperimental - override fun getFunctions(): List = emptyList() -} diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/call_center.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/call_center.ion index 9ddfd26a3c..ea3dc3c061 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/call_center.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/call_center.ion @@ -1,217 +1,219 @@ -{ - type: "struct", - name: "call_center", - fields: [ - { - name: "cc_call_center_sk", - type: "string" - }, - { - name: "cc_call_center_id", - type: "string" - }, - { - name: "cc_rec_start_date", - type: [ - "int64", - "null" - ] - }, - { - name: "cc_rec_end_date", - type: [ - "int64", - "null" - ] - }, - { - name: "cc_closed_date_sk", - type: [ - "int32", - "null" - ] - }, - { - name: "cc_open_date_sk", - type: [ - "int32", - "null" - ] - }, - { - name: "cc_name", - type: [ - "string", - "null" - ] - }, - { - name: "cc_class", - type: [ - "string", - "null" - ] - }, - { - name: "cc_employees", - type: [ - "int32", - "null" - ] - }, - { - name: "cc_sq_ft", - type: [ - "int32", - "null" - ] - }, - { - name: "cc_hours", - type: [ - "string", - "null" - ] - }, - { - name: "cc_manager", - type: [ - "string", - "null" - ] - }, - { - name: "cc_mkt_id", - type: [ - "int32", - "null" - ] - }, - { - name: "cc_mkt_class", - type: [ - "string", - "null" - ] - }, - { - name: "cc_mkt_desc", - type: [ - "string", - "null" - ] - }, - { - name: "cc_market_manager", - type: [ - "string", - "null" - ] - }, - { - name: "cc_division", - type: [ - "int32", - "null" - ] - }, - { - name: "cc_division_name", - type: [ - "string", - "null" - ] - }, - { - name: "cc_company", - type: [ - "int32", - "null" - ] - }, - { - name: "cc_company_name", - type: [ - "string", - "null" - ] - }, - { - name: "cc_street_number", - type: [ - "string", - "null" - ] - }, - { - name: "cc_street_name", - type: [ - "string", - "null" - ] - }, - { - name: "cc_street_type", - type: [ - "string", - "null" - ] - }, - { - name: "cc_suite_number", - type: [ - "string", - "null" - ] - }, - { - name: "cc_city", - type: [ - "string", - "null" - ] - }, - { - name: "cc_county", - type: [ - "string", - "null" - ] - }, - { - name: "cc_state", - type: [ - "string", - "null" - ] - }, - { - name: "cc_zip", - type: [ - "string", - "null" - ] - }, - { - name: "cc_country", - type: [ - "string", - "null" - ] - }, - { - name: "cc_gmt_offset", - type: [ - "float64", - "null" - ] - }, - { - name: "cc_tax_percentage", - type: [ - "float64", - "null" - ] - } - ] -} \ No newline at end of file +call_center::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "cc_call_center_sk", + type: "string" + }, + { + name: "cc_call_center_id", + type: "string" + }, + { + name: "cc_rec_start_date", + type: [ + "int64", + "null" + ] + }, + { + name: "cc_rec_end_date", + type: [ + "int64", + "null" + ] + }, + { + name: "cc_closed_date_sk", + type: [ + "int32", + "null" + ] + }, + { + name: "cc_open_date_sk", + type: [ + "int32", + "null" + ] + }, + { + name: "cc_name", + type: [ + "string", + "null" + ] + }, + { + name: "cc_class", + type: [ + "string", + "null" + ] + }, + { + name: "cc_employees", + type: [ + "int32", + "null" + ] + }, + { + name: "cc_sq_ft", + type: [ + "int32", + "null" + ] + }, + { + name: "cc_hours", + type: [ + "string", + "null" + ] + }, + { + name: "cc_manager", + type: [ + "string", + "null" + ] + }, + { + name: "cc_mkt_id", + type: [ + "int32", + "null" + ] + }, + { + name: "cc_mkt_class", + type: [ + "string", + "null" + ] + }, + { + name: "cc_mkt_desc", + type: [ + "string", + "null" + ] + }, + { + name: "cc_market_manager", + type: [ + "string", + "null" + ] + }, + { + name: "cc_division", + type: [ + "int32", + "null" + ] + }, + { + name: "cc_division_name", + type: [ + "string", + "null" + ] + }, + { + name: "cc_company", + type: [ + "int32", + "null" + ] + }, + { + name: "cc_company_name", + type: [ + "string", + "null" + ] + }, + { + name: "cc_street_number", + type: [ + "string", + "null" + ] + }, + { + name: "cc_street_name", + type: [ + "string", + "null" + ] + }, + { + name: "cc_street_type", + type: [ + "string", + "null" + ] + }, + { + name: "cc_suite_number", + type: [ + "string", + "null" + ] + }, + { + name: "cc_city", + type: [ + "string", + "null" + ] + }, + { + name: "cc_county", + type: [ + "string", + "null" + ] + }, + { + name: "cc_state", + type: [ + "string", + "null" + ] + }, + { + name: "cc_zip", + type: [ + "string", + "null" + ] + }, + { + name: "cc_country", + type: [ + "string", + "null" + ] + }, + { + name: "cc_gmt_offset", + type: [ + "float64", + "null" + ] + }, + { + name: "cc_tax_percentage", + type: [ + "float64", + "null" + ] + } + ] + } +} diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_page.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_page.ion index 56f53a0315..272df0daa9 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_page.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_page.ion @@ -1,69 +1,71 @@ -{ - type: "struct", - name: "catalog_page", - fields: [ - { - name: "cp_catalog_page_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cp_catalog_page_id", - type: [ - "string", - "null" - ] - }, - { - name: "cp_start_date_sk", - type: [ - "int32", - "null" - ] - }, - { - name: "cp_end_date_sk", - type: [ - "int32", - "null" - ] - }, - { - name: "cp_department", - type: [ - "string", - "null" - ] - }, - { - name: "cp_catalog_number", - type: [ - "int32", - "null" - ] - }, - { - name: "cp_catalog_page_number", - type: [ - "int32", - "null" - ] - }, - { - name: "cp_description", - type: [ - "string", - "null" - ] - }, - { - name: "cp_type", - type: [ - "string", - "null" - ] - } - ] +catalog_page::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "cp_catalog_page_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cp_catalog_page_id", + type: [ + "string", + "null" + ] + }, + { + name: "cp_start_date_sk", + type: [ + "int32", + "null" + ] + }, + { + name: "cp_end_date_sk", + type: [ + "int32", + "null" + ] + }, + { + name: "cp_department", + type: [ + "string", + "null" + ] + }, + { + name: "cp_catalog_number", + type: [ + "int32", + "null" + ] + }, + { + name: "cp_catalog_page_number", + type: [ + "int32", + "null" + ] + }, + { + name: "cp_description", + type: [ + "string", + "null" + ] + }, + { + name: "cp_type", + type: [ + "string", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_returns.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_returns.ion index fa1084b60d..bd881456c5 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_returns.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_returns.ion @@ -1,195 +1,197 @@ -{ - type: "struct", - name: "catalog_returns", - fields: [ - { - name: "cr_returned_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_returned_time_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_item_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_refunded_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_refunded_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_refunded_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_refunded_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_returning_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_returning_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_returning_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_returning_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_call_center_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_catalog_page_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_ship_mode_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_warehouse_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_reason_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cr_order_number", - type: [ - "string", - "null" - ] - }, - { - name: "cr_return_quantity", - type: [ - "int32", - "null" - ] - }, - { - name: "cr_return_amount", - type: [ - "float64", - "null" - ] - }, - { - name: "cr_return_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "cr_return_amt_inc_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "cr_fee", - type: [ - "float64", - "null" - ] - }, - { - name: "cr_return_ship_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "cr_refunded_cash", - type: [ - "float64", - "null" - ] - }, - { - name: "cr_reversed_charge", - type: [ - "float64", - "null" - ] - }, - { - name: "cr_store_credit", - type: [ - "float64", - "null" - ] - }, - { - name: "cr_net_loss", - type: [ - "float64", - "null" - ] - } - ] +catalog_returns::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "cr_returned_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_returned_time_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_item_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_refunded_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_refunded_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_refunded_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_refunded_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_returning_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_returning_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_returning_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_returning_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_call_center_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_catalog_page_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_ship_mode_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_warehouse_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_reason_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cr_order_number", + type: [ + "string", + "null" + ] + }, + { + name: "cr_return_quantity", + type: [ + "int32", + "null" + ] + }, + { + name: "cr_return_amount", + type: [ + "float64", + "null" + ] + }, + { + name: "cr_return_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "cr_return_amt_inc_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "cr_fee", + type: [ + "float64", + "null" + ] + }, + { + name: "cr_return_ship_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "cr_refunded_cash", + type: [ + "float64", + "null" + ] + }, + { + name: "cr_reversed_charge", + type: [ + "float64", + "null" + ] + }, + { + name: "cr_store_credit", + type: [ + "float64", + "null" + ] + }, + { + name: "cr_net_loss", + type: [ + "float64", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_sales.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_sales.ion index 0c51507d18..b6f620e99c 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_sales.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/catalog_sales.ion @@ -1,238 +1,240 @@ -{ - type: "struct", - name: "catalog_sales", - fields: [ - { - name: "cs_sold_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_sold_time_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_ship_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_bill_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_bill_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_bill_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_bill_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_ship_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_ship_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_ship_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_ship_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_call_center_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_catalog_page_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_ship_mode_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_warehouse_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_item_sk", - type: "string" - }, - { - name: "cs_promo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cs_order_number", - type: "string" - }, - { - name: "cs_quantity", - type: [ - "int32", - "null" - ] - }, - { - name: "cs_wholesale_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_list_price", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_sales_price", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_ext_discount_amt", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_ext_sales_price", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_ext_wholesale_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_ext_list_price", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_ext_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_coupon_amt", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_ext_ship_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_net_paid", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_net_paid_inc_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_net_paid_inc_ship", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_net_paid_inc_ship_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "cs_net_profit", - type: [ - "float64", - "null" - ] - } - ] +catalog_sales::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "cs_sold_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_sold_time_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_ship_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_bill_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_bill_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_bill_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_bill_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_ship_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_ship_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_ship_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_ship_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_call_center_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_catalog_page_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_ship_mode_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_warehouse_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_item_sk", + type: "string" + }, + { + name: "cs_promo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cs_order_number", + type: "string" + }, + { + name: "cs_quantity", + type: [ + "int32", + "null" + ] + }, + { + name: "cs_wholesale_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_list_price", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_sales_price", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_ext_discount_amt", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_ext_sales_price", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_ext_wholesale_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_ext_list_price", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_ext_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_coupon_amt", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_ext_ship_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_net_paid", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_net_paid_inc_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_net_paid_inc_ship", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_net_paid_inc_ship_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "cs_net_profit", + type: [ + "float64", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer.ion index de4fa85439..55b76c52ec 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer.ion @@ -1,133 +1,134 @@ -{ - type: "struct", - name: "customer", - "namespace": "customer", - fields: [ - { - name: "c_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "c_customer_id", - type: [ - "string", - "null" - ] - }, - { - name: "c_current_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "c_current_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "c_current_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "c_first_shipto_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "c_first_sales_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "c_salutation", - type: [ - "string", - "null" - ] - }, - { - name: "c_first_name", - type: [ - "string", - "null" - ] - }, - { - name: "c_last_name", - type: [ - "string", - "null" - ] - }, - { - name: "c_preferred_cust_flag", - type: [ - "string", - "null" - ] - }, - { - name: "c_birth_day", - type: [ - "int32", - "null" - ] - }, - { - name: "c_birth_month", - type: [ - "int32", - "null" - ] - }, - { - name: "c_birth_year", - type: [ - "int32", - "null" - ] - }, - { - name: "c_birth_country", - type: [ - "string", - "null" - ] - }, - { - name: "c_login", - type: [ - "string", - "null" - ] - }, - { - name: "c_email_address", - type: [ - "string", - "null" - ] - }, - { - name: "c_last_review_date_sk", - type: [ - "string", - "null" - ] - } - ] +customer::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "c_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "c_customer_id", + type: [ + "string", + "null" + ] + }, + { + name: "c_current_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "c_current_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "c_current_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "c_first_shipto_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "c_first_sales_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "c_salutation", + type: [ + "string", + "null" + ] + }, + { + name: "c_first_name", + type: [ + "string", + "null" + ] + }, + { + name: "c_last_name", + type: [ + "string", + "null" + ] + }, + { + name: "c_preferred_cust_flag", + type: [ + "string", + "null" + ] + }, + { + name: "c_birth_day", + type: [ + "int32", + "null" + ] + }, + { + name: "c_birth_month", + type: [ + "int32", + "null" + ] + }, + { + name: "c_birth_year", + type: [ + "int32", + "null" + ] + }, + { + name: "c_birth_country", + type: [ + "string", + "null" + ] + }, + { + name: "c_login", + type: [ + "string", + "null" + ] + }, + { + name: "c_email_address", + type: [ + "string", + "null" + ] + }, + { + name: "c_last_review_date_sk", + type: [ + "string", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer_address.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer_address.ion index 1f23a6a6e2..7105c7d866 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer_address.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer_address.ion @@ -1,97 +1,99 @@ -{ - type: "struct", - name: "customer_address", - fields: [ - { - name: "ca_address_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ca_address_id", - type: [ - "string", - "null" - ] - }, - { - name: "ca_street_number", - type: [ - "string", - "null" - ] - }, - { - name: "ca_street_name", - type: [ - "string", - "null" - ] - }, - { - name: "ca_street_type", - type: [ - "string", - "null" - ] - }, - { - name: "ca_suite_number", - type: [ - "string", - "null" - ] - }, - { - name: "ca_city", - type: [ - "string", - "null" - ] - }, - { - name: "ca_county", - type: [ - "string", - "null" - ] - }, - { - name: "ca_state", - type: [ - "string", - "null" - ] - }, - { - name: "ca_zip", - type: [ - "string", - "null" - ] - }, - { - name: "ca_country", - type: [ - "string", - "null" - ] - }, - { - name: "ca_gmt_offset", - type: [ - "float64", - "null" - ] - }, - { - name: "ca_location_type", - type: [ - "string", - "null" - ] - } - ] +customer_address::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "ca_address_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ca_address_id", + type: [ + "string", + "null" + ] + }, + { + name: "ca_street_number", + type: [ + "string", + "null" + ] + }, + { + name: "ca_street_name", + type: [ + "string", + "null" + ] + }, + { + name: "ca_street_type", + type: [ + "string", + "null" + ] + }, + { + name: "ca_suite_number", + type: [ + "string", + "null" + ] + }, + { + name: "ca_city", + type: [ + "string", + "null" + ] + }, + { + name: "ca_county", + type: [ + "string", + "null" + ] + }, + { + name: "ca_state", + type: [ + "string", + "null" + ] + }, + { + name: "ca_zip", + type: [ + "string", + "null" + ] + }, + { + name: "ca_country", + type: [ + "string", + "null" + ] + }, + { + name: "ca_gmt_offset", + type: [ + "float64", + "null" + ] + }, + { + name: "ca_location_type", + type: [ + "string", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer_demographics.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer_demographics.ion index ca60798a93..9634b7762c 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer_demographics.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/customer_demographics.ion @@ -1,69 +1,71 @@ -{ - type: "struct", - name: "customer_demographics", - fields: [ - { - name: "cd_demo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "cd_gender", - type: [ - "string", - "null" - ] - }, - { - name: "cd_marital_status", - type: [ - "string", - "null" - ] - }, - { - name: "cd_education_status", - type: [ - "string", - "null" - ] - }, - { - name: "cd_purchase_estimate", - type: [ - "int32", - "null" - ] - }, - { - name: "cd_credit_rating", - type: [ - "string", - "null" - ] - }, - { - name: "cd_dep_count", - type: [ - "int32", - "null" - ] - }, - { - name: "cd_dep_employed_count", - type: [ - "int32", - "null" - ] - }, - { - name: "cd_dep_college_count", - type: [ - "int32", - "null" - ] - } - ] +customer_demographics::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "cd_demo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "cd_gender", + type: [ + "string", + "null" + ] + }, + { + name: "cd_marital_status", + type: [ + "string", + "null" + ] + }, + { + name: "cd_education_status", + type: [ + "string", + "null" + ] + }, + { + name: "cd_purchase_estimate", + type: [ + "int32", + "null" + ] + }, + { + name: "cd_credit_rating", + type: [ + "string", + "null" + ] + }, + { + name: "cd_dep_count", + type: [ + "int32", + "null" + ] + }, + { + name: "cd_dep_employed_count", + type: [ + "int32", + "null" + ] + }, + { + name: "cd_dep_college_count", + type: [ + "int32", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/date_dim.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/date_dim.ion index 5fa87fc7d9..9ae5bb3789 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/date_dim.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/date_dim.ion @@ -1,202 +1,204 @@ -{ - type: "struct", - name: "date_dim", - fields: [ - { - name: "d_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "d_date_id", - type: [ - "string", - "null" - ] - }, - { - name: "d_date", - type: [ - "int64", - "null" - ] - }, - { - name: "d_month_seq", - type: [ - "int32", - "null" - ] - }, - { - name: "d_week_seq", - type: [ - "int32", - "null" - ] - }, - { - name: "d_quarter_seq", - type: [ - "int32", - "null" - ] - }, - { - name: "d_year", - type: [ - "int32", - "null" - ] - }, - { - name: "d_dow", - type: [ - "int32", - "null" - ] - }, - { - name: "d_moy", - type: [ - "int32", - "null" - ] - }, - { - name: "d_dom", - type: [ - "int32", - "null" - ] - }, - { - name: "d_qoy", - type: [ - "int32", - "null" - ] - }, - { - name: "d_fy_year", - type: [ - "int32", - "null" - ] - }, - { - name: "d_fy_quarter_seq", - type: [ - "int32", - "null" - ] - }, - { - name: "d_fy_week_seq", - type: [ - "int32", - "null" - ] - }, - { - name: "d_day_name", - type: [ - "string", - "null" - ] - }, - { - name: "d_quarter_name", - type: [ - "string", - "null" - ] - }, - { - name: "d_holiday", - type: [ - "string", - "null" - ] - }, - { - name: "d_weekend", - type: [ - "string", - "null" - ] - }, - { - name: "d_following_holiday", - type: [ - "string", - "null" - ] - }, - { - name: "d_first_dom", - type: [ - "int32", - "null" - ] - }, - { - name: "d_last_dom", - type: [ - "int32", - "null" - ] - }, - { - name: "d_same_day_ly", - type: [ - "int32", - "null" - ] - }, - { - name: "d_same_day_lq", - type: [ - "int32", - "null" - ] - }, - { - name: "d_current_day", - type: [ - "string", - "null" - ] - }, - { - name: "d_current_week", - type: [ - "string", - "null" - ] - }, - { - name: "d_current_month", - type: [ - "string", - "null" - ] - }, - { - name: "d_current_quarter", - type: [ - "string", - "null" - ] - }, - { - name: "d_current_year", - type: [ - "string", - "null" - ] - } - ] +date_dim::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "d_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "d_date_id", + type: [ + "string", + "null" + ] + }, + { + name: "d_date", + type: [ + "int64", + "null" + ] + }, + { + name: "d_month_seq", + type: [ + "int32", + "null" + ] + }, + { + name: "d_week_seq", + type: [ + "int32", + "null" + ] + }, + { + name: "d_quarter_seq", + type: [ + "int32", + "null" + ] + }, + { + name: "d_year", + type: [ + "int32", + "null" + ] + }, + { + name: "d_dow", + type: [ + "int32", + "null" + ] + }, + { + name: "d_moy", + type: [ + "int32", + "null" + ] + }, + { + name: "d_dom", + type: [ + "int32", + "null" + ] + }, + { + name: "d_qoy", + type: [ + "int32", + "null" + ] + }, + { + name: "d_fy_year", + type: [ + "int32", + "null" + ] + }, + { + name: "d_fy_quarter_seq", + type: [ + "int32", + "null" + ] + }, + { + name: "d_fy_week_seq", + type: [ + "int32", + "null" + ] + }, + { + name: "d_day_name", + type: [ + "string", + "null" + ] + }, + { + name: "d_quarter_name", + type: [ + "string", + "null" + ] + }, + { + name: "d_holiday", + type: [ + "string", + "null" + ] + }, + { + name: "d_weekend", + type: [ + "string", + "null" + ] + }, + { + name: "d_following_holiday", + type: [ + "string", + "null" + ] + }, + { + name: "d_first_dom", + type: [ + "int32", + "null" + ] + }, + { + name: "d_last_dom", + type: [ + "int32", + "null" + ] + }, + { + name: "d_same_day_ly", + type: [ + "int32", + "null" + ] + }, + { + name: "d_same_day_lq", + type: [ + "int32", + "null" + ] + }, + { + name: "d_current_day", + type: [ + "string", + "null" + ] + }, + { + name: "d_current_week", + type: [ + "string", + "null" + ] + }, + { + name: "d_current_month", + type: [ + "string", + "null" + ] + }, + { + name: "d_current_quarter", + type: [ + "string", + "null" + ] + }, + { + name: "d_current_year", + type: [ + "string", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/dbgen_version.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/dbgen_version.ion index f6d18ab991..1f66c8ea37 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/dbgen_version.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/dbgen_version.ion @@ -1,34 +1,36 @@ -{ - type: "struct", - name: "dbgen_version", - fields: [ - { - name: "dv_version", - type: [ - "string", - "null" - ] - }, - { - name: "dv_create_date", - type: [ - "int64", - "null" - ] - }, - { - name: "dv_create_time", - type: [ - "int64", - "null" - ] - }, - { - name: "dv_cmdline_args", - type: [ - "string", - "null" - ] - } - ] +dbgen_version::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "dv_version", + type: [ + "string", + "null" + ] + }, + { + name: "dv_create_date", + type: [ + "int64", + "null" + ] + }, + { + name: "dv_create_time", + type: [ + "int64", + "null" + ] + }, + { + name: "dv_cmdline_args", + type: [ + "string", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/household_demographics.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/household_demographics.ion index 949593bd78..6f361cfb82 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/household_demographics.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/household_demographics.ion @@ -1,41 +1,43 @@ -{ - type: "struct", - name: "household_demographics", - fields: [ - { - name: "hd_demo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "hd_income_band_sk", - type: [ - "string", - "null" - ] - }, - { - name: "hd_buy_potential", - type: [ - "string", - "null" - ] - }, - { - name: "hd_dep_count", - type: [ - "int32", - "null" - ] - }, - { - name: "hd_vehicle_count", - type: [ - "int32", - "null" - ] - } - ] +household_demographics::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "hd_demo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "hd_income_band_sk", + type: [ + "string", + "null" + ] + }, + { + name: "hd_buy_potential", + type: [ + "string", + "null" + ] + }, + { + name: "hd_dep_count", + type: [ + "int32", + "null" + ] + }, + { + name: "hd_vehicle_count", + type: [ + "int32", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/income_band.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/income_band.ion index 704f12aac0..ccf094c26d 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/income_band.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/income_band.ion @@ -1,27 +1,29 @@ -{ - type: "struct", - name: "income_band", - fields: [ - { - name: "ib_income_band_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ib_lower_bound", - type: [ - "int32", - "null" - ] - }, - { - name: "ib_upper_bound", - type: [ - "int32", - "null" - ] - } - ] +income_band::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "ib_income_band_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ib_lower_bound", + type: [ + "int32", + "null" + ] + }, + { + name: "ib_upper_bound", + type: [ + "int32", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/inventory.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/inventory.ion index 56b1367ab6..6552d9111c 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/inventory.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/inventory.ion @@ -1,34 +1,36 @@ -{ - type: "struct", - name: "inventory", - fields: [ - { - name: "inv_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "inv_item_sk", - type: [ - "string", - "null" - ] - }, - { - name: "inv_warehouse_sk", - type: [ - "string", - "null" - ] - }, - { - name: "inv_quantity_on_hand", - type: [ - "int32", - "null" - ] - } - ] +inventory::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "inv_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "inv_item_sk", + type: [ + "string", + "null" + ] + }, + { + name: "inv_warehouse_sk", + type: [ + "string", + "null" + ] + }, + { + name: "inv_quantity_on_hand", + type: [ + "int32", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/item.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/item.ion index 3d86749fe3..b6cb30233c 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/item.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/item.ion @@ -1,160 +1,162 @@ -{ - type: "struct", - name: "item", - fields: [ - { - name: "i_item_sk", - type: [ - "string", - "null" - ] - }, - { - name: "i_item_id", - type: [ - "string", - "null" - ] - }, - { - name: "i_rec_start_date", - type: [ - "int64", - "null" - ] - }, - { - name: "i_rec_end_date", - type: [ - "int64", - "null" - ] - }, - { - name: "i_item_desc", - type: [ - "string", - "null" - ] - }, - { - name: "i_current_price", - type: [ - "float64", - "null" - ] - }, - { - name: "i_wholesale_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "i_brand_id", - type: [ - "int32", - "null" - ] - }, - { - name: "i_brand", - type: [ - "string", - "null" - ] - }, - { - name: "i_class_id", - type: [ - "int32", - "null" - ] - }, - { - name: "i_class", - type: [ - "string", - "null" - ] - }, - { - name: "i_category_id", - type: [ - "int32", - "null" - ] - }, - { - name: "i_category", - type: [ - "string", - "null" - ] - }, - { - name: "i_manufact_id", - type: [ - "int32", - "null" - ] - }, - { - name: "i_manufact", - type: [ - "string", - "null" - ] - }, - { - name: "i_size", - type: [ - "string", - "null" - ] - }, - { - name: "i_formulation", - type: [ - "string", - "null" - ] - }, - { - name: "i_color", - type: [ - "string", - "null" - ] - }, - { - name: "i_units", - type: [ - "string", - "null" - ] - }, - { - name: "i_container", - type: [ - "string", - "null" - ] - }, - { - name: "i_manager_id", - type: [ - "int32", - "null" - ] - }, - { - name: "i_product_name", - type: [ - "string", - "null" - ] - } - ] +item::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "i_item_sk", + type: [ + "string", + "null" + ] + }, + { + name: "i_item_id", + type: [ + "string", + "null" + ] + }, + { + name: "i_rec_start_date", + type: [ + "int64", + "null" + ] + }, + { + name: "i_rec_end_date", + type: [ + "int64", + "null" + ] + }, + { + name: "i_item_desc", + type: [ + "string", + "null" + ] + }, + { + name: "i_current_price", + type: [ + "float64", + "null" + ] + }, + { + name: "i_wholesale_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "i_brand_id", + type: [ + "int32", + "null" + ] + }, + { + name: "i_brand", + type: [ + "string", + "null" + ] + }, + { + name: "i_class_id", + type: [ + "int32", + "null" + ] + }, + { + name: "i_class", + type: [ + "string", + "null" + ] + }, + { + name: "i_category_id", + type: [ + "int32", + "null" + ] + }, + { + name: "i_category", + type: [ + "string", + "null" + ] + }, + { + name: "i_manufact_id", + type: [ + "int32", + "null" + ] + }, + { + name: "i_manufact", + type: [ + "string", + "null" + ] + }, + { + name: "i_size", + type: [ + "string", + "null" + ] + }, + { + name: "i_formulation", + type: [ + "string", + "null" + ] + }, + { + name: "i_color", + type: [ + "string", + "null" + ] + }, + { + name: "i_units", + type: [ + "string", + "null" + ] + }, + { + name: "i_container", + type: [ + "string", + "null" + ] + }, + { + name: "i_manager_id", + type: [ + "int32", + "null" + ] + }, + { + name: "i_product_name", + type: [ + "string", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/promotion.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/promotion.ion index 0ed0776165..be727f19f6 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/promotion.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/promotion.ion @@ -1,139 +1,141 @@ -{ - type: "struct", - name: "promotion", - fields: [ - { - name: "p_promo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "p_promo_id", - type: [ - "string", - "null" - ] - }, - { - name: "p_start_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "p_end_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "p_item_sk", - type: [ - "string", - "null" - ] - }, - { - name: "p_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "p_response_targe", - type: [ - "int32", - "null" - ] - }, - { - name: "p_promo_name", - type: [ - "string", - "null" - ] - }, - { - name: "p_channel_dmail", - type: [ - "string", - "null" - ] - }, - { - name: "p_channel_email", - type: [ - "string", - "null" - ] - }, - { - name: "p_channel_catalog", - type: [ - "string", - "null" - ] - }, - { - name: "p_channel_tv", - type: [ - "string", - "null" - ] - }, - { - name: "p_channel_radio", - type: [ - "string", - "null" - ] - }, - { - name: "p_channel_press", - type: [ - "string", - "null" - ] - }, - { - name: "p_channel_event", - type: [ - "string", - "null" - ] - }, - { - name: "p_channel_demo", - type: [ - "string", - "null" - ] - }, - { - name: "p_channel_details", - type: [ - "string", - "null" - ] - }, - { - name: "p_purpose", - type: [ - "string", - "null" - ] - }, - { - name: "p_discount_active", - type: [ - "string", - "null" - ] - } - ] +promotion::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "p_promo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "p_promo_id", + type: [ + "string", + "null" + ] + }, + { + name: "p_start_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "p_end_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "p_item_sk", + type: [ + "string", + "null" + ] + }, + { + name: "p_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "p_response_targe", + type: [ + "int32", + "null" + ] + }, + { + name: "p_promo_name", + type: [ + "string", + "null" + ] + }, + { + name: "p_channel_dmail", + type: [ + "string", + "null" + ] + }, + { + name: "p_channel_email", + type: [ + "string", + "null" + ] + }, + { + name: "p_channel_catalog", + type: [ + "string", + "null" + ] + }, + { + name: "p_channel_tv", + type: [ + "string", + "null" + ] + }, + { + name: "p_channel_radio", + type: [ + "string", + "null" + ] + }, + { + name: "p_channel_press", + type: [ + "string", + "null" + ] + }, + { + name: "p_channel_event", + type: [ + "string", + "null" + ] + }, + { + name: "p_channel_demo", + type: [ + "string", + "null" + ] + }, + { + name: "p_channel_details", + type: [ + "string", + "null" + ] + }, + { + name: "p_purpose", + type: [ + "string", + "null" + ] + }, + { + name: "p_discount_active", + type: [ + "string", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/reason.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/reason.ion index a31b1134e1..4223e44e71 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/reason.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/reason.ion @@ -1,27 +1,29 @@ -{ - type: "struct", - name: "reason", - fields: [ - { - name: "r_reason_sk", - type: [ - "string", - "null" - ] - }, - { - name: "r_reason_id", - type: [ - "string", - "null" - ] - }, - { - name: "r_reason_desc", - type: [ - "string", - "null" - ] - } - ] +reason::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "r_reason_sk", + type: [ + "string", + "null" + ] + }, + { + name: "r_reason_id", + type: [ + "string", + "null" + ] + }, + { + name: "r_reason_desc", + type: [ + "string", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/ship_mode.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/ship_mode.ion index d072b5709e..08ae3fbcb1 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/ship_mode.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/ship_mode.ion @@ -1,48 +1,50 @@ -{ - type: "struct", - name: "ship_mode", - fields: [ - { - name: "sm_ship_mode_sk", - type: [ - "string", - "null" - ] - }, - { - name: "sm_ship_mode_id", - type: [ - "string", - "null" - ] - }, - { - name: "sm_type", - type: [ - "string", - "null" - ] - }, - { - name: "sm_code", - type: [ - "string", - "null" - ] - }, - { - name: "sm_carrier", - type: [ - "string", - "null" - ] - }, - { - name: "sm_contract", - type: [ - "string", - "null" - ] - } - ] +ship_mode::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "sm_ship_mode_sk", + type: [ + "string", + "null" + ] + }, + { + name: "sm_ship_mode_id", + type: [ + "string", + "null" + ] + }, + { + name: "sm_type", + type: [ + "string", + "null" + ] + }, + { + name: "sm_code", + type: [ + "string", + "null" + ] + }, + { + name: "sm_carrier", + type: [ + "string", + "null" + ] + }, + { + name: "sm_contract", + type: [ + "string", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store.ion index 391458f8d4..b0a3566a7d 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store.ion @@ -1,204 +1,205 @@ -{ - type: "struct", - name: "store", - fields: [ - { - name: "s_store_sk", - type: "string", - }, - { - name: "s_store_id", - type: "string" - }, - { - name: "s_rec_start_date", - type: [ - "date", - "null" - ] - }, - { - name: "s_rec_end_date", - type: [ - "date", - "null" - ] - }, - { - name: "s_closed_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "s_store_name", - type: [ - "string", - "null" - ] - }, - { - name: "s_number_employees", - type: [ - "int32", - "null" - ] - }, - { - name: "s_floor_space", - type: [ - "int32", - "null" - ] - }, - { - name: "s_hours", - type: [ - "string", - "null" - ] - }, - { - name: "s_manager", - type: [ - "string", - "null" - ] - }, - { - name: "s_market_id", - type: [ - "int32", - "null" - ] - }, - { - name: "s_geography_class", - type: [ - "string", - "null" - ] - }, - { - name: "s_market_desc", - type: [ - "string", - "null" - ] - }, - { - name: "s_market_manager", - type: [ - "string", - "null" - ] - }, - { - name: "s_division_id", - type: [ - "int32", - "null" - ] - }, - { - name: "s_division_name", - type: [ - "string", - "null" - ] - }, - { - name: "s_company_id", - type: [ - "int32", - "null" - ] - }, - { - name: "s_company_name", - type: [ - "string", - "null" - ] - }, - { - name: "s_street_number", - type: [ - "string", - "null" - ] - }, - { - name: "s_street_name", - type: [ - "string", - "null" - ] - }, - { - name: "s_street_type", - type: [ - "string", - "null" - ] - }, - { - name: "s_suite_number", - type: [ - "string", - "null" - ] - }, - { - name: "s_city", - type: [ - "string", - "null" - ] - }, - { - name: "s_county", - type: [ - "string", - "null" - ] - }, - { - name: "s_state", - type: [ - "string", - "null" - ] - }, - { - name: "s_zip", - type: [ - "string", - "null" - ] - }, - { - name: "s_country", - type: [ - "string", - "null" - ] - }, - { - name: "s_gmt_offset", - type: [ - "float64", - "null" - ] - }, - { - name: "s_tax_precentage", - type: [ - "float64", - "null" - ] - } - ] +store::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "s_store_sk", + type: "string", + }, + { + name: "s_store_id", + type: "string" + }, + { + name: "s_rec_start_date", + type: [ + "date", + "null" + ] + }, + { + name: "s_rec_end_date", + type: [ + "date", + "null" + ] + }, + { + name: "s_closed_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "s_store_name", + type: [ + "string", + "null" + ] + }, + { + name: "s_number_employees", + type: [ + "int32", + "null" + ] + }, + { + name: "s_floor_space", + type: [ + "int32", + "null" + ] + }, + { + name: "s_hours", + type: [ + "string", + "null" + ] + }, + { + name: "s_manager", + type: [ + "string", + "null" + ] + }, + { + name: "s_market_id", + type: [ + "int32", + "null" + ] + }, + { + name: "s_geography_class", + type: [ + "string", + "null" + ] + }, + { + name: "s_market_desc", + type: [ + "string", + "null" + ] + }, + { + name: "s_market_manager", + type: [ + "string", + "null" + ] + }, + { + name: "s_division_id", + type: [ + "int32", + "null" + ] + }, + { + name: "s_division_name", + type: [ + "string", + "null" + ] + }, + { + name: "s_company_id", + type: [ + "int32", + "null" + ] + }, + { + name: "s_company_name", + type: [ + "string", + "null" + ] + }, + { + name: "s_street_number", + type: [ + "string", + "null" + ] + }, + { + name: "s_street_name", + type: [ + "string", + "null" + ] + }, + { + name: "s_street_type", + type: [ + "string", + "null" + ] + }, + { + name: "s_suite_number", + type: [ + "string", + "null" + ] + }, + { + name: "s_city", + type: [ + "string", + "null" + ] + }, + { + name: "s_county", + type: [ + "string", + "null" + ] + }, + { + name: "s_state", + type: [ + "string", + "null" + ] + }, + { + name: "s_zip", + type: [ + "string", + "null" + ] + }, + { + name: "s_country", + type: [ + "string", + "null" + ] + }, + { + name: "s_gmt_offset", + type: [ + "float64", + "null" + ] + }, + { + name: "s_tax_precentage", + type: [ + "float64", + "null" + ] + } + ] + } } - diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store_returns.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store_returns.ion index c53c05a0c8..55347e7e46 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store_returns.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store_returns.ion @@ -1,140 +1,142 @@ -{ - type: "struct", - name: "store_returns", - fields: [ - { - name: "sr_returned_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "sr_return_time_sk", - type: [ - "string", - "null" - ] - }, - { - name: "sr_item_sk", - type: "string" - }, - { - name: "sr_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "sr_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "sr_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "sr_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "sr_store_sk", - type: [ - "string", - "null" - ] - }, - { - name: "sr_reason_sk", - type: [ - "string", - "null" - ] - }, - { - name: "sr_ticket_number", - type: "string", - }, - { - name: "sr_return_quantity", - type: [ - "int32", - "null" - ] - }, - { - name: "sr_return_amt", - type: [ - "float64", - "null" - ] - }, - { - name: "sr_return_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "sr_return_amt_inc_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "sr_fee", - type: [ - "float64", - "null" - ] - }, - { - name: "sr_return_ship_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "sr_refunded_cash", - type: [ - "float64", - "null" - ] - }, - { - name: "sr_reversed_charge", - type: [ - "float64", - "null" - ] - }, - { - name: "sr_store_credit", - type: [ - "float64", - "null" - ] - }, - { - name: "sr_net_loss", - type: [ - "float64", - "null" - ] - } - ] +store_returns::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "sr_returned_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "sr_return_time_sk", + type: [ + "string", + "null" + ] + }, + { + name: "sr_item_sk", + type: "string" + }, + { + name: "sr_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "sr_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "sr_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "sr_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "sr_store_sk", + type: [ + "string", + "null" + ] + }, + { + name: "sr_reason_sk", + type: [ + "string", + "null" + ] + }, + { + name: "sr_ticket_number", + type: "string", + }, + { + name: "sr_return_quantity", + type: [ + "int32", + "null" + ] + }, + { + name: "sr_return_amt", + type: [ + "float64", + "null" + ] + }, + { + name: "sr_return_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "sr_return_amt_inc_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "sr_fee", + type: [ + "float64", + "null" + ] + }, + { + name: "sr_return_ship_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "sr_refunded_cash", + type: [ + "float64", + "null" + ] + }, + { + name: "sr_reversed_charge", + type: [ + "float64", + "null" + ] + }, + { + name: "sr_store_credit", + type: [ + "float64", + "null" + ] + }, + { + name: "sr_net_loss", + type: [ + "float64", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store_sales.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store_sales.ion index a0322de7a7..64676ed271 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store_sales.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/store_sales.ion @@ -1,161 +1,163 @@ -{ - type: "struct", - name: "store_sales", - fields: [ - { - name: "ss_sold_date_sk", - type: [ - "date", - "null" - ] - }, - { - name: "ss_sold_time_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ss_item_sk", - type: "string" - }, - { - name: "ss_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ss_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ss_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ss_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ss_store_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ss_promo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ss_ticket_number", - type: "string" - }, - { - name: "ss_quantity", - type: [ - "int32", - "null" - ] - }, - { - name: "ss_wholesale_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_list_price", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_sales_price", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_ext_discount_amt", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_ext_sales_price", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_ext_wholesale_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_ext_list_price", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_ext_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_coupon_amt", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_net_paid", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_net_paid_inc_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "ss_net_profit", - type: [ - "float64", - "null" - ] - } - ] +store_sales::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "ss_sold_date_sk", + type: [ + "date", + "null" + ] + }, + { + name: "ss_sold_time_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ss_item_sk", + type: "string" + }, + { + name: "ss_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ss_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ss_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ss_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ss_store_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ss_promo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ss_ticket_number", + type: "string" + }, + { + name: "ss_quantity", + type: [ + "int32", + "null" + ] + }, + { + name: "ss_wholesale_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_list_price", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_sales_price", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_ext_discount_amt", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_ext_sales_price", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_ext_wholesale_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_ext_list_price", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_ext_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_coupon_amt", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_net_paid", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_net_paid_inc_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "ss_net_profit", + type: [ + "float64", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/time_dim.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/time_dim.ion index 06c9190dc4..55b5ce4f47 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/time_dim.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/time_dim.ion @@ -1,76 +1,78 @@ -{ - type: "struct", - name: "time_dim", - fields: [ - { - name: "t_time_sk", - type: [ - "string", - "null" - ] - }, - { - name: "t_time_id", - type: [ - "string", - "null" - ] - }, - { - name: "t_time", - type: [ - "int32", - "null" - ] - }, - { - name: "t_hour", - type: [ - "int32", - "null" - ] - }, - { - name: "t_minute", - type: [ - "int32", - "null" - ] - }, - { - name: "t_second", - type: [ - "int32", - "null" - ] - }, - { - name: "t_am_pm", - type: [ - "string", - "null" - ] - }, - { - name: "t_shift", - type: [ - "string", - "null" - ] - }, - { - name: "t_sub_shift", - type: [ - "string", - "null" - ] - }, - { - name: "t_meal_time", - type: [ - "string", - "null" - ] - } - ] +time_dim::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "t_time_sk", + type: [ + "string", + "null" + ] + }, + { + name: "t_time_id", + type: [ + "string", + "null" + ] + }, + { + name: "t_time", + type: [ + "int32", + "null" + ] + }, + { + name: "t_hour", + type: [ + "int32", + "null" + ] + }, + { + name: "t_minute", + type: [ + "int32", + "null" + ] + }, + { + name: "t_second", + type: [ + "int32", + "null" + ] + }, + { + name: "t_am_pm", + type: [ + "string", + "null" + ] + }, + { + name: "t_shift", + type: [ + "string", + "null" + ] + }, + { + name: "t_sub_shift", + type: [ + "string", + "null" + ] + }, + { + name: "t_meal_time", + type: [ + "string", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/warehouse.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/warehouse.ion index 3e6c4cbfb0..170d486ce5 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/warehouse.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/warehouse.ion @@ -1,104 +1,106 @@ -{ - type: "struct", - name: "warehouse", - fields: [ - { - name: "w_warehouse_sk", - type: [ - "string", - "null" - ] - }, - { - name: "w_warehouse_id", - type: [ - "string", - "null" - ] - }, - { - name: "w_warehouse_name", - type: [ - "string", - "null" - ] - }, - { - name: "w_warehouse_sq_ft", - type: [ - "int32", - "null" - ] - }, - { - name: "w_street_number", - type: [ - "string", - "null" - ] - }, - { - name: "w_street_name", - type: [ - "string", - "null" - ] - }, - { - name: "w_street_type", - type: [ - "string", - "null" - ] - }, - { - name: "w_suite_number", - type: [ - "string", - "null" - ] - }, - { - name: "w_city", - type: [ - "string", - "null" - ] - }, - { - name: "w_county", - type: [ - "string", - "null" - ] - }, - { - name: "w_state", - type: [ - "string", - "null" - ] - }, - { - name: "w_zip", - type: [ - "string", - "null" - ] - }, - { - name: "w_country", - type: [ - "string", - "null" - ] - }, - { - name: "w_gmt_offset", - type: [ - "float64", - "null" - ] - } - ] +warehouse::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "w_warehouse_sk", + type: [ + "string", + "null" + ] + }, + { + name: "w_warehouse_id", + type: [ + "string", + "null" + ] + }, + { + name: "w_warehouse_name", + type: [ + "string", + "null" + ] + }, + { + name: "w_warehouse_sq_ft", + type: [ + "int32", + "null" + ] + }, + { + name: "w_street_number", + type: [ + "string", + "null" + ] + }, + { + name: "w_street_name", + type: [ + "string", + "null" + ] + }, + { + name: "w_street_type", + type: [ + "string", + "null" + ] + }, + { + name: "w_suite_number", + type: [ + "string", + "null" + ] + }, + { + name: "w_city", + type: [ + "string", + "null" + ] + }, + { + name: "w_county", + type: [ + "string", + "null" + ] + }, + { + name: "w_state", + type: [ + "string", + "null" + ] + }, + { + name: "w_zip", + type: [ + "string", + "null" + ] + }, + { + name: "w_country", + type: [ + "string", + "null" + ] + }, + { + name: "w_gmt_offset", + type: [ + "float64", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_page.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_page.ion index 481388f88b..56b421dc5e 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_page.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_page.ion @@ -1,104 +1,106 @@ -{ - type: "struct", - name: "web_page", - fields: [ - { - name: "wp_web_page_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wp_web_page_id", - type: [ - "string", - "null" - ] - }, - { - name: "wp_rec_start_date", - type: [ - "int64", - "null" - ] - }, - { - name: "wp_rec_end_date", - type: [ - "int64", - "null" - ] - }, - { - name: "wp_creation_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wp_access_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wp_autogen_flag", - type: [ - "string", - "null" - ] - }, - { - name: "wp_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wp_url", - type: [ - "string", - "null" - ] - }, - { - name: "wp_type", - type: [ - "string", - "null" - ] - }, - { - name: "wp_char_count", - type: [ - "int32", - "null" - ] - }, - { - name: "wp_link_count", - type: [ - "int32", - "null" - ] - }, - { - name: "wp_image_count", - type: [ - "int32", - "null" - ] - }, - { - name: "wp_max_ad_count", - type: [ - "int32", - "null" - ] - } - ] +web_page::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "wp_web_page_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wp_web_page_id", + type: [ + "string", + "null" + ] + }, + { + name: "wp_rec_start_date", + type: [ + "int64", + "null" + ] + }, + { + name: "wp_rec_end_date", + type: [ + "int64", + "null" + ] + }, + { + name: "wp_creation_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wp_access_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wp_autogen_flag", + type: [ + "string", + "null" + ] + }, + { + name: "wp_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wp_url", + type: [ + "string", + "null" + ] + }, + { + name: "wp_type", + type: [ + "string", + "null" + ] + }, + { + name: "wp_char_count", + type: [ + "int32", + "null" + ] + }, + { + name: "wp_link_count", + type: [ + "int32", + "null" + ] + }, + { + name: "wp_image_count", + type: [ + "int32", + "null" + ] + }, + { + name: "wp_max_ad_count", + type: [ + "int32", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_returns.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_returns.ion index f1e221decf..336733c5ce 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_returns.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_returns.ion @@ -1,174 +1,176 @@ -{ - type: "struct", - name: "web_returns", - fields: [ - { - name: "wr_returned_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_returned_time_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_item_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_refunded_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_refunded_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_refunded_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_refunded_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_returning_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_returning_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_returning_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_returning_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_web_page_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_reason_sk", - type: [ - "string", - "null" - ] - }, - { - name: "wr_order_number", - type: [ - "string", - "null" - ] - }, - { - name: "wr_return_quantity", - type: [ - "int32", - "null" - ] - }, - { - name: "wr_return_amt", - type: [ - "float64", - "null" - ] - }, - { - name: "wr_return_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "wr_return_amt_inc_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "wr_fee", - type: [ - "float64", - "null" - ] - }, - { - name: "wr_return_ship_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "wr_refunded_cash", - type: [ - "float64", - "null" - ] - }, - { - name: "wr_reversed_charge", - type: [ - "float64", - "null" - ] - }, - { - name: "wr_account_credit", - type: [ - "float64", - "null" - ] - }, - { - name: "wr_net_loss", - type: [ - "float64", - "null" - ] - } - ] +web_returns::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "wr_returned_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_returned_time_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_item_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_refunded_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_refunded_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_refunded_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_refunded_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_returning_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_returning_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_returning_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_returning_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_web_page_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_reason_sk", + type: [ + "string", + "null" + ] + }, + { + name: "wr_order_number", + type: [ + "string", + "null" + ] + }, + { + name: "wr_return_quantity", + type: [ + "int32", + "null" + ] + }, + { + name: "wr_return_amt", + type: [ + "float64", + "null" + ] + }, + { + name: "wr_return_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "wr_return_amt_inc_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "wr_fee", + type: [ + "float64", + "null" + ] + }, + { + name: "wr_return_ship_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "wr_refunded_cash", + type: [ + "float64", + "null" + ] + }, + { + name: "wr_reversed_charge", + type: [ + "float64", + "null" + ] + }, + { + name: "wr_account_credit", + type: [ + "float64", + "null" + ] + }, + { + name: "wr_net_loss", + type: [ + "float64", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_sales.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_sales.ion index 04d6668a0a..cb1f356148 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_sales.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_sales.ion @@ -1,244 +1,246 @@ -{ - type: "struct", - name: "web_sales", - fields: [ - { - name: "ws_sold_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_sold_time_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_ship_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_item_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_bill_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_bill_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_bill_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_bill_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_ship_customer_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_ship_cdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_ship_hdemo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_ship_addr_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_web_page_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_web_site_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_ship_mode_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_warehouse_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_promo_sk", - type: [ - "string", - "null" - ] - }, - { - name: "ws_order_number", - type: [ - "string", - "null" - ] - }, - { - name: "ws_quantity", - type: [ - "int32", - "null" - ] - }, - { - name: "ws_wholesale_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_list_price", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_sales_price", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_ext_discount_amt", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_ext_sales_price", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_ext_wholesale_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_ext_list_price", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_ext_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_coupon_amt", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_ext_ship_cost", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_net_paid", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_net_paid_inc_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_net_paid_inc_ship", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_net_paid_inc_ship_tax", - type: [ - "float64", - "null" - ] - }, - { - name: "ws_net_profit", - type: [ - "float64", - "null" - ] - } - ] +web_sales::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "ws_sold_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_sold_time_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_ship_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_item_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_bill_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_bill_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_bill_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_bill_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_ship_customer_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_ship_cdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_ship_hdemo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_ship_addr_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_web_page_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_web_site_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_ship_mode_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_warehouse_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_promo_sk", + type: [ + "string", + "null" + ] + }, + { + name: "ws_order_number", + type: [ + "string", + "null" + ] + }, + { + name: "ws_quantity", + type: [ + "int32", + "null" + ] + }, + { + name: "ws_wholesale_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_list_price", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_sales_price", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_ext_discount_amt", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_ext_sales_price", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_ext_wholesale_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_ext_list_price", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_ext_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_coupon_amt", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_ext_ship_cost", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_net_paid", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_net_paid_inc_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_net_paid_inc_ship", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_net_paid_inc_ship_tax", + type: [ + "float64", + "null" + ] + }, + { + name: "ws_net_profit", + type: [ + "float64", + "null" + ] + } + ] + } } diff --git a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_site.ion b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_site.ion index 9cf90b3e73..372c16bac1 100644 --- a/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_site.ion +++ b/partiql-planner/src/testFixtures/resources/catalogs/default/tpc_ds/web_site.ion @@ -1,188 +1,190 @@ -{ - type: "struct", - name: "web_site", - fields: [ - { - name: "web_site_sk", - type: [ - "string", - "null" - ] - }, - { - name: "web_site_id", - type: [ - "string", - "null" - ] - }, - { - name: "web_rec_start_date", - type: [ - "int64", - "null" - ] - }, - { - name: "web_rec_end_date", - type: [ - "int64", - "null" - ] - }, - { - name: "web_name", - type: [ - "string", - "null" - ] - }, - { - name: "web_open_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "web_close_date_sk", - type: [ - "string", - "null" - ] - }, - { - name: "web_class", - type: [ - "string", - "null" - ] - }, - { - name: "web_manager", - type: [ - "string", - "null" - ] - }, - { - name: "web_mkt_id", - type: [ - "int32", - "null" - ] - }, - { - name: "web_mkt_class", - type: [ - "string", - "null" - ] - }, - { - name: "web_mkt_desc", - type: [ - "string", - "null" - ] - }, - { - name: "web_market_manager", - type: [ - "string", - "null" - ] - }, - { - name: "web_company_id", - type: [ - "int32", - "null" - ] - }, - { - name: "web_company_name", - type: [ - "string", - "null" - ] - }, - { - name: "web_street_number", - type: [ - "string", - "null" - ] - }, - { - name: "web_street_name", - type: [ - "string", - "null" - ] - }, - { - name: "web_street_type", - type: [ - "string", - "null" - ] - }, - { - name: "web_suite_number", - type: [ - "string", - "null" - ] - }, - { - name: "web_city", - type: [ - "string", - "null" - ] - }, - { - name: "web_county", - type: [ - "string", - "null" - ] - }, - { - name: "web_state", - type: [ - "string", - "null" - ] - }, - { - name: "web_zip", - type: [ - "string", - "null" - ] - }, - { - name: "web_country", - type: [ - "string", - "null" - ] - }, - { - name: "web_gmt_offset", - type: [ - "float64", - "null" - ] - }, - { - name: "web_tax_percentage", - type: [ - "float64", - "null" - ] - } - ] +web_site::{ + type: "bag", + items: { + type: "struct", + fields: [ + { + name: "web_site_sk", + type: [ + "string", + "null" + ] + }, + { + name: "web_site_id", + type: [ + "string", + "null" + ] + }, + { + name: "web_rec_start_date", + type: [ + "int64", + "null" + ] + }, + { + name: "web_rec_end_date", + type: [ + "int64", + "null" + ] + }, + { + name: "web_name", + type: [ + "string", + "null" + ] + }, + { + name: "web_open_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "web_close_date_sk", + type: [ + "string", + "null" + ] + }, + { + name: "web_class", + type: [ + "string", + "null" + ] + }, + { + name: "web_manager", + type: [ + "string", + "null" + ] + }, + { + name: "web_mkt_id", + type: [ + "int32", + "null" + ] + }, + { + name: "web_mkt_class", + type: [ + "string", + "null" + ] + }, + { + name: "web_mkt_desc", + type: [ + "string", + "null" + ] + }, + { + name: "web_market_manager", + type: [ + "string", + "null" + ] + }, + { + name: "web_company_id", + type: [ + "int32", + "null" + ] + }, + { + name: "web_company_name", + type: [ + "string", + "null" + ] + }, + { + name: "web_street_number", + type: [ + "string", + "null" + ] + }, + { + name: "web_street_name", + type: [ + "string", + "null" + ] + }, + { + name: "web_street_type", + type: [ + "string", + "null" + ] + }, + { + name: "web_suite_number", + type: [ + "string", + "null" + ] + }, + { + name: "web_city", + type: [ + "string", + "null" + ] + }, + { + name: "web_county", + type: [ + "string", + "null" + ] + }, + { + name: "web_state", + type: [ + "string", + "null" + ] + }, + { + name: "web_zip", + type: [ + "string", + "null" + ] + }, + { + name: "web_country", + type: [ + "string", + "null" + ] + }, + { + name: "web_gmt_offset", + type: [ + "float64", + "null" + ] + }, + { + name: "web_tax_percentage", + type: [ + "float64", + "null" + ] + } + ] + } }