From 4bfda66654b00ddabdba6bb03306989ee707b55f Mon Sep 17 00:00:00 2001 From: "R. C. Howell" Date: Mon, 29 Jul 2024 10:53:50 -0700 Subject: [PATCH] Internalizes functions to the planner as an intermediate split step --- .../org/partiql/eval/internal/Compiler.kt | 6 +- .../org/partiql/eval/internal/Symbols.kt | 21 ++--- .../eval/internal/operator/Operator.kt | 6 +- .../internal/operator/rel/RelAggregate.kt | 7 +- .../internal/operator/rex/ExprCallDynamic.kt | 5 +- .../internal/operator/rex/ExprCallStatic.kt | 5 +- .../eval/internal/PartiQLEngineDefaultTest.kt | 4 +- .../operator/rex/ExprCallDynamicTest.kt | 9 +- partiql-planner/api/partiql-planner.api | 84 +++++++++++++++++++ partiql-planner/build.gradle.kts | 1 - .../org/partiql/planner/internal/Env.kt | 49 ++++++----- .../partiql/planner/internal/FnResolver.kt | 2 +- .../planner/internal/fn/SqlFnProvider.kt | 25 +++--- .../planner/internal/fn/builtins/FnAbs.kt | 1 - .../planner/internal/fn/builtins/FnAnd.kt | 1 - .../planner/internal/fn/builtins/FnBetween.kt | 1 - .../internal/fn/builtins/FnBitLength.kt | 1 - .../internal/fn/builtins/FnBitwiseAnd.kt | 1 - .../internal/fn/builtins/FnCardinality.kt | 1 - .../internal/fn/builtins/FnCharLength.kt | 1 - .../planner/internal/fn/builtins/FnCollAgg.kt | 3 + .../planner/internal/fn/builtins/FnConcat.kt | 1 - .../internal/fn/builtins/FnCurrentDate.kt | 1 - .../internal/fn/builtins/FnCurrentUser.kt | 1 - .../internal/fn/builtins/FnDateAddDay.kt | 1 - .../internal/fn/builtins/FnDateAddHour.kt | 1 - .../internal/fn/builtins/FnDateAddMinute.kt | 1 - .../internal/fn/builtins/FnDateAddMonth.kt | 1 - .../internal/fn/builtins/FnDateAddSecond.kt | 1 - .../internal/fn/builtins/FnDateAddYear.kt | 1 - .../internal/fn/builtins/FnDateDiffDay.kt | 1 - .../internal/fn/builtins/FnDateDiffHour.kt | 1 - .../internal/fn/builtins/FnDateDiffMinute.kt | 1 - .../internal/fn/builtins/FnDateDiffMonth.kt | 1 - .../internal/fn/builtins/FnDateDiffSecond.kt | 1 - .../internal/fn/builtins/FnDateDiffYear.kt | 1 - .../planner/internal/fn/builtins/FnDivide.kt | 1 - .../planner/internal/fn/builtins/FnEq.kt | 1 - .../planner/internal/fn/builtins/FnExtract.kt | 1 - .../planner/internal/fn/builtins/FnGt.kt | 1 - .../planner/internal/fn/builtins/FnGte.kt | 1 - .../internal/fn/builtins/FnInCollection.kt | 1 - .../planner/internal/fn/builtins/FnIsAny.kt | 1 - .../planner/internal/fn/builtins/FnIsBag.kt | 1 - .../internal/fn/builtins/FnIsBinary.kt | 1 - .../planner/internal/fn/builtins/FnIsBlob.kt | 1 - .../planner/internal/fn/builtins/FnIsBool.kt | 1 - .../planner/internal/fn/builtins/FnIsByte.kt | 1 - .../planner/internal/fn/builtins/FnIsChar.kt | 1 - .../planner/internal/fn/builtins/FnIsClob.kt | 1 - .../planner/internal/fn/builtins/FnIsDate.kt | 1 - .../internal/fn/builtins/FnIsDecimal.kt | 1 - .../fn/builtins/FnIsDecimalArbitrary.kt | 1 - .../internal/fn/builtins/FnIsFloat32.kt | 1 - .../internal/fn/builtins/FnIsFloat64.kt | 1 - .../planner/internal/fn/builtins/FnIsInt.kt | 1 - .../planner/internal/fn/builtins/FnIsInt16.kt | 1 - .../planner/internal/fn/builtins/FnIsInt32.kt | 1 - .../planner/internal/fn/builtins/FnIsInt64.kt | 1 - .../planner/internal/fn/builtins/FnIsInt8.kt | 1 - .../internal/fn/builtins/FnIsInterval.kt | 1 - .../planner/internal/fn/builtins/FnIsList.kt | 1 - .../internal/fn/builtins/FnIsMissing.kt | 1 - .../planner/internal/fn/builtins/FnIsNull.kt | 1 - .../planner/internal/fn/builtins/FnIsSexp.kt | 1 - .../internal/fn/builtins/FnIsString.kt | 1 - .../internal/fn/builtins/FnIsStruct.kt | 1 - .../internal/fn/builtins/FnIsSymbol.kt | 1 - .../planner/internal/fn/builtins/FnIsTime.kt | 1 - .../internal/fn/builtins/FnIsTimestamp.kt | 1 - .../planner/internal/fn/builtins/FnLower.kt | 1 - .../planner/internal/fn/builtins/FnLt.kt | 1 - .../planner/internal/fn/builtins/FnLte.kt | 1 - .../planner/internal/fn/builtins/FnMinus.kt | 1 - .../planner/internal/fn/builtins/FnModulo.kt | 1 - .../planner/internal/fn/builtins/FnNeg.kt | 1 - .../planner/internal/fn/builtins/FnNot.kt | 1 - .../internal/fn/builtins/FnOctetLength.kt | 1 - .../planner/internal/fn/builtins/FnOr.kt | 1 - .../planner/internal/fn/builtins/FnPlus.kt | 1 - .../planner/internal/fn/builtins/FnPos.kt | 1 - .../planner/internal/fn/builtins/FnTimes.kt | 1 - .../planner/internal/fn/builtins/FnUpper.kt | 1 - .../planner/internal/fn/builtins/FnUtcnow.kt | 1 - .../fn/builtins/internal/Accumulator.kt | 1 - .../org/partiql/planner/internal/ir/Nodes.kt | 70 ++++++++++------ .../planner/internal/transforms/Symbols.kt | 3 - .../planner/internal/typer/PlanTyper.kt | 8 +- .../main/resources/partiql_plan_internal.ion | 4 +- .../kotlin/org/partiql/planner/PlanTest.kt | 2 +- .../planner/PlannerErrorReportingTests.kt | 2 +- .../internal/exclude/SubsumptionTest.kt | 3 +- .../planner/internal/typer/FnResolverTest.kt | 7 +- .../internal/typer/PartiQLTyperTestBase.kt | 2 +- .../internal/typer/PlanTyperTestsPorted.kt | 2 +- .../planner/internal/typer/ScopeTest.kt | 11 --- .../partiql/runner/executor/EvalExecutor.kt | 4 +- 97 files changed, 214 insertions(+), 202 deletions(-) diff --git a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Compiler.kt b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Compiler.kt index 6accc02d31..34bb74a0c7 100644 --- a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Compiler.kt +++ b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Compiler.kt @@ -56,8 +56,7 @@ 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 +import org.partiql.planner.internal.fn.Agg import org.partiql.types.PType import org.partiql.value.PartiQLValueExperimental import java.lang.IllegalStateException @@ -179,7 +178,6 @@ internal class Compiler( return RelAggregate(input, groups, calls) } - override fun visitRelOpAggregateCall(node: Rel.Op.Aggregate.Call, ctx: PType?): Operator.Aggregation { val args = node.args.map { visitRex(it, it.type).modeHandled() } val setQuantifier: Operator.Aggregation.SetQuantifier = when (node.setQuantifier) { @@ -212,7 +210,6 @@ internal class Compiler( return ExprPathIndex(root, index) } - override fun visitRexOpCallStatic(node: Rex.Op.Call.Static, ctx: PType?): Operator { val fn = symbols.getFn(node.fn) val args = node.args.map { visitRex(it, ctx) }.toTypedArray() @@ -225,7 +222,6 @@ internal class Compiler( } } - override fun visitRexOpCallDynamic(node: Rex.Op.Call.Dynamic, ctx: PType?): Operator { val args = node.args.map { visitRex(it, ctx).modeHandled() }.toTypedArray() // Check candidate list size diff --git a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Symbols.kt b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Symbols.kt index 5987b5bb88..d45b13d726 100644 --- a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Symbols.kt +++ b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/Symbols.kt @@ -1,4 +1,3 @@ -@file:OptIn(FnExperimental::class) package org.partiql.eval.internal @@ -7,13 +6,11 @@ import org.partiql.eval.internal.operator.rex.ExprVarGlobal import org.partiql.plan.Catalog import org.partiql.plan.PartiQLPlan import org.partiql.plan.Ref -import org.partiql.spi.connector.ConnectorAggProvider +import org.partiql.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.SqlFnProvider import org.partiql.spi.connector.ConnectorBindings -import org.partiql.spi.connector.ConnectorFnProvider import org.partiql.spi.connector.ConnectorPath -import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental /** * @@ -26,11 +23,13 @@ internal class Symbols private constructor(private val catalogs: Array) { private class C( val name: String, val bindings: ConnectorBindings, - val functions: ConnectorFnProvider, - val aggregations: ConnectorAggProvider, val items: Array, ) { + // TEMPORARY FOR DEPENDENCY REASONS + fun getFn(path: ConnectorPath, specific: String): Fn? = SqlFnProvider.getFn(specific) + fun getAgg(path: ConnectorPath, specific: String): Agg? = SqlFnProvider.getAgg(specific) + override fun toString(): String = name } @@ -52,7 +51,7 @@ internal class Symbols private constructor(private val catalogs: Array) { } // Lookup in connector val path = ConnectorPath(item.path) - return catalog.functions.getFn(path, item.specific) + return catalog.getFn(path, item.specific) ?: error("Catalog `$catalog` has no entry for function $item") } @@ -64,7 +63,7 @@ internal class Symbols private constructor(private val catalogs: Array) { } // Lookup in connector val path = ConnectorPath(item.path) - return catalog.aggregations.getAgg(path, item.specific) + return catalog.getAgg(path, item.specific) ?: error("Catalog `$catalog` has no entry for aggregation function $item") } @@ -85,8 +84,6 @@ internal class Symbols private constructor(private val catalogs: Array) { C( name = it.name, bindings = connector.getBindings(), - functions = connector.getFunctions(), - aggregations = connector.getAggregations(), items = it.items.toTypedArray() ) }.toTypedArray() diff --git a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/Operator.kt b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/Operator.kt index 216e0fc398..0590dcea1b 100644 --- a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/Operator.kt +++ b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/Operator.kt @@ -3,9 +3,7 @@ package org.partiql.eval.internal.operator import org.partiql.eval.internal.Environment import org.partiql.eval.internal.Record import org.partiql.eval.value.Datum -import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.FnExperimental -import org.partiql.value.PartiQLValueExperimental +import org.partiql.planner.internal.fn.Agg internal sealed interface Operator { @@ -14,7 +12,6 @@ internal sealed interface Operator { */ interface Expr : Operator { - @OptIn(PartiQLValueExperimental::class) fun eval(env: Environment): Datum } @@ -30,7 +27,6 @@ internal sealed interface Operator { interface Aggregation : Operator { - val delegate: Agg val args: List diff --git a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rel/RelAggregate.kt b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rel/RelAggregate.kt index ddbe96d0ed..cf1cd99c57 100644 --- a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rel/RelAggregate.kt +++ b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rel/RelAggregate.kt @@ -4,8 +4,7 @@ import org.partiql.eval.internal.Environment import org.partiql.eval.internal.Record import org.partiql.eval.internal.operator.Operator import org.partiql.eval.value.Datum -import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.FnExperimental +import org.partiql.planner.internal.fn.Agg import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType @@ -51,13 +50,13 @@ internal class RelAggregate( * * @property seen maintains which values have already been seen. If null, we accumulate all values coming through. */ - class AccumulatorWrapper @OptIn(PartiQLValueExperimental::class, FnExperimental::class) constructor( + class AccumulatorWrapper @OptIn(PartiQLValueExperimental::class) constructor( val delegate: Agg.Accumulator, val args: List, val seen: TreeSet>? ) - @OptIn(PartiQLValueExperimental::class, FnExperimental::class) + @OptIn(PartiQLValueExperimental::class) override fun open(env: Environment) { input.open(env) for (inputRecord in input) { diff --git a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprCallDynamic.kt b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprCallDynamic.kt index f95a73073e..53f0f185fd 100644 --- a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprCallDynamic.kt +++ b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprCallDynamic.kt @@ -5,8 +5,7 @@ import org.partiql.eval.internal.Environment import org.partiql.eval.internal.operator.Operator import org.partiql.eval.value.Datum import org.partiql.plan.Ref -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental +import org.partiql.planner.internal.fn.Fn import org.partiql.types.PType import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -20,7 +19,7 @@ import org.partiql.value.PartiQLValueType * [ExprCallStatic]'s. By doing this, this implementation can evaluate ([eval]) the input [Record], execute and gather the * arguments, and pass the [PartiQLValue]s directly to the [Candidate.eval]. */ -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal class ExprCallDynamic( private val name: String, private val candidates: Array, diff --git a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprCallStatic.kt b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprCallStatic.kt index cdf30858cd..c4cc765910 100644 --- a/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprCallStatic.kt +++ b/partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprCallStatic.kt @@ -3,11 +3,10 @@ package org.partiql.eval.internal.operator.rex import org.partiql.eval.internal.Environment import org.partiql.eval.internal.operator.Operator import org.partiql.eval.value.Datum -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental +import org.partiql.planner.internal.fn.Fn import org.partiql.value.PartiQLValueExperimental -@OptIn(FnExperimental::class, PartiQLValueExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal class ExprCallStatic( private val fn: Fn, private val inputs: Array, diff --git a/partiql-eval/src/test/kotlin/org/partiql/eval/internal/PartiQLEngineDefaultTest.kt b/partiql-eval/src/test/kotlin/org/partiql/eval/internal/PartiQLEngineDefaultTest.kt index f0ff058ecd..957b38d840 100644 --- a/partiql-eval/src/test/kotlin/org/partiql/eval/internal/PartiQLEngineDefaultTest.kt +++ b/partiql-eval/src/test/kotlin/org/partiql/eval/internal/PartiQLEngineDefaultTest.kt @@ -1258,7 +1258,7 @@ class PartiQLEngineDefaultTest { internal fun assert() { val statement = parser.parse(input).root - val catalogBuilder = MemoryCatalog.PartiQL().name("memory") + val catalogBuilder = MemoryCatalog.builder().name("memory") globals.forEach { global -> catalogBuilder.define(global.name, global.type, loader.loadSingleElement(global.value)) } @@ -1344,7 +1344,7 @@ class PartiQLEngineDefaultTest { private fun run(mode: PartiQLEngine.Mode): Pair { val statement = parser.parse(input).root - val catalog = MemoryCatalog.PartiQL().name("memory").build() + val catalog = MemoryCatalog.builder().name("memory").build() val connector = MemoryConnector(catalog) val connectorSession = object : ConnectorSession { override fun getQueryId(): String = "q" diff --git a/partiql-eval/src/test/kotlin/org/partiql/eval/internal/operator/rex/ExprCallDynamicTest.kt b/partiql-eval/src/test/kotlin/org/partiql/eval/internal/operator/rex/ExprCallDynamicTest.kt index 8fe82ab9fa..80e7836e9b 100644 --- a/partiql-eval/src/test/kotlin/org/partiql/eval/internal/operator/rex/ExprCallDynamicTest.kt +++ b/partiql-eval/src/test/kotlin/org/partiql/eval/internal/operator/rex/ExprCallDynamicTest.kt @@ -13,10 +13,9 @@ import org.partiql.eval.value.Datum.boolValue import org.partiql.eval.value.Datum.int32Value import org.partiql.eval.value.Datum.listValue import org.partiql.eval.value.Datum.stringValue -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.FnParameter -import org.partiql.spi.fn.FnSignature +import org.partiql.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType @@ -64,7 +63,7 @@ class ExprCallDynamicTest { PartiQLValueType.ANY to PartiQLValueType.ANY, // Index 12 ) - @OptIn(FnExperimental::class, PartiQLValueExperimental::class) + @OptIn(PartiQLValueExperimental::class) internal val candidates = params.mapIndexed { index, it -> ExprCallDynamic.Candidate( fn = object : Fn { diff --git a/partiql-planner/api/partiql-planner.api b/partiql-planner/api/partiql-planner.api index 461c06d269..0b46df75de 100644 --- a/partiql-planner/api/partiql-planner.api +++ b/partiql-planner/api/partiql-planner.api @@ -321,3 +321,87 @@ public final class org/partiql/planner/catalog/Table$Handle { public fun (Lorg/partiql/planner/catalog/Name;Lorg/partiql/planner/catalog/Table;)V } +public abstract interface class org/partiql/planner/internal/fn/Agg { + public abstract fun accumulator ()Lorg/partiql/planner/internal/fn/Agg$Accumulator; + public abstract fun getSignature ()Lorg/partiql/planner/internal/fn/AggSignature; +} + +public abstract interface class org/partiql/planner/internal/fn/Agg$Accumulator { + public abstract fun next ([Lorg/partiql/value/PartiQLValue;)V + public abstract fun value ()Lorg/partiql/value/PartiQLValue; +} + +public final class org/partiql/planner/internal/fn/AggSignature { + public final field description Ljava/lang/String; + public final field isDecomposable Z + public final field isNullable Z + public final field name Ljava/lang/String; + public final field parameters Ljava/util/List; + public final field returns Lorg/partiql/types/PType; + public fun (Ljava/lang/String;Lorg/partiql/types/PType;Ljava/util/List;Ljava/lang/String;ZZ)V + public synthetic fun (Ljava/lang/String;Lorg/partiql/types/PType;Ljava/util/List;Ljava/lang/String;ZZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ljava/lang/String;Lorg/partiql/value/PartiQLValueType;Ljava/util/List;Ljava/lang/String;ZZ)V + public synthetic fun (Ljava/lang/String;Lorg/partiql/value/PartiQLValueType;Ljava/util/List;Ljava/lang/String;ZZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun equals (Ljava/lang/Object;)Z + public final fun getSpecific ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public abstract interface class org/partiql/planner/internal/fn/Fn { + public abstract fun getSignature ()Lorg/partiql/planner/internal/fn/FnSignature; + public abstract fun invoke ([Lorg/partiql/value/PartiQLValue;)Lorg/partiql/value/PartiQLValue; +} + +public final class org/partiql/planner/internal/fn/FnParameter { + public fun (Ljava/lang/String;Lorg/partiql/types/PType;)V + public fun (Ljava/lang/String;Lorg/partiql/value/PartiQLValueType;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Lorg/partiql/types/PType; + public final fun copy (Ljava/lang/String;Lorg/partiql/types/PType;)Lorg/partiql/planner/internal/fn/FnParameter; + public static synthetic fun copy$default (Lorg/partiql/planner/internal/fn/FnParameter;Ljava/lang/String;Lorg/partiql/types/PType;ILjava/lang/Object;)Lorg/partiql/planner/internal/fn/FnParameter; + public fun equals (Ljava/lang/Object;)Z + public final fun getName ()Ljava/lang/String; + public final fun getType ()Lorg/partiql/types/PType; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class org/partiql/planner/internal/fn/FnSignature { + public final field description Ljava/lang/String; + public final field isDeterministic Z + public final field isMissable Z + public final field isMissingCall Z + public final field isNullCall Z + public final field isNullable Z + public final field name Ljava/lang/String; + public final field parameters Ljava/util/List; + public final field returns Lorg/partiql/types/PType; + public fun (Ljava/lang/String;Lorg/partiql/types/PType;Ljava/util/List;Ljava/lang/String;ZZZZZ)V + public synthetic fun (Ljava/lang/String;Lorg/partiql/types/PType;Ljava/util/List;Ljava/lang/String;ZZZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ljava/lang/String;Lorg/partiql/value/PartiQLValueType;Ljava/util/List;Ljava/lang/String;ZZZZZ)V + public synthetic fun (Ljava/lang/String;Lorg/partiql/value/PartiQLValueType;Ljava/util/List;Ljava/lang/String;ZZZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Lorg/partiql/types/PType; + public final fun component3 ()Ljava/util/List; + public final fun component4 ()Ljava/lang/String; + public final fun component5 ()Z + public final fun component6 ()Z + public final fun component7 ()Z + public final fun component8 ()Z + public final fun component9 ()Z + public final fun copy (Ljava/lang/String;Lorg/partiql/types/PType;Ljava/util/List;Ljava/lang/String;ZZZZZ)Lorg/partiql/planner/internal/fn/FnSignature; + public static synthetic fun copy$default (Lorg/partiql/planner/internal/fn/FnSignature;Ljava/lang/String;Lorg/partiql/types/PType;Ljava/util/List;Ljava/lang/String;ZZZZZILjava/lang/Object;)Lorg/partiql/planner/internal/fn/FnSignature; + public fun equals (Ljava/lang/Object;)Z + public final fun getSpecific ()Ljava/lang/String; + public fun hashCode ()I + public final fun sql ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; +} + +public final class org/partiql/planner/internal/fn/SqlFnProvider { + public static final field INSTANCE Lorg/partiql/planner/internal/fn/SqlFnProvider; + public final fun getAgg (Ljava/lang/String;)Lorg/partiql/planner/internal/fn/Agg; + public final fun getFn (Ljava/lang/String;)Lorg/partiql/planner/internal/fn/Fn; +} + diff --git a/partiql-planner/build.gradle.kts b/partiql-planner/build.gradle.kts index 11c7dc9c9a..9e396a563a 100644 --- a/partiql-planner/build.gradle.kts +++ b/partiql-planner/build.gradle.kts @@ -105,7 +105,6 @@ tasks.register("codegen") { "--poems", "builder", "--poems", "util", "--opt-in", "org.partiql.value.PartiQLValueExperimental", - "--opt-in", "org.partiql.spi.fn.FnExperimental", "./src/main/resources/partiql_plan_internal.ion" ) } diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/Env.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/Env.kt index 3a54ee6993..48a9597010 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/Env.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/Env.kt @@ -5,6 +5,7 @@ import org.partiql.planner.catalog.Session import org.partiql.planner.internal.casts.CastTable import org.partiql.planner.internal.casts.Coercions import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.SqlFnProvider import org.partiql.planner.internal.ir.Ref import org.partiql.planner.internal.ir.Rel import org.partiql.planner.internal.ir.Rex @@ -19,12 +20,8 @@ import org.partiql.planner.internal.ir.rexOpCastResolved import org.partiql.planner.internal.ir.rexOpVarGlobal import org.partiql.planner.internal.typer.CompilerType import org.partiql.planner.internal.typer.Scope.Companion.toPath -import org.partiql.spi.BindingCase -import org.partiql.spi.BindingName import org.partiql.spi.BindingPath import org.partiql.spi.connector.ConnectorMetadata -import org.partiql.planner.internal.fn.AggSignature -import org.partiql.planner.internal.fn.FnExperimental import org.partiql.types.PType import org.partiql.types.PType.Kind @@ -53,6 +50,11 @@ internal class Env(private val session: Session) { */ private val objects: PathResolverObj = PathResolverObj(catalog, catalogs, session) + /** + * A [SqlFnProvider] for looking up built-in functions. + */ + private val fns: SqlFnProvider = SqlFnProvider + /** * This function looks up a global [BindingPath], returning a global reference expression. * @@ -75,19 +77,24 @@ internal class Env(private val session: Session) { val tail = path.steps.drop(depth) return if (tail.isEmpty()) root else root.toPath(tail) } - + fun resolveFn(path: BindingPath, args: List): Rex? { - val item = fns.lookup(path) ?: return null - // Invoke FnResolver to determine if we made a match - val variants = item.handle.entity.getVariants() + // Assume all functions are defined in the current catalog and reject qualified routine names. + if (path.steps.size > 1) { + error("Qualified functions are not supported.") + } + val catalog = session.getCatalog() + val name = path.steps.last().name.lowercase() + // Invoke existing function resolution logic + val variants = fns.lookupFn(name) ?: return null val match = FnResolver.resolve(variants, args.map { it.type }) // If Type mismatch, then we return a missingOp whose trace is all possible candidates. if (match == null) { val candidates = variants.map { fnSignature -> rexOpCallDynamicCandidate( fn = refFn( - item.catalog, - name = Name.of(item.handle.path.steps), + catalog = catalog, + name = Name.of(name), signature = fnSignature ), coercions = emptyList() @@ -104,8 +111,8 @@ internal class Env(private val session: Session) { // Create an internal typed reference for every candidate rexOpCallDynamicCandidate( fn = refFn( - catalog = item.catalog, - name = Name.of(item.handle.path.steps), + catalog = catalog, + name = Name.of(name), signature = it.signature, ), coercions = it.mapping.toList(), @@ -117,8 +124,8 @@ internal class Env(private val session: Session) { is FnMatch.Static -> { // Create an internal typed reference val ref = refFn( - catalog = item.catalog, - name = Name.of(item.handle.path.steps), + catalog = catalog, + name = Name.of(name), signature = match.signature, ) // Apply the coercions as explicit casts @@ -134,17 +141,18 @@ internal class Env(private val session: Session) { } } - fun resolveAgg(name: String, setQuantifier: Rel.Op.Aggregate.SetQuantifier, args: List): Rel.Op.Aggregate.Call.Resolved? { + fun resolveAgg(path: String, setQuantifier: Rel.Op.Aggregate.SetQuantifier, args: List): Rel.Op.Aggregate.Call.Resolved? { // TODO: Eventually, do we want to support sensitive lookup? With a path? - val path = BindingPath(listOf(BindingName(name, BindingCase.INSENSITIVE))) - val item = aggs.lookup(path) ?: return null - val candidates = item.handle.entity.getVariants() + val catalog = session.getCatalog() + val name = path.lowercase() + // Invoke existing function resolution logic + val candidates = fns.lookupAgg(name) ?: return null val parameters = args.mapIndexed { i, arg -> arg.type } val match = match(candidates, parameters) ?: return null val agg = match.first val mapping = match.second // Create an internal typed reference - val ref = refAgg(item.catalog, Name.of(item.handle.path.steps), agg) + val ref = refAgg(catalog, Name.of(name), agg) // Apply the coercions as explicit casts val coercions: List = args.mapIndexed { i, arg -> when (val cast = mapping[i]) { @@ -206,7 +214,6 @@ internal class Env(private val session: Session) { return userInputPath.steps.size + actualAbsolutePath.size - pathSentToConnector.steps.size } - private fun match(candidates: List, args: List): Pair>? { // 1. Check for an exact match for (candidate in candidates) { @@ -232,7 +239,7 @@ internal class Env(private val session: Session) { /** * Check if this function accepts the exact input argument types. Assume same arity. */ - + private fun AggSignature.matches(args: List): Boolean { for (i in args.indices) { val a = args[i] diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnResolver.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnResolver.kt index c1ba79edc5..a7c6c2f9bd 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnResolver.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnResolver.kt @@ -1,10 +1,10 @@ package org.partiql.planner.internal import org.partiql.planner.internal.casts.Coercions +import org.partiql.planner.internal.fn.FnSignature import org.partiql.planner.internal.ir.Ref import org.partiql.planner.internal.typer.CompilerType import org.partiql.planner.internal.typer.PlanTyper.Companion.toCType -import org.partiql.planner.internal.fn.FnSignature import org.partiql.types.PType.Kind /** diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlFnProvider.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlFnProvider.kt index 2f6f5bab9a..7b52b6b6eb 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlFnProvider.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlFnProvider.kt @@ -19,15 +19,20 @@ package org.partiql.planner.internal.fn */ public object SqlFnProvider { - // planner and evaluator lookup - private val fnNameIndex: Map = SqlBuiltins.builtins.associateBy { it.signature.name } - private val fnSpecIndex: Map = SqlBuiltins.builtins.associateBy { it.signature.specific } - public fun getFnByName(name: String): Fn? = fnNameIndex[name] - public fun getFnBySpecific(specific: String): Fn? = fnSpecIndex[specific] + private val fnNameIndex = SqlBuiltins.builtins.groupBy({ it.signature.name }, { it.signature }) + private val fnSpecIndex = SqlBuiltins.builtins.associateBy { it.signature.specific } + private val aggNameIndex = SqlBuiltins.aggregations.groupBy({ it.signature.name }, { it.signature }) + private val aggSpecIndex = SqlBuiltins.aggregations.associateBy { it.signature.specific } - // planner and evaluator lookup - private val aggNameIndex: Map = SqlBuiltins.aggregations.associateBy { it.signature.name } - private val aggSpecIndex: Map = SqlBuiltins.aggregations.associateBy { it.signature.specific } - public fun getAggByName(name: String): Agg? = aggNameIndex[name] - public fun getAggBySpecific(specific: String): Agg? = aggSpecIndex[specific] + // + // INTERNAL PLANNER APIS + // + internal fun lookupFn(name: String) = fnNameIndex[name] + internal fun lookupAgg(name: String) = aggNameIndex[name] + + // + // TEMPORARY PUBLIC EVALUATOR APIS + // + public fun getFn(specific: String): Fn? = fnSpecIndex[specific] + public fun getAgg(specific: String): Agg? = aggSpecIndex[specific] } diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAbs.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAbs.kt index c85d15b69a..396ede6717 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAbs.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAbs.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAnd.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAnd.kt index 40f15afb94..4aca28cdeb 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAnd.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAnd.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBetween.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBetween.kt index b65f5e1d7b..2dc81fefd8 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBetween.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBetween.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitLength.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitLength.kt index 856ee9cb1f..8afb7269d9 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitLength.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitLength.kt @@ -1,7 +1,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitwiseAnd.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitwiseAnd.kt index 235f999f44..0864060e3c 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitwiseAnd.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitwiseAnd.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCardinality.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCardinality.kt index 62934af09e..1abe347040 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCardinality.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCardinality.kt @@ -1,7 +1,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BagValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCharLength.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCharLength.kt index 04fa1e2550..1d93cbbcb5 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCharLength.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCharLength.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCollAgg.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCollAgg.kt index 391402b80d..2fe58fb6cd 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCollAgg.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCollAgg.kt @@ -1,5 +1,6 @@ // ktlint-disable filename @file:Suppress("ClassName") +@file:OptIn(PartiQLValueExperimental::class) package org.partiql.planner.internal.fn.builtins @@ -17,6 +18,7 @@ import org.partiql.planner.internal.fn.builtins.internal.AccumulatorMin import org.partiql.planner.internal.fn.builtins.internal.AccumulatorSum import org.partiql.value.BagValue import org.partiql.value.PartiQLValue +import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType import org.partiql.value.check @@ -24,6 +26,7 @@ internal abstract class Fn_COLL_AGG__BAG__ANY : Fn { abstract fun getAccumulator(): Agg.Accumulator + @OptIn(PartiQLValueExperimental::class) companion object { @JvmStatic internal fun createSignature(name: String) = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnConcat.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnConcat.kt index 91421ec3a9..f3a6105880 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnConcat.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnConcat.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentDate.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentDate.kt index 8a96d53731..fc16aff0ea 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentDate.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentDate.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentUser.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentUser.kt index 0b6d269d8e..734cb11d3a 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentUser.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentUser.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddDay.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddDay.kt index 9db3cb5c3c..04d88cfd71 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddDay.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddDay.kt @@ -6,7 +6,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DateValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddHour.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddHour.kt index 89f5d3a765..220f25e3ec 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddHour.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddHour.kt @@ -6,7 +6,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int32Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMinute.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMinute.kt index ef97829121..ce6e54d0ba 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMinute.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMinute.kt @@ -6,7 +6,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int32Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMonth.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMonth.kt index 580267eda1..fd4777926c 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMonth.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMonth.kt @@ -6,7 +6,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DateValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddSecond.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddSecond.kt index 318f12efdb..e721000456 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddSecond.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddSecond.kt @@ -6,7 +6,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int32Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddYear.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddYear.kt index 1dc8602523..65fd3b0c7c 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddYear.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddYear.kt @@ -6,7 +6,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DateValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffDay.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffDay.kt index 77a026730b..a5bb15078a 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffDay.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffDay.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffHour.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffHour.kt index 90ef086feb..b0d495a3c2 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffHour.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffHour.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMinute.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMinute.kt index f18fd67a99..05af59afbd 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMinute.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMinute.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMonth.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMonth.kt index e9704c516d..35abc47e18 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMonth.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMonth.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffSecond.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffSecond.kt index 194c848c7a..5427480436 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffSecond.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffSecond.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffYear.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffYear.kt index 75c07249a7..e6490ac965 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffYear.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffYear.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDivide.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDivide.kt index 9ebbcdcb5b..e1dc7ab362 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDivide.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDivide.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnEq.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnEq.kt index 468ba01a44..39bb2d5cdc 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnEq.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnEq.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnExtract.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnExtract.kt index 5060d6ee95..c2fe3e5a40 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnExtract.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnExtract.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DateValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGt.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGt.kt index 76c9b9f233..396ac73579 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGt.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGt.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGte.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGte.kt index 57d1bac674..a61a85023b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGte.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGte.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnInCollection.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnInCollection.kt index 0cf8d14089..d750b45336 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnInCollection.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnInCollection.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BagValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsAny.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsAny.kt index 9d3d3e89b5..18544137c5 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsAny.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsAny.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBag.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBag.kt index 60db2f5e6f..9ee2ae399e 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBag.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBag.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BagValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBinary.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBinary.kt index e18c662121..ed9d0f81d7 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBinary.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBinary.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BinaryValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBlob.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBlob.kt index d20c9459db..ca46f50317 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBlob.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBlob.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BlobValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBool.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBool.kt index fafee6415c..b8cab9f458 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBool.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBool.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsByte.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsByte.kt index ef5ea5a880..19f435a4fb 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsByte.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsByte.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ByteValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsChar.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsChar.kt index affb7e60b2..a6cf30831c 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsChar.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsChar.kt @@ -5,7 +5,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.errors.TypeCheckException import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.CharValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsClob.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsClob.kt index 43862e32d6..6ea8a90bf8 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsClob.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsClob.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDate.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDate.kt index 9fb3b7fd30..f19a929ae5 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDate.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDate.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DateValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimal.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimal.kt index ee99a1fed5..8a7db8569d 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimal.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimal.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimalArbitrary.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimalArbitrary.kt index 5fddb2f16e..818c428d45 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimalArbitrary.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimalArbitrary.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat32.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat32.kt index 7b902ebaa6..38b838bab8 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat32.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat32.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Float32Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat64.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat64.kt index a75562bb02..e7d5bfcd89 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat64.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat64.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Float32Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt.kt index f38c610b90..c5482f9db3 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt16.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt16.kt index 0e9e5b6ddf..7ade6512e0 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt16.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt16.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt32.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt32.kt index b2c50b67db..dd8259847e 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt32.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt32.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt64.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt64.kt index 37291ca156..5f035f3392 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt64.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt64.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt8.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt8.kt index b6aef74d61..09ac7f4d8f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt8.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt8.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInterval.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInterval.kt index bdfa373102..d6953454f0 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInterval.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInterval.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.IntervalValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsList.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsList.kt index 1a8f891f1d..d21c8b1f13 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsList.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsList.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ListValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsMissing.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsMissing.kt index 6a08bfc77c..61aa437f94 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsMissing.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsMissing.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.MissingValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsNull.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsNull.kt index 841098ad3a..d2d70cbc55 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsNull.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsNull.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSexp.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSexp.kt index c4630d1ab0..fc8c74f4bd 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSexp.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSexp.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsString.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsString.kt index 0e052e9678..b87f22ed8e 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsString.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsString.kt @@ -5,7 +5,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.errors.TypeCheckException import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int32Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsStruct.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsStruct.kt index 466ba9551b..5d05914740 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsStruct.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsStruct.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSymbol.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSymbol.kt index 30d38df3ab..f6304dbaf7 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSymbol.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSymbol.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTime.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTime.kt index bc5c5c97e3..7f7283347f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTime.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTime.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTimestamp.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTimestamp.kt index c97a7b5bfe..49ffbc5f1c 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTimestamp.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTimestamp.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLower.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLower.kt index 076b0ea746..3686befa52 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLower.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLower.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLt.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLt.kt index c7f5a580b4..d2337a8784 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLt.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLt.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLte.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLte.kt index 83a1705b45..51be999572 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLte.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLte.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnMinus.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnMinus.kt index ff3f597e1d..548aa190b9 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnMinus.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnMinus.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnModulo.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnModulo.kt index 2bc4bffdc8..c4866f8560 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnModulo.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnModulo.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNeg.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNeg.kt index 3032b9b289..52e0023343 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNeg.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNeg.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNot.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNot.kt index 59c93591e4..82c35cd417 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNot.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNot.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOctetLength.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOctetLength.kt index 95380c113a..aef6315e11 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOctetLength.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOctetLength.kt @@ -1,7 +1,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOr.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOr.kt index b654fcfce2..88e6367a59 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOr.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOr.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPlus.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPlus.kt index 2d0fe4fbb0..762a1ed47d 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPlus.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPlus.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPos.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPos.kt index 4cce38a92b..22991c9c6d 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPos.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPos.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTimes.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTimes.kt index 5e62782195..fe1442222c 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTimes.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTimes.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUpper.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUpper.kt index 7fc30a4bd8..3407002de8 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUpper.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUpper.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnParameter import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUtcnow.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUtcnow.kt index c42c563ae0..431b0fe6c1 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUtcnow.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUtcnow.kt @@ -4,7 +4,6 @@ package org.partiql.planner.internal.fn.builtins import org.partiql.planner.internal.fn.Fn - import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/Accumulator.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/Accumulator.kt index 5fbd9b008f..bda1944574 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/Accumulator.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/Accumulator.kt @@ -19,7 +19,6 @@ package org.partiql.planner.internal.fn.builtins.internal import com.amazon.ion.Decimal import org.partiql.errors.TypeCheckException import org.partiql.planner.internal.fn.Agg - import org.partiql.value.BoolValue import org.partiql.value.DecimalValue import org.partiql.value.Float32Value diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/ir/Nodes.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/ir/Nodes.kt index 39dcd508c5..a806dc1ac0 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/ir/Nodes.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/ir/Nodes.kt @@ -1,13 +1,12 @@ -@file:OptIn( - PartiQLValueExperimental::class, - FnExperimental::class, -) +@file:OptIn(PartiQLValueExperimental::class) package org.partiql.planner.`internal`.ir import org.partiql.errors.Problem import org.partiql.planner.catalog.Identifier import org.partiql.planner.catalog.Name +import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnSignature import org.partiql.planner.internal.ir.builder.PartiQlPlanBuilder import org.partiql.planner.internal.ir.builder.RefAggBuilder import org.partiql.planner.internal.ir.builder.RefCastBuilder @@ -72,9 +71,6 @@ import org.partiql.planner.internal.ir.builder.RexOpVarUnresolvedBuilder import org.partiql.planner.internal.ir.builder.StatementQueryBuilder import org.partiql.planner.internal.ir.visitor.PlanVisitor import org.partiql.planner.internal.typer.CompilerType -import org.partiql.planner.internal.fn.AggSignature -import org.partiql.planner.internal.fn.FnExperimental -import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import kotlin.collections.Set @@ -193,7 +189,8 @@ internal sealed class Statement : PlanNode() { kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitStatementQuery(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitStatementQuery(this, ctx) internal companion object { @JvmStatic @@ -347,7 +344,8 @@ internal data class Rex( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRexOpPathKey(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRexOpPathKey(this, ctx) internal companion object { @JvmStatic @@ -558,7 +556,8 @@ internal data class Rex( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRexOpNullif(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRexOpNullif(this, ctx) internal companion object { @JvmStatic @@ -575,7 +574,8 @@ internal data class Rex( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRexOpCoalesce(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRexOpCoalesce(this, ctx) internal companion object { @JvmStatic @@ -592,7 +592,8 @@ internal data class Rex( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRexOpCollection(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRexOpCollection(this, ctx) internal companion object { @JvmStatic @@ -609,7 +610,8 @@ internal data class Rex( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRexOpStruct(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRexOpStruct(this, ctx) internal data class Field( @JvmField internal val k: Rex, @@ -650,7 +652,8 @@ internal data class Rex( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRexOpPivot(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRexOpPivot(this, ctx) internal companion object { @JvmStatic @@ -670,7 +673,8 @@ internal data class Rex( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRexOpSubquery(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRexOpSubquery(this, ctx) internal enum class Coercion { SCALAR, ROW, @@ -693,7 +697,8 @@ internal data class Rex( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRexOpSelect(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRexOpSelect(this, ctx) internal companion object { @JvmStatic @@ -710,7 +715,8 @@ internal data class Rex( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRexOpTupleUnion(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRexOpTupleUnion(this, ctx) internal companion object { @JvmStatic @@ -746,7 +752,8 @@ internal data class Rex( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRexOpMissing(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRexOpMissing(this, ctx) internal companion object { @JvmStatic @@ -842,7 +849,8 @@ internal data class Rel( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRelOpScanIndexed(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRelOpScanIndexed(this, ctx) internal companion object { @JvmStatic @@ -859,7 +867,8 @@ internal data class Rel( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRelOpUnpivot(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRelOpUnpivot(this, ctx) internal companion object { @JvmStatic @@ -876,7 +885,8 @@ internal data class Rel( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRelOpDistinct(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRelOpDistinct(this, ctx) internal companion object { @JvmStatic @@ -895,7 +905,8 @@ internal data class Rel( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRelOpFilter(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRelOpFilter(this, ctx) internal companion object { @JvmStatic @@ -1034,7 +1045,8 @@ internal data class Rel( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRelOpLimit(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRelOpLimit(this, ctx) internal companion object { @JvmStatic @@ -1053,7 +1065,8 @@ internal data class Rel( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRelOpOffset(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRelOpOffset(this, ctx) internal companion object { @JvmStatic @@ -1072,7 +1085,8 @@ internal data class Rel( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRelOpProject(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRelOpProject(this, ctx) internal companion object { @JvmStatic @@ -1120,7 +1134,8 @@ internal data class Rel( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRelOpAggregate(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRelOpAggregate(this, ctx) internal enum class Strategy { FULL, PARTIAL, @@ -1196,7 +1211,8 @@ internal data class Rel( kids.filterNotNull() } - override fun accept(visitor: PlanVisitor, ctx: C): R = visitor.visitRelOpExclude(this, ctx) + override fun accept(visitor: PlanVisitor, ctx: C): R = + visitor.visitRelOpExclude(this, ctx) internal data class Path( @JvmField internal val root: Rex.Op, diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/Symbols.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/Symbols.kt index 935743f314..607d13ee2c 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/Symbols.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/Symbols.kt @@ -6,7 +6,6 @@ import org.partiql.plan.catalogItemAgg import org.partiql.plan.catalogItemFn import org.partiql.plan.catalogItemValue import org.partiql.planner.internal.ir.Ref -import org.partiql.planner.internal.fn.FnExperimental import org.partiql.plan.Ref as CatalogRef /** @@ -31,13 +30,11 @@ internal class Symbols private constructor() { item = catalogItemValue(ref.name.toList(), ref.type), ) - fun insert(ref: Ref.Fn): CatalogRef = insert( catalog = ref.catalog, item = catalogItemFn(ref.name.toList(), ref.signature.specific), ) - fun insert(ref: Ref.Agg): CatalogRef = insert( catalog = ref.catalog, item = catalogItemAgg(ref.name.toList(), ref.signature.specific), diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt index 2492ea73d9..b14af8887f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt @@ -55,7 +55,6 @@ import org.partiql.planner.internal.utils.PlanUtils import org.partiql.spi.BindingCase import org.partiql.spi.BindingName import org.partiql.spi.BindingPath -import org.partiql.planner.internal.fn.FnExperimental import org.partiql.types.Field import org.partiql.types.PType import org.partiql.types.PType.Kind @@ -804,7 +803,7 @@ internal class PlanTyper(private val env: Env) { * @param ctx * @return */ - + override fun visitRexOpCallStatic(node: Rex.Op.Call.Static, ctx: CompilerType?): Rex { // Apply the coercions as explicit casts val args: List = node.args.map { @@ -836,7 +835,7 @@ internal class PlanTyper(private val env: Env) { * @param ctx * @return */ - + override fun visitRexOpCallDynamic(node: Rex.Op.Call.Dynamic, ctx: CompilerType?): Rex { val types = node.candidates.map { candidate -> candidate.fn.signature.returns }.toMutableSet() // TODO: Should this always be DYNAMIC? @@ -1168,7 +1167,6 @@ internal class PlanTyper(private val env: Env) { return Rex(type.toCType(), Rex.Op.Struct(fields)) } - private fun replaceGeneratedTupleUnionArg(node: Rex): Rex? { if (node.op is Rex.Op.Struct && node.type.kind == Kind.ROW) { return node @@ -1259,7 +1257,7 @@ internal class PlanTyper(private val env: Env) { * Let TX be the single-column table that is the result of applying the * to each row of T and eliminating null values <--- all NULL values are eliminated as inputs */ - + fun resolveAgg(node: Rel.Op.Aggregate.Call.Unresolved): Pair { // Type the arguments val args = node.args.map { visitRex(it, null) } diff --git a/partiql-planner/src/main/resources/partiql_plan_internal.ion b/partiql-planner/src/main/resources/partiql_plan_internal.ion index e4bc767c83..234e855d29 100644 --- a/partiql-planner/src/main/resources/partiql_plan_internal.ion +++ b/partiql-planner/src/main/resources/partiql_plan_internal.ion @@ -5,8 +5,8 @@ imports::{ partiql_value::'org.partiql.value.PartiQLValue', partiql_value_type::'org.partiql.planner.internal.typer.CompilerType', static_type::'org.partiql.planner.internal.typer.CompilerType', - fn_signature::'org.partiql.spi.fn.FnSignature', - agg_signature::'org.partiql.spi.fn.AggSignature', + fn_signature::'org.partiql.planner.internal.fn.FnSignature', + agg_signature::'org.partiql.planner.internal.fn.AggSignature', problem::'org.partiql.errors.Problem' ], } diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/PlanTest.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/PlanTest.kt index 90efd47815..3ab8095dec 100644 --- a/partiql-planner/src/test/kotlin/org/partiql/planner/PlanTest.kt +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/PlanTest.kt @@ -89,7 +89,7 @@ class PlanTest { } fun buildMetadata(catalogName: String): ConnectorMetadata { - val catalog = MemoryCatalog.PartiQL().name(catalogName).build() + val catalog = MemoryCatalog.builder().name(catalogName).build() // Insert binding val name = BindingPath( listOf( diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/PlannerErrorReportingTests.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/PlannerErrorReportingTests.kt index 7f7b6238bf..b6e5e6d2a1 100644 --- a/partiql-planner/src/test/kotlin/org/partiql/planner/PlannerErrorReportingTests.kt +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/PlannerErrorReportingTests.kt @@ -28,7 +28,7 @@ internal class PlannerErrorReportingTests { val queryId = "query" val catalog = MemoryCatalog - .PartiQL() + .builder() .name(catalogName) .define("missing_binding", StaticType.ANY) .define("atomic", StaticType.INT2) diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/exclude/SubsumptionTest.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/exclude/SubsumptionTest.kt index 7be83f169e..58042d2f85 100644 --- a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/exclude/SubsumptionTest.kt +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/exclude/SubsumptionTest.kt @@ -21,6 +21,7 @@ import org.partiql.plan.relOpExcludeTypeStructWildcard import org.partiql.plan.rexOpVar import org.partiql.planner.PartiQLPlanner import org.partiql.planner.catalog.Session +import org.partiql.plugins.memory.MemoryCatalog import org.partiql.plugins.memory.MemoryConnector import org.partiql.spi.connector.ConnectorSession import java.util.stream.Stream @@ -36,7 +37,7 @@ class SubsumptionTest { override fun getQueryId(): String = "query-id" override fun getUserId(): String = "user-id" } - private val connector = MemoryConnector.partiQL() + private val connector = MemoryConnector(MemoryCatalog("default")) } private fun getExcludeClause(statement: Statement): Rel.Op.Exclude { diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/FnResolverTest.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/FnResolverTest.kt index e271429308..d7ba1e8837 100644 --- a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/FnResolverTest.kt +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/FnResolverTest.kt @@ -5,9 +5,8 @@ import org.junit.jupiter.api.fail import org.partiql.planner.internal.FnMatch import org.partiql.planner.internal.FnResolver import org.partiql.planner.internal.typer.PlanTyper.Companion.toCType -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.FnParameter -import org.partiql.spi.fn.FnSignature +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.types.PType import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType @@ -17,7 +16,7 @@ import org.partiql.value.PartiQLValueType * We may be able to pretty-print with string equals to also simplify things. * Only the "types" of expressions matter, we ignore the underlying ops. */ -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) class FnResolverTest { @Test diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PartiQLTyperTestBase.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PartiQLTyperTestBase.kt index 146d080e19..32289a30ca 100644 --- a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PartiQLTyperTestBase.kt +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PartiQLTyperTestBase.kt @@ -70,7 +70,7 @@ abstract class PartiQLTyperTestBase { */ @OptIn(PartiQLValueExperimental::class) private fun buildMetadata(catalog: String, types: List): ConnectorMetadata { - val cat = MemoryCatalog.PartiQL().name(catalog).build() + val cat = MemoryCatalog.builder().name(catalog).build() val connector = MemoryConnector(cat) // define all bindings diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PlanTyperTestsPorted.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PlanTyperTestsPorted.kt index fd9c35e304..2430c974c6 100644 --- a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PlanTyperTestsPorted.kt +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PlanTyperTestsPorted.kt @@ -191,7 +191,7 @@ internal class PlanTyperTestsPorted { } } map.entries.map { (catalogName, bindings) -> - val catalog = MemoryCatalog.PartiQL().name(catalogName).build() + val catalog = MemoryCatalog.builder().name(catalogName).build() val connector = MemoryConnector(catalog) for (binding in bindings) { val path = binding.first diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/ScopeTest.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/ScopeTest.kt index 4d33edd1ed..6019ad9e03 100644 --- a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/ScopeTest.kt +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/ScopeTest.kt @@ -14,7 +14,6 @@ import org.partiql.spi.BindingName import org.partiql.spi.BindingPath import org.partiql.spi.connector.ConnectorHandle import org.partiql.spi.connector.ConnectorMetadata -import org.partiql.spi.fn.FnExperimental import org.partiql.types.PType import kotlin.test.assertEquals import kotlin.test.fail @@ -43,16 +42,6 @@ internal class ScopeTest { override fun getObject(path: BindingPath): ConnectorHandle.Obj? { return null } - - @FnExperimental - override fun getFunction(path: BindingPath): ConnectorHandle.Fn? { - return null - } - - @FnExperimental - override fun getAggregation(path: BindingPath): ConnectorHandle.Agg? { - return null - } } ) .build() diff --git a/test/partiql-tests-runner/src/test/kotlin/org/partiql/runner/executor/EvalExecutor.kt b/test/partiql-tests-runner/src/test/kotlin/org/partiql/runner/executor/EvalExecutor.kt index f78b189b3b..25194982eb 100644 --- a/test/partiql-tests-runner/src/test/kotlin/org/partiql/runner/executor/EvalExecutor.kt +++ b/test/partiql-tests-runner/src/test/kotlin/org/partiql/runner/executor/EvalExecutor.kt @@ -162,13 +162,13 @@ class EvalExecutor( env.fields.forEach { map[it.name] = inferEnv(it.value) } - val catalog = MemoryCatalog.PartiQL().name("default").build() + val catalog = MemoryCatalog.builder().name("default").build() catalog.load(env) return MemoryConnector(catalog) } private fun inferEnv(env: AnyElement): PType { - val catalog = MemoryCatalog.PartiQL().name("conformance_test").build() + val catalog = MemoryCatalog.builder().name("conformance_test").build() val connector = MemoryConnector(catalog) val session = PlannerSession.builder() .catalog("default")