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 2460f2d2aa..d5cd75689c 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 @@ -57,7 +57,6 @@ 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.types.PType import org.partiql.value.PartiQLValueExperimental import java.lang.IllegalStateException @@ -179,7 +178,6 @@ internal class Compiler( return RelAggregate(input, groups, calls) } - @OptIn(FnExperimental::class) 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) } - @OptIn(FnExperimental::class) 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( } } - @OptIn(FnExperimental::class) 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 d770c79484..8175e74064 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,30 +6,30 @@ 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.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 +import org.partiql.spi.fn.SqlFnProvider /** * * * @property catalogs */ -@OptIn(FnExperimental::class) + 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 35b9a17ebb..e4abd8f40e 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 @@ -4,8 +4,6 @@ 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 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 { - @OptIn(FnExperimental::class) 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..1a230f5fb9 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 @@ -5,7 +5,6 @@ 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.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..217055afa0 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 @@ -6,7 +6,6 @@ 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.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..ed7c4076f4 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 @@ -4,10 +4,9 @@ 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.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..6b764d85bf 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 @@ -14,7 +14,6 @@ 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.value.PartiQLValue @@ -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/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 22c23fb239..c9e98aae7f 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 @@ -18,12 +18,10 @@ 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.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental +import org.partiql.spi.fn.SqlFnProvider import org.partiql.types.PType import org.partiql.types.PType.Kind @@ -53,14 +51,9 @@ internal class Env(private val session: Session) { private val objects: PathResolverObj = PathResolverObj(catalog, catalogs, session) /** - * A [PathResolver] for looking up functions given both unqualified and qualified names. + * A [SqlFnProvider] for looking up built-in functions. */ - private val fns: PathResolverFn = PathResolverFn(catalog, catalogs, session) - - /** - * A [PathResolver] for aggregation function lookup. - */ - private val aggs: PathResolverAgg = PathResolverAgg(catalog, catalogs, session) + private val fns: SqlFnProvider = SqlFnProvider /** * This function looks up a global [BindingPath], returning a global reference expression. @@ -85,19 +78,23 @@ internal class Env(private val session: Session) { return if (tail.isEmpty()) root else root.toPath(tail) } - @OptIn(FnExperimental::class) 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() @@ -114,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(), @@ -127,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 @@ -144,18 +141,18 @@ internal class Env(private val session: Session) { } } - @OptIn(FnExperimental::class) - 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]) { @@ -217,7 +214,6 @@ internal class Env(private val session: Session) { return userInputPath.steps.size + actualAbsolutePath.size - pathSentToConnector.steps.size } - @OptIn(FnExperimental::class) private fun match(candidates: List, args: List): Pair>? { // 1. Check for an exact match for (candidate in candidates) { @@ -243,7 +239,7 @@ internal class Env(private val session: Session) { /** * Check if this function accepts the exact input argument types. Assume same arity. */ - @OptIn(FnExperimental::class) + private fun AggSignature.matches(args: List): Boolean { for (i in args.indices) { val a = args[i] @@ -259,7 +255,6 @@ internal class Env(private val session: Session) { * @param args * @return */ - @OptIn(FnExperimental::class) private fun AggSignature.match(args: List): Pair>? { val mapping = arrayOfNulls(args.size) for (i in args.indices) { diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnComparator.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnComparator.kt index f94f52c10c..23a08fb977 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnComparator.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnComparator.kt @@ -1,11 +1,9 @@ package org.partiql.planner.internal -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnParameter import org.partiql.spi.fn.FnSignature import org.partiql.types.PType import org.partiql.types.PType.Kind -import org.partiql.value.PartiQLValueExperimental /** * Function precedence comparator; this is not formally specified. @@ -13,7 +11,6 @@ import org.partiql.value.PartiQLValueExperimental * 1. Fewest args first * 2. Parameters are compared left-to-right */ -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) internal object FnComparator : Comparator { override fun compare(fn1: FnSignature, fn2: FnSignature): Int { diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnMatch.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnMatch.kt index 8fb4197af9..7107b6eb63 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnMatch.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/FnMatch.kt @@ -1,13 +1,12 @@ package org.partiql.planner.internal import org.partiql.planner.internal.ir.Ref -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnSignature /** * Result of matching an unresolved function. */ -@OptIn(FnExperimental::class) + internal sealed class FnMatch { /** 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 33501e4d47..f24a289f3f 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 @@ -4,7 +4,6 @@ import org.partiql.planner.internal.casts.Coercions 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.spi.fn.FnExperimental import org.partiql.spi.fn.FnSignature import org.partiql.types.PType.Kind @@ -23,7 +22,7 @@ import org.partiql.types.PType.Kind * * Reference https://www.postgresql.org/docs/current/typeconv-func.html */ -@OptIn(FnExperimental::class) + internal object FnResolver { /** diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PathResolverAgg.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PathResolverAgg.kt deleted file mode 100644 index f760729869..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PathResolverAgg.kt +++ /dev/null @@ -1,20 +0,0 @@ -package org.partiql.planner.internal - -import org.partiql.planner.catalog.Session -import org.partiql.spi.BindingPath -import org.partiql.spi.connector.ConnectorAgg -import org.partiql.spi.connector.ConnectorHandle -import org.partiql.spi.connector.ConnectorMetadata -import org.partiql.spi.fn.FnExperimental - -@OptIn(FnExperimental::class) -internal class PathResolverAgg( - catalog: ConnectorMetadata, - catalogs: Map, - session: Session, -) : PathResolver(catalog, catalogs, session) { - - override fun get(metadata: ConnectorMetadata, path: BindingPath): ConnectorHandle.Agg? { - return metadata.getAggregation(path) - } -} diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PathResolverFn.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PathResolverFn.kt deleted file mode 100644 index 2d70851f79..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PathResolverFn.kt +++ /dev/null @@ -1,32 +0,0 @@ -package org.partiql.planner.internal - -import org.partiql.planner.catalog.Session -import org.partiql.spi.BindingName -import org.partiql.spi.BindingPath -import org.partiql.spi.connector.ConnectorFn -import org.partiql.spi.connector.ConnectorHandle -import org.partiql.spi.connector.ConnectorMetadata -import org.partiql.spi.fn.FnExperimental - -/** - * PathResolver which calls out to get matching function names. - - * - * @param catalog - * @param catalogs - * @param session - */ -@OptIn(FnExperimental::class) -internal class PathResolverFn( - catalog: ConnectorMetadata, - catalogs: Map, - session: Session, -) : PathResolver(catalog, catalogs, session) { - - /** - * Default INFORMATION_SCHEMA.ROUTINES. Keep empty for now for top-level lookup. - */ - override val schema: List = emptyList() - - override fun get(metadata: ConnectorMetadata, path: BindingPath): ConnectorHandle.Fn? = metadata.getFunction(path) -} 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 4371b04362..7c502cd050 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.spi.fn.AggSignature +import org.partiql.spi.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.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.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 8d5f4b0980..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.spi.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), ) - @OptIn(FnExperimental::class) fun insert(ref: Ref.Fn): CatalogRef = insert( catalog = ref.catalog, item = catalogItemFn(ref.name.toList(), ref.signature.specific), ) - @OptIn(FnExperimental::class) 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 baa0cdd35e..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.spi.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 */ - @OptIn(FnExperimental::class) + 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 */ - @OptIn(FnExperimental::class) + 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)) } - @OptIn(FnExperimental::class) 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 */ - @OptIn(FnExperimental::class) + 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/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..afe96b2120 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,7 +5,6 @@ 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.types.PType @@ -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/partiql-spi/api/partiql-spi.api b/partiql-spi/api/partiql-spi.api index c99f5ac93d..d496ae8f8a 100644 --- a/partiql-spi/api/partiql-spi.api +++ b/partiql-spi/api/partiql-spi.api @@ -35,9 +35,7 @@ public abstract interface class org/partiql/spi/Plugin { } public abstract interface class org/partiql/spi/connector/Connector { - public abstract fun getAggregations ()Lorg/partiql/spi/connector/ConnectorAggProvider; public abstract fun getBindings ()Lorg/partiql/spi/connector/ConnectorBindings; - public abstract fun getFunctions ()Lorg/partiql/spi/connector/ConnectorFnProvider; public abstract fun getMetadata (Lorg/partiql/spi/connector/ConnectorSession;)Lorg/partiql/spi/connector/ConnectorMetadata; } @@ -50,59 +48,15 @@ public final class org/partiql/spi/connector/Connector$Factory$DefaultImpls { public static synthetic fun create$default (Lorg/partiql/spi/connector/Connector$Factory;Ljava/lang/String;Lcom/amazon/ionelement/api/StructElement;ILjava/lang/Object;)Lorg/partiql/spi/connector/Connector; } -public abstract interface class org/partiql/spi/connector/ConnectorAgg { - public abstract fun getVariants ()Ljava/util/List; -} - -public abstract interface class org/partiql/spi/connector/ConnectorAggProvider { - public abstract fun getAgg (Lorg/partiql/spi/connector/ConnectorPath;Ljava/lang/String;)Lorg/partiql/spi/fn/Agg; -} - public abstract interface class org/partiql/spi/connector/ConnectorBindings { public abstract fun getValue (Lorg/partiql/spi/connector/ConnectorPath;)Lorg/partiql/value/PartiQLValue; } -public abstract interface class org/partiql/spi/connector/ConnectorFn { - public abstract fun getVariants ()Ljava/util/List; -} - -public abstract interface class org/partiql/spi/connector/ConnectorFnProvider { - public abstract fun getFn (Lorg/partiql/spi/connector/ConnectorPath;Ljava/lang/String;)Lorg/partiql/spi/fn/Fn; -} - public abstract class org/partiql/spi/connector/ConnectorHandle { public abstract fun getEntity ()Ljava/lang/Object; public abstract fun getPath ()Lorg/partiql/spi/connector/ConnectorPath; } -public final class org/partiql/spi/connector/ConnectorHandle$Agg : org/partiql/spi/connector/ConnectorHandle { - public fun (Lorg/partiql/spi/connector/ConnectorPath;Lorg/partiql/spi/connector/ConnectorAgg;)V - public final fun component1 ()Lorg/partiql/spi/connector/ConnectorPath; - public final fun component2 ()Lorg/partiql/spi/connector/ConnectorAgg; - public final fun copy (Lorg/partiql/spi/connector/ConnectorPath;Lorg/partiql/spi/connector/ConnectorAgg;)Lorg/partiql/spi/connector/ConnectorHandle$Agg; - public static synthetic fun copy$default (Lorg/partiql/spi/connector/ConnectorHandle$Agg;Lorg/partiql/spi/connector/ConnectorPath;Lorg/partiql/spi/connector/ConnectorAgg;ILjava/lang/Object;)Lorg/partiql/spi/connector/ConnectorHandle$Agg; - public fun equals (Ljava/lang/Object;)Z - public synthetic fun getEntity ()Ljava/lang/Object; - public fun getEntity ()Lorg/partiql/spi/connector/ConnectorAgg; - public fun getPath ()Lorg/partiql/spi/connector/ConnectorPath; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - -public final class org/partiql/spi/connector/ConnectorHandle$Fn : org/partiql/spi/connector/ConnectorHandle { - public fun (Lorg/partiql/spi/connector/ConnectorPath;Lorg/partiql/spi/connector/ConnectorFn;)V - public final fun component1 ()Lorg/partiql/spi/connector/ConnectorPath; - public final fun component2 ()Lorg/partiql/spi/connector/ConnectorFn; - public final fun copy (Lorg/partiql/spi/connector/ConnectorPath;Lorg/partiql/spi/connector/ConnectorFn;)Lorg/partiql/spi/connector/ConnectorHandle$Fn; - public static synthetic fun copy$default (Lorg/partiql/spi/connector/ConnectorHandle$Fn;Lorg/partiql/spi/connector/ConnectorPath;Lorg/partiql/spi/connector/ConnectorFn;ILjava/lang/Object;)Lorg/partiql/spi/connector/ConnectorHandle$Fn; - public fun equals (Ljava/lang/Object;)Z - public synthetic fun getEntity ()Ljava/lang/Object; - public fun getEntity ()Lorg/partiql/spi/connector/ConnectorFn; - public fun getPath ()Lorg/partiql/spi/connector/ConnectorPath; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - public final class org/partiql/spi/connector/ConnectorHandle$Obj : org/partiql/spi/connector/ConnectorHandle { public fun (Lorg/partiql/spi/connector/ConnectorPath;Lorg/partiql/spi/connector/ConnectorObject;)V public final fun component1 ()Lorg/partiql/spi/connector/ConnectorPath; @@ -118,8 +72,6 @@ public final class org/partiql/spi/connector/ConnectorHandle$Obj : org/partiql/s } public abstract interface class org/partiql/spi/connector/ConnectorMetadata { - public abstract fun getAggregation (Lorg/partiql/spi/BindingPath;)Lorg/partiql/spi/connector/ConnectorHandle$Agg; - public abstract fun getFunction (Lorg/partiql/spi/BindingPath;)Lorg/partiql/spi/connector/ConnectorHandle$Fn; public abstract fun getObject (Lorg/partiql/spi/BindingPath;)Lorg/partiql/spi/connector/ConnectorHandle$Obj; } @@ -163,330 +115,6 @@ public final class org/partiql/spi/connector/Constants { public static final field INSTANCE Lorg/partiql/spi/connector/Constants; } -public final class org/partiql/spi/connector/sql/SqlAgg : org/partiql/spi/connector/ConnectorAgg { - public fun (Ljava/lang/String;Ljava/util/List;)V - public fun getVariants ()Ljava/util/List; -} - -public final class org/partiql/spi/connector/sql/SqlAggProvider : org/partiql/spi/connector/ConnectorAggProvider { - public fun (Lorg/partiql/spi/fn/Index;)V - public fun getAgg (Lorg/partiql/spi/connector/ConnectorPath;Ljava/lang/String;)Lorg/partiql/spi/fn/Agg; -} - -public final class org/partiql/spi/connector/sql/SqlBindings : org/partiql/spi/connector/ConnectorBindings { - public fun (Lorg/partiql/spi/connector/sql/info/InfoSchema;)V - public fun getValue (Lorg/partiql/spi/connector/ConnectorPath;)Lorg/partiql/value/PartiQLValue; -} - -public abstract class org/partiql/spi/connector/sql/SqlConnector : org/partiql/spi/connector/Connector { - public fun ()V - public fun getAggregations ()Lorg/partiql/spi/connector/ConnectorAggProvider; - public fun getBindings ()Lorg/partiql/spi/connector/ConnectorBindings; - public fun getFunctions ()Lorg/partiql/spi/connector/ConnectorFnProvider; - public fun getInfo ()Lorg/partiql/spi/connector/sql/info/InfoSchema; - public abstract fun getMetadata (Lorg/partiql/spi/connector/ConnectorSession;)Lorg/partiql/spi/connector/sql/SqlMetadata; -} - -public final class org/partiql/spi/connector/sql/SqlFn : org/partiql/spi/connector/ConnectorFn { - public fun (Ljava/lang/String;Ljava/util/List;)V - public fun getVariants ()Ljava/util/List; -} - -public final class org/partiql/spi/connector/sql/SqlFnProvider : org/partiql/spi/connector/ConnectorFnProvider { - public fun (Lorg/partiql/spi/fn/Index;)V - public fun getFn (Lorg/partiql/spi/connector/ConnectorPath;Ljava/lang/String;)Lorg/partiql/spi/fn/Fn; -} - -public class org/partiql/spi/connector/sql/SqlMetadata : org/partiql/spi/connector/ConnectorMetadata { - public fun (Lorg/partiql/spi/connector/ConnectorSession;Lorg/partiql/spi/connector/sql/info/InfoSchema;)V - public fun getAggregation (Lorg/partiql/spi/BindingPath;)Lorg/partiql/spi/connector/ConnectorHandle$Agg; - public fun getFunction (Lorg/partiql/spi/BindingPath;)Lorg/partiql/spi/connector/ConnectorHandle$Fn; - public fun getObject (Lorg/partiql/spi/BindingPath;)Lorg/partiql/spi/connector/ConnectorHandle$Obj; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_ANY__ANY__BOOL : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_ANY__ANY__BOOL; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_ANY__BOOL__BOOL : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_ANY__BOOL__BOOL; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_AVG__ANY__ANY : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_AVG__ANY__ANY; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_AVG__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_AVG__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_AVG__FLOAT32__FLOAT32 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_AVG__FLOAT32__FLOAT32; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_AVG__FLOAT64__FLOAT64 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_AVG__FLOAT64__FLOAT64; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_AVG__INT16__INT16 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_AVG__INT16__INT16; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_AVG__INT32__INT32 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_AVG__INT32__INT32; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_AVG__INT64__INT64 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_AVG__INT64__INT64; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_AVG__INT8__INT8 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_AVG__INT8__INT8; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_AVG__INT__INT : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_AVG__INT__INT; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_COUNT__ANY__INT64 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_COUNT__ANY__INT64; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_EVERY__ANY__BOOL : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_EVERY__ANY__BOOL; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_EVERY__BOOL__BOOL : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_EVERY__BOOL__BOOL; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_GROUP_AS__ANY__ANY : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_GROUP_AS__ANY__ANY; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MAX__ANY__ANY : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MAX__ANY__ANY; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MAX__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MAX__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MAX__FLOAT32__FLOAT32 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MAX__FLOAT32__FLOAT32; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MAX__FLOAT64__FLOAT64 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MAX__FLOAT64__FLOAT64; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MAX__INT16__INT16 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MAX__INT16__INT16; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MAX__INT32__INT32 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MAX__INT32__INT32; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MAX__INT64__INT64 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MAX__INT64__INT64; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MAX__INT8__INT8 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MAX__INT8__INT8; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MAX__INT__INT : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MAX__INT__INT; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MIN__ANY__ANY : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MIN__ANY__ANY; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MIN__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MIN__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MIN__FLOAT32__FLOAT32 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MIN__FLOAT32__FLOAT32; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MIN__FLOAT64__FLOAT64 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MIN__FLOAT64__FLOAT64; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MIN__INT16__INT16 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MIN__INT16__INT16; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MIN__INT32__INT32 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MIN__INT32__INT32; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MIN__INT64__INT64 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MIN__INT64__INT64; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MIN__INT8__INT8 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MIN__INT8__INT8; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_MIN__INT__INT : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_MIN__INT__INT; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SOME__ANY__BOOL : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SOME__ANY__BOOL; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SOME__BOOL__BOOL : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SOME__BOOL__BOOL; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SUM__ANY__ANY : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SUM__ANY__ANY; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SUM__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SUM__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SUM__FLOAT32__FLOAT32 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SUM__FLOAT32__FLOAT32; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SUM__FLOAT64__FLOAT64 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SUM__FLOAT64__FLOAT64; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SUM__INT16__INT16 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SUM__INT16__INT16; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SUM__INT32__INT32 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SUM__INT32__INT32; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SUM__INT64__INT64 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SUM__INT64__INT64; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SUM__INT8__INT8 : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SUM__INT8__INT8; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/builtins/Agg_SUM__INT__INT : org/partiql/spi/fn/Agg { - public static final field INSTANCE Lorg/partiql/spi/connector/sql/builtins/Agg_SUM__INT__INT; - public fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; - public fun getSignature ()Lorg/partiql/spi/fn/AggSignature; -} - -public final class org/partiql/spi/connector/sql/info/InfoSchema { - public static final field Companion Lorg/partiql/spi/connector/sql/info/InfoSchema$Companion; - public fun (Lorg/partiql/spi/fn/Index;Lorg/partiql/spi/fn/Index;)V - public static final fun default ()Lorg/partiql/spi/connector/sql/info/InfoSchema; - public final fun get (Ljava/lang/String;)Lorg/partiql/spi/connector/sql/info/InfoView; - public final fun getAggregations ()Lorg/partiql/spi/fn/Index; - public final fun getFunctions ()Lorg/partiql/spi/fn/Index; -} - -public final class org/partiql/spi/connector/sql/info/InfoSchema$Companion { - public final fun default ()Lorg/partiql/spi/connector/sql/info/InfoSchema; - public final fun ext ()Lorg/partiql/spi/connector/sql/info/InfoSchema; -} - -public abstract interface class org/partiql/spi/connector/sql/info/InfoView { - public abstract fun getSchema ()Lorg/partiql/types/StaticType; - public abstract fun value ()Lorg/partiql/value/PartiQLValue; -} - public abstract interface class org/partiql/spi/fn/Agg { public abstract fun accumulator ()Lorg/partiql/spi/fn/Agg$Accumulator; public abstract fun getSignature ()Lorg/partiql/spi/fn/AggSignature; @@ -519,9 +147,6 @@ public abstract interface class org/partiql/spi/fn/Fn { public abstract fun invoke ([Lorg/partiql/value/PartiQLValue;)Lorg/partiql/value/PartiQLValue; } -public abstract interface annotation class org/partiql/spi/fn/FnExperimental : java/lang/annotation/Annotation { -} - public final class org/partiql/spi/fn/FnParameter { public fun (Ljava/lang/String;Lorg/partiql/types/PType;)V public fun (Ljava/lang/String;Lorg/partiql/value/PartiQLValueType;)V @@ -568,33 +193,11 @@ public final class org/partiql/spi/fn/FnSignature { public fun toString ()Ljava/lang/String; } -public abstract interface class org/partiql/spi/fn/Index { - public static final field Companion Lorg/partiql/spi/fn/Index$Companion; - public static fun aggBuilder ()Lorg/partiql/spi/fn/Index$Builder; - public static fun fnBuilder ()Lorg/partiql/spi/fn/Index$Builder; - public abstract fun get (Ljava/util/List;)Ljava/util/List; - public abstract fun get (Lorg/partiql/spi/connector/ConnectorPath;Ljava/lang/String;)Ljava/lang/Object; -} - -public abstract class org/partiql/spi/fn/Index$Builder { - public fun ()V - public final fun add (Ljava/lang/Object;)Lorg/partiql/spi/fn/Index$Builder; - public final fun addAll (Ljava/util/List;)Lorg/partiql/spi/fn/Index$Builder; - public abstract fun build ()Lorg/partiql/spi/fn/Index; -} - -public final class org/partiql/spi/fn/Index$Builder$Agg : org/partiql/spi/fn/Index$Builder { - public fun ()V - public fun build ()Lorg/partiql/spi/fn/Index; -} - -public final class org/partiql/spi/fn/Index$Builder$Fn : org/partiql/spi/fn/Index$Builder { - public fun ()V - public fun build ()Lorg/partiql/spi/fn/Index; -} - -public final class org/partiql/spi/fn/Index$Companion { - public final fun aggBuilder ()Lorg/partiql/spi/fn/Index$Builder; - public final fun fnBuilder ()Lorg/partiql/spi/fn/Index$Builder; +public final class org/partiql/spi/fn/SqlFnProvider { + public static final field INSTANCE Lorg/partiql/spi/fn/SqlFnProvider; + public final fun getAgg (Ljava/lang/String;)Lorg/partiql/spi/fn/Agg; + public final fun getFn (Ljava/lang/String;)Lorg/partiql/spi/fn/Fn; + public final fun lookupAgg (Ljava/lang/String;)Ljava/util/List; + public final fun lookupFn (Ljava/lang/String;)Ljava/util/List; } diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/Connector.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/Connector.kt index 5726996dc2..ee1715bdfa 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/Connector.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/Connector.kt @@ -15,7 +15,6 @@ package org.partiql.spi.connector import com.amazon.ionelement.api.StructElement -import org.partiql.spi.fn.FnExperimental /** * A [Connector] is used by the PartiQL compiler and engine to implement a catalog. @@ -39,22 +38,6 @@ public interface Connector { */ public fun getBindings(): ConnectorBindings - /** - * Returns a [ConnectorFnProvider] which the engine uses to load function implementations. - * - * @return - */ - @FnExperimental - public fun getFunctions(): ConnectorFnProvider - - /** - * Returns a [ConnectorAggProvider] which the engine uses to load aggregation function implementations. - * - * @return - */ - @FnExperimental - public fun getAggregations(): ConnectorAggProvider - /** * A Plugin leverages a [Factory] to produce a [Connector] which is used for catalog metadata and data access. */ diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorAgg.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorAgg.kt deleted file mode 100644 index 2bad2ec44f..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorAgg.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector - -import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental - -@OptIn(FnExperimental::class) -public interface ConnectorAgg { - - /** - * Returns a function's variants. - * - * @return - */ - public fun getVariants(): List -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorAggProvider.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorAggProvider.kt deleted file mode 100644 index f496275e20..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorAggProvider.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector - -import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.FnExperimental - -/** - * A [ConnectorAggProvider] implementation is responsible for providing an aggregation function implementation given a handle. - */ -@FnExperimental -public interface ConnectorAggProvider { - public fun getAgg(path: ConnectorPath, specific: String): Agg? -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorFn.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorFn.kt deleted file mode 100644 index acb8c81094..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorFn.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector - -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.FnSignature - -@OptIn(FnExperimental::class) -public interface ConnectorFn { - - /** - * Returns a function's variants. - * - * @return - */ - public fun getVariants(): List -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorFnProvider.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorFnProvider.kt deleted file mode 100644 index e28a22c116..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorFnProvider.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector - -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental - -/** - * A [ConnectorFnProvider] implementation is responsible for providing a function implementation given a handle. - */ -@FnExperimental -public interface ConnectorFnProvider { - - public fun getFn(path: ConnectorPath, specific: String): Fn? -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorHandle.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorHandle.kt index e4624278b0..cac161491c 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorHandle.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorHandle.kt @@ -33,14 +33,4 @@ public sealed class ConnectorHandle { override val path: ConnectorPath, override val entity: ConnectorObject, ) : ConnectorHandle() - - public data class Fn( - override val path: ConnectorPath, - override val entity: ConnectorFn, - ) : ConnectorHandle() - - public data class Agg( - override val path: ConnectorPath, - override val entity: ConnectorAgg, - ) : ConnectorHandle() } diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorMetadata.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorMetadata.kt index 3b447afb9d..95263166ea 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorMetadata.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/ConnectorMetadata.kt @@ -15,7 +15,6 @@ package org.partiql.spi.connector import org.partiql.spi.BindingPath -import org.partiql.spi.fn.FnExperimental /** * Aids in retrieving relevant Catalog metadata for the purpose of planning and execution. @@ -37,22 +36,4 @@ public interface ConnectorMetadata { * If the [path] does not correspond to an existing [ConnectorObject], implementers should return null. */ public fun getObject(path: BindingPath): ConnectorHandle.Obj? - - /** - * Returns all function signatures matching the given path. - * - * @param path - * @return - */ - @FnExperimental - public fun getFunction(path: BindingPath): ConnectorHandle.Fn? - - /** - * Returns all aggregation function signatures matching the given name. - * - * @param path - * @return - */ - @FnExperimental - public fun getAggregation(path: BindingPath): ConnectorHandle.Agg? } diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/PartiQLExts.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/PartiQLExts.kt deleted file mode 100644 index 5d52b73c0b..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/PartiQLExts.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.partiql.spi.connector.sql - -/* ktlint-disable no-wildcard-imports */ -import org.partiql.spi.connector.sql.exts.* -import org.partiql.spi.fn.FnExperimental - -/** - * PartiQL built-in functions that are not in the SQL-92 spec - */ -@OptIn(FnExperimental::class) -internal object PartiQLExts { - @JvmStatic - val builtins = listOf( - Fn_EXISTS__BAG__BOOL, - Fn_EXISTS__LIST__BOOL, - Fn_EXISTS__SEXP__BOOL, - Fn_EXISTS__STRUCT__BOOL, - Fn_SIZE__BAG__INT32, - Fn_SIZE__LIST__INT32, - Fn_SIZE__SEXP__INT32, - Fn_SIZE__STRUCT__INT32 - ) -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlAgg.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlAgg.kt deleted file mode 100644 index 90912f93dd..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlAgg.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector.sql - -import org.partiql.spi.connector.ConnectorAgg -import org.partiql.spi.connector.ConnectorFn -import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental - -/** - * Simple [ConnectorFn] implementation wrapping a signature. - * - * @property name - * @property variants - */ -@OptIn(FnExperimental::class) -public class SqlAgg( - private val name: String, - private val variants: List, -) : ConnectorAgg { - - override fun getVariants(): List = variants -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlAggProvider.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlAggProvider.kt deleted file mode 100644 index 38a4f0236d..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlAggProvider.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector.sql - -import org.partiql.spi.connector.ConnectorAggProvider -import org.partiql.spi.connector.ConnectorFnProvider -import org.partiql.spi.connector.ConnectorPath -import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.Index - -/** - * A basic [ConnectorFnProvider] over an [Index]. - */ -@OptIn(FnExperimental::class) -public class SqlAggProvider(private val index: Index) : ConnectorAggProvider { - - override fun getAgg(path: ConnectorPath, specific: String): Agg? { - return index.get(path, specific) - } -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlBindings.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlBindings.kt deleted file mode 100644 index 116db91f0f..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlBindings.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector.sql - -import org.partiql.spi.connector.ConnectorBindings -import org.partiql.spi.connector.ConnectorPath -import org.partiql.spi.connector.sql.info.InfoSchema -import org.partiql.value.PartiQLValue -import org.partiql.value.PartiQLValueExperimental - -/** - * An implementation of [ConnectorBindings] including the INFORMATION_SCHEMA. - */ -public class SqlBindings(private val info: InfoSchema) : ConnectorBindings { - - @OptIn(PartiQLValueExperimental::class) - public override fun getValue(path: ConnectorPath): PartiQLValue { - TODO("Not yet implemented") - } -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlConnector.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlConnector.kt deleted file mode 100644 index 5d2ca12131..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlConnector.kt +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector.sql - -import org.partiql.spi.connector.Connector -import org.partiql.spi.connector.ConnectorAggProvider -import org.partiql.spi.connector.ConnectorBindings -import org.partiql.spi.connector.ConnectorFnProvider -import org.partiql.spi.connector.ConnectorMetadata -import org.partiql.spi.connector.ConnectorSession -import org.partiql.spi.connector.sql.info.InfoSchema -import org.partiql.spi.fn.FnExperimental - -/** - * An SQL-99 based [Connector] implementation. - */ -public abstract class SqlConnector : Connector { - - /** - * Default SQL-99 INFORMATION_SCHEMA for use in function resolution. - */ - public open val info: InfoSchema = InfoSchema.default() - - /** - * Returns an implementation of [ConnectorMetadata] which provides the INFORMATION_SCHEMA and delegates - * to a user-provided [ConnectorMetadata] implementation. - * - * @param session - * @return - */ - abstract override fun getMetadata(session: ConnectorSession): SqlMetadata - - override fun getBindings(): ConnectorBindings = SqlBindings(info) - - @FnExperimental - override fun getFunctions(): ConnectorFnProvider = SqlFnProvider(info.functions) - - @FnExperimental - override fun getAggregations(): ConnectorAggProvider = SqlAggProvider(info.aggregations) -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlFn.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlFn.kt deleted file mode 100644 index 11a90e42cc..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlFn.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector.sql - -import org.partiql.spi.connector.ConnectorFn -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.FnSignature - -/** - * Simple [ConnectorFn] implementation wrapping a signature. - * - * @property name - * @property variants - */ -@OptIn(FnExperimental::class) -public class SqlFn( - private val name: String, - private val variants: List, -) : ConnectorFn { - - override fun getVariants(): List = variants -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlFnProvider.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlFnProvider.kt deleted file mode 100644 index a74e5e95b9..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlFnProvider.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector.sql - -import org.partiql.spi.connector.ConnectorFnProvider -import org.partiql.spi.connector.ConnectorPath -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.Index - -/** - * A basic [ConnectorFnProvider] over an [Index]. - */ -@OptIn(FnExperimental::class) -public class SqlFnProvider(private val index: Index) : ConnectorFnProvider { - - override fun getFn(path: ConnectorPath, specific: String): Fn? { - return index.get(path, specific) - } -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlMetadata.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlMetadata.kt deleted file mode 100644 index 128085745c..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlMetadata.kt +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.spi.connector.sql - -import org.partiql.spi.BindingPath -import org.partiql.spi.connector.ConnectorHandle -import org.partiql.spi.connector.ConnectorMetadata -import org.partiql.spi.connector.ConnectorPath -import org.partiql.spi.connector.ConnectorSession -import org.partiql.spi.connector.sql.info.InfoSchema -import org.partiql.spi.fn.FnExperimental - -/** - * An instance of [SqlMetadata] - * - * @property session - * @property info - */ -public open class SqlMetadata( - private val session: ConnectorSession, - private val info: InfoSchema, -) : ConnectorMetadata { - - /** - * TODO provide schemas from `info`. - * - * @param path - * @return - */ - override fun getObject(path: BindingPath): ConnectorHandle.Obj? = null - - @FnExperimental - override fun getFunction(path: BindingPath): ConnectorHandle.Fn? { - val cnf = path.steps.map { it.name.uppercase() } - val name = cnf.last() - val variants = info.functions.get(cnf).map { it.signature } - if (variants.isEmpty()) { - return null - } - return ConnectorHandle.Fn(ConnectorPath(cnf), SqlFn(name, variants)) - } - - @FnExperimental - override fun getAggregation(path: BindingPath): ConnectorHandle.Agg? { - val cnf = path.steps.map { it.name.uppercase() } - val name = cnf.last() - val variants = info.aggregations.get(cnf).map { it.signature } - if (variants.isEmpty()) { - return null - } - return ConnectorHandle.Agg(ConnectorPath(cnf), SqlAgg(name, variants)) - } -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/info/InfoSchema.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/info/InfoSchema.kt deleted file mode 100644 index 4244dffc61..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/info/InfoSchema.kt +++ /dev/null @@ -1,54 +0,0 @@ -package org.partiql.spi.connector.sql.info - -import org.partiql.spi.connector.sql.PartiQLExts -import org.partiql.spi.connector.sql.SqlBuiltins -import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.Index - -/** - * Provides the INFORMATION_SCHEMA views over internal database symbols. - */ -public class InfoSchema @OptIn(FnExperimental::class) constructor( - public val functions: Index, - public val aggregations: Index -) { - - /** - * INFORMATION_SCHEMA.ROUTINES - */ - @OptIn(FnExperimental::class) - private val routines: InfoView = InfoViewRoutines(functions) - - public fun get(table: String): InfoView? = when (table) { - "routines" -> routines - else -> null - } - - public companion object { - - @OptIn(FnExperimental::class) - @JvmStatic - public fun default(): InfoSchema { - val functions = Index.fnBuilder() - .addAll(SqlBuiltins.builtins) - .build() - val aggregations = Index.aggBuilder() - .addAll(SqlBuiltins.aggregations) - .build() - return InfoSchema(functions, aggregations) - } - - @OptIn(FnExperimental::class) - public fun ext(): InfoSchema { - val functions = Index.fnBuilder() - .addAll(SqlBuiltins.builtins + PartiQLExts.builtins) - .build() - val aggregations = Index.aggBuilder() - .addAll(SqlBuiltins.aggregations) - .build() - return InfoSchema(functions, aggregations) - } - } -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/info/InfoView.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/info/InfoView.kt deleted file mode 100644 index c1d2b2991e..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/info/InfoView.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.partiql.spi.connector.sql.info - -import org.partiql.types.StaticType -import org.partiql.value.PartiQLValue -import org.partiql.value.PartiQLValueExperimental - -/** - * Basic interface for an INFORMATION_SCHEMA table view. - */ -public interface InfoView { - - public val schema: StaticType - - @OptIn(PartiQLValueExperimental::class) - public fun value(): PartiQLValue -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/info/InfoViewRoutines.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/info/InfoViewRoutines.kt deleted file mode 100644 index 157c3ab556..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/info/InfoViewRoutines.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.partiql.spi.connector.sql.info - -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.Index -import org.partiql.types.BagType -import org.partiql.types.StaticType -import org.partiql.types.StructType -import org.partiql.types.TupleConstraint -import org.partiql.value.PartiQLValue -import org.partiql.value.PartiQLValueExperimental -import org.partiql.value.bagValue -import org.partiql.value.nullValue - -/** - * This provides the INFORMATION_SCHEMA.ROUTINES view for an [SqlConnector]. - */ -internal class InfoViewRoutines @OptIn(FnExperimental::class) constructor(private val index: Index) : InfoView { - - override val schema: StaticType = BagType( - elementType = StructType( - fields = listOf( - StructType.Field("ROUTINE_NAME", StaticType.STRING), - StructType.Field("ROUTINE_TYPE", StaticType.STRING), - ), - contentClosed = true, - constraints = setOf(TupleConstraint.Open(false)) - ) - ) - - @OptIn(PartiQLValueExperimental::class) - override fun value(): PartiQLValue { - return bagValue(listOf(nullValue())) - } -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Agg.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Agg.kt index 485ce2f0eb..2ade2f23ae 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Agg.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Agg.kt @@ -6,7 +6,6 @@ import org.partiql.value.PartiQLValueExperimental /** * Represents an SQL table-value expression call. */ -@FnExperimental public interface Agg { /** diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/AggSignature.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/AggSignature.kt index 3e797a60da..ccfcbbd9ae 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/AggSignature.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/AggSignature.kt @@ -10,7 +10,6 @@ import org.partiql.value.PartiQLValueType * @property isDecomposable Flag indicating this aggregation can be decomposed * @constructor */ -@FnExperimental @OptIn(PartiQLValueExperimental::class) public class AggSignature( @JvmField public val name: String, diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Fn.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Fn.kt index e0744ec89a..265095110a 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Fn.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Fn.kt @@ -6,7 +6,6 @@ import org.partiql.value.PartiQLValueExperimental /** * Represents a scalar function (SQL row-value call expression). */ -@FnExperimental public interface Fn { /** diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnExperimental.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnExperimental.kt deleted file mode 100644 index 711c0d6e86..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnExperimental.kt +++ /dev/null @@ -1,7 +0,0 @@ -package org.partiql.spi.fn - -@RequiresOptIn( - message = "PartiQLFunction requires explicit opt-in", - level = RequiresOptIn.Level.ERROR, -) -public annotation class FnExperimental diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnParameter.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnParameter.kt index 9905cf1f00..a3ba8d29ed 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnParameter.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnParameter.kt @@ -10,7 +10,6 @@ import org.partiql.value.PartiQLValueType * @property name A human-readable name to help clarify its use. * @property type The parameter's PartiQL type. */ -@FnExperimental @OptIn(PartiQLValueExperimental::class) public data class FnParameter( public val name: String, diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnSignature.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnSignature.kt index d7e4a6ef30..6d0cd392fa 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnSignature.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/FnSignature.kt @@ -20,7 +20,6 @@ import org.partiql.value.PartiQLValueType * @property isMissable Flag indicating this function's operator may return a MISSING value. * @property isMissingCall Flag indicating if any of the call arguments is MISSING, the return MISSING. */ -@FnExperimental @OptIn(PartiQLValueExperimental::class) public data class FnSignature( @JvmField public val name: String, diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Index.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Index.kt deleted file mode 100644 index 738f2ed901..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/Index.kt +++ /dev/null @@ -1,76 +0,0 @@ -package org.partiql.spi.fn - -import org.partiql.spi.connector.ConnectorPath - -/** - * Utility class for an optimized function lookup data structure. Right now this is read only. - */ -@OptIn(FnExperimental::class) -public interface Index { - - /** - * Search for all functions matching the normalized path. - * - * @param path - * @return - */ - public fun get(path: List): List - - /** - * Lookup a function signature by its specific name. - * - * @param specific - * @return - */ - public fun get(path: ConnectorPath, specific: String): T? - - public abstract class Builder { - - /** - * A catalog's builtins exposed via INFORMATION_SCHEMA. - */ - internal val builtins: MutableList = mutableListOf() - - public fun add(fn: T): Builder = this.apply { - builtins.add(fn) - } - - public fun addAll(fns: List): Builder = this.apply { - builtins.addAll(fns) - } - - /** - * Creates a map of function name to variants; variants are keyed by their specific. - * - * @return - */ - public abstract fun build(): Index - - public class Fn : Builder() { - override fun build(): Index { - val fns = builtins - .groupBy { it.signature.name.uppercase() } - .mapValues { e -> e.value.associateBy { f -> f.signature.specific } } - return IndexMap(fns) - } - } - - public class Agg : Builder() { - override fun build(): Index { - val fns = builtins - .groupBy { it.signature.name.uppercase() } - .mapValues { e -> e.value.associateBy { f -> f.signature.specific } } - return IndexMap(fns) - } - } - } - - public companion object { - - @JvmStatic - public fun fnBuilder(): Builder = Builder.Fn() - - @JvmStatic - public fun aggBuilder(): Builder = Builder.Agg() - } -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/IndexMap.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/IndexMap.kt deleted file mode 100644 index 660f099663..0000000000 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/IndexMap.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.partiql.spi.fn - -import org.partiql.spi.connector.ConnectorPath - -/** - * An implementation of [Index] which uses the normalized paths as map keys. - * - * @property map - */ -internal class IndexMap(private val map: Map>) : Index { - - override fun get(path: List): List { - val key = path.joinToString(".") - val variants = map[key] ?: emptyMap() - return variants.values.toList() - } - - override fun get(path: ConnectorPath, specific: String): T? { - val key = path.steps.joinToString(".") - val variants = map[key] ?: emptyMap() - return variants[specific] - } -} diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlBuiltins.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/SqlBuiltins.kt similarity index 97% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlBuiltins.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/SqlBuiltins.kt index bc13d3b524..8f88966bab 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/SqlBuiltins.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/SqlBuiltins.kt @@ -1,15 +1,11 @@ -package org.partiql.spi.connector.sql +package org.partiql.spi.fn /* ktlint-disable no-wildcard-imports */ -import org.partiql.spi.connector.sql.builtins.* -import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental +import org.partiql.spi.fn.builtins.* /** * This is where we will register all SQL builtins. For now, we wrap the generated header to keep the diff small. */ -@OptIn(FnExperimental::class) internal object SqlBuiltins { @JvmStatic @@ -398,6 +394,17 @@ internal object SqlBuiltins { Fn_UPPER__CLOB__CLOB, Fn_UPPER__SYMBOL__SYMBOL, Fn_UTCNOW____TIMESTAMP, + // + // NON SQL FUNCTIONS + // + Fn_EXISTS__BAG__BOOL, + Fn_EXISTS__LIST__BOOL, + Fn_EXISTS__SEXP__BOOL, + Fn_EXISTS__STRUCT__BOOL, + Fn_SIZE__BAG__INT32, + Fn_SIZE__LIST__INT32, + Fn_SIZE__SEXP__INT32, + Fn_SIZE__STRUCT__INT32 ) @JvmStatic diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/fn/SqlFnProvider.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/SqlFnProvider.kt new file mode 100644 index 0000000000..d5c8b5d0eb --- /dev/null +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/SqlFnProvider.kt @@ -0,0 +1,38 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at: + * + * http://aws.amazon.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific + * language governing permissions and limitations under the License. + */ + +package org.partiql.spi.fn + +/** + * TODO !! TEMPORARY AS FUNCTIONS ARE MOVED FROM CONNECTORS TO PLANNER. + */ +public object SqlFnProvider { + + 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 } + + // + // INTERNAL PLANNER APIS + // + public fun lookupFn(name: String): List? = fnNameIndex[name] + public fun lookupAgg(name: String): List? = 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-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggAny.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggAny.kt similarity index 71% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggAny.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggAny.kt index ae232d4129..102051f508 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggAny.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggAny.kt @@ -1,19 +1,18 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorAnySome import org.partiql.spi.fn.Agg import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnParameter +import org.partiql.spi.fn.builtins.internal.AccumulatorAnySome import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_ANY__BOOL__BOOL : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_ANY__BOOL__BOOL : Agg { override val signature: AggSignature = AggSignature( name = "any", @@ -28,8 +27,8 @@ public object Agg_ANY__BOOL__BOOL : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorAnySome() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_ANY__ANY__BOOL : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_ANY__ANY__BOOL : Agg { override val signature: AggSignature = AggSignature( name = "any", diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggAvg.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggAvg.kt similarity index 76% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggAvg.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggAvg.kt index 1287a7f011..1db291b6c6 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggAvg.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggAvg.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorAvg import org.partiql.spi.fn.Agg import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnParameter +import org.partiql.spi.fn.builtins.internal.AccumulatorAvg import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.DECIMAL @@ -20,8 +19,8 @@ import org.partiql.value.PartiQLValueType.INT32 import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.INT8 -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_AVG__INT8__INT8 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_AVG__INT8__INT8 : Agg { override val signature: AggSignature = AggSignature( name = "avg", @@ -36,8 +35,8 @@ public object Agg_AVG__INT8__INT8 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_AVG__INT16__INT16 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_AVG__INT16__INT16 : Agg { override val signature: AggSignature = AggSignature( name = "avg", @@ -52,8 +51,8 @@ public object Agg_AVG__INT16__INT16 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_AVG__INT32__INT32 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_AVG__INT32__INT32 : Agg { override val signature: AggSignature = AggSignature( name = "avg", @@ -68,8 +67,8 @@ public object Agg_AVG__INT32__INT32 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_AVG__INT64__INT64 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_AVG__INT64__INT64 : Agg { override val signature: AggSignature = AggSignature( name = "avg", @@ -84,8 +83,8 @@ public object Agg_AVG__INT64__INT64 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_AVG__INT__INT : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_AVG__INT__INT : Agg { override val signature: AggSignature = AggSignature( name = "avg", @@ -100,8 +99,8 @@ public object Agg_AVG__INT__INT : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL_ARBITRARY) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_AVG__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_AVG__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { override val signature: AggSignature = AggSignature( name = "avg", @@ -116,8 +115,8 @@ public object Agg_AVG__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL_ARBITRARY) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_AVG__FLOAT32__FLOAT32 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_AVG__FLOAT32__FLOAT32 : Agg { override val signature: AggSignature = AggSignature( name = "avg", @@ -132,8 +131,8 @@ public object Agg_AVG__FLOAT32__FLOAT32 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorAvg(FLOAT32) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_AVG__FLOAT64__FLOAT64 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_AVG__FLOAT64__FLOAT64 : Agg { override val signature: AggSignature = AggSignature( name = "avg", @@ -148,8 +147,8 @@ public object Agg_AVG__FLOAT64__FLOAT64 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorAvg(FLOAT64) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_AVG__ANY__ANY : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_AVG__ANY__ANY : Agg { override val signature: AggSignature = AggSignature( name = "avg", diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggCount.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggCount.kt similarity index 70% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggCount.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggCount.kt index 63dc2be90c..47c95df1ea 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggCount.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggCount.kt @@ -1,19 +1,18 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorCount import org.partiql.spi.fn.Agg import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnParameter +import org.partiql.spi.fn.builtins.internal.AccumulatorCount import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.INT64 -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_COUNT__ANY__INT64 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_COUNT__ANY__INT64 : Agg { override val signature: AggSignature = AggSignature( name = "count", diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggEvery.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggEvery.kt similarity index 71% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggEvery.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggEvery.kt index 8420c15d8e..471da16d23 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggEvery.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggEvery.kt @@ -1,19 +1,18 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorEvery import org.partiql.spi.fn.Agg import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnParameter +import org.partiql.spi.fn.builtins.internal.AccumulatorEvery import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_EVERY__BOOL__BOOL : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_EVERY__BOOL__BOOL : Agg { override val signature: AggSignature = AggSignature( name = "every", @@ -28,8 +27,8 @@ public object Agg_EVERY__BOOL__BOOL : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorEvery() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_EVERY__ANY__BOOL : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_EVERY__ANY__BOOL : Agg { override val signature: AggSignature = AggSignature( name = "every", diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggGroupAs.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggGroupAs.kt similarity index 69% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggGroupAs.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggGroupAs.kt index 5b586ee155..b9f75f428b 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggGroupAs.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggGroupAs.kt @@ -1,18 +1,17 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorGroupAs import org.partiql.spi.fn.Agg import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnParameter +import org.partiql.spi.fn.builtins.internal.AccumulatorGroupAs import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_GROUP_AS__ANY__ANY : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_GROUP_AS__ANY__ANY : Agg { override val signature: AggSignature = AggSignature( name = "group_as", diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggMax.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggMax.kt similarity index 75% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggMax.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggMax.kt index 71a094dc98..3d478da217 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggMax.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggMax.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorMax import org.partiql.spi.fn.Agg import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnParameter +import org.partiql.spi.fn.builtins.internal.AccumulatorMax import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.DECIMAL_ARBITRARY @@ -19,8 +18,8 @@ import org.partiql.value.PartiQLValueType.INT32 import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.INT8 -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MAX__INT8__INT8 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MAX__INT8__INT8 : Agg { override val signature: AggSignature = AggSignature( name = "max", @@ -35,8 +34,8 @@ public object Agg_MAX__INT8__INT8 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMax() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MAX__INT16__INT16 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MAX__INT16__INT16 : Agg { override val signature: AggSignature = AggSignature( name = "max", @@ -51,8 +50,8 @@ public object Agg_MAX__INT16__INT16 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMax() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MAX__INT32__INT32 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MAX__INT32__INT32 : Agg { override val signature: AggSignature = AggSignature( name = "max", @@ -67,8 +66,8 @@ public object Agg_MAX__INT32__INT32 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMax() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MAX__INT64__INT64 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MAX__INT64__INT64 : Agg { override val signature: AggSignature = AggSignature( name = "max", @@ -83,8 +82,8 @@ public object Agg_MAX__INT64__INT64 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMax() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MAX__INT__INT : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MAX__INT__INT : Agg { override val signature: AggSignature = AggSignature( name = "max", @@ -99,8 +98,8 @@ public object Agg_MAX__INT__INT : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMax() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MAX__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MAX__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { override val signature: AggSignature = AggSignature( name = "max", @@ -115,8 +114,8 @@ public object Agg_MAX__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMax() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MAX__FLOAT32__FLOAT32 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MAX__FLOAT32__FLOAT32 : Agg { override val signature: AggSignature = AggSignature( name = "max", @@ -131,8 +130,8 @@ public object Agg_MAX__FLOAT32__FLOAT32 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMax() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MAX__FLOAT64__FLOAT64 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MAX__FLOAT64__FLOAT64 : Agg { override val signature: AggSignature = AggSignature( name = "max", @@ -147,8 +146,8 @@ public object Agg_MAX__FLOAT64__FLOAT64 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMax() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MAX__ANY__ANY : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MAX__ANY__ANY : Agg { override val signature: AggSignature = AggSignature( name = "max", diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggMin.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggMin.kt similarity index 75% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggMin.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggMin.kt index 03b2f7d009..1ece12be7c 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggMin.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggMin.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorMin import org.partiql.spi.fn.Agg import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnParameter +import org.partiql.spi.fn.builtins.internal.AccumulatorMin import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.DECIMAL_ARBITRARY @@ -19,8 +18,8 @@ import org.partiql.value.PartiQLValueType.INT32 import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.INT8 -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MIN__INT8__INT8 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MIN__INT8__INT8 : Agg { override val signature: AggSignature = AggSignature( name = "min", @@ -35,8 +34,8 @@ public object Agg_MIN__INT8__INT8 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMin() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MIN__INT16__INT16 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MIN__INT16__INT16 : Agg { override val signature: AggSignature = AggSignature( name = "min", @@ -51,8 +50,8 @@ public object Agg_MIN__INT16__INT16 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMin() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MIN__INT32__INT32 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MIN__INT32__INT32 : Agg { override val signature: AggSignature = AggSignature( name = "min", @@ -67,8 +66,8 @@ public object Agg_MIN__INT32__INT32 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMin() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MIN__INT64__INT64 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MIN__INT64__INT64 : Agg { override val signature: AggSignature = AggSignature( name = "min", @@ -83,8 +82,8 @@ public object Agg_MIN__INT64__INT64 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMin() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MIN__INT__INT : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MIN__INT__INT : Agg { override val signature: AggSignature = AggSignature( name = "min", @@ -99,8 +98,8 @@ public object Agg_MIN__INT__INT : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMin() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MIN__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MIN__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { override val signature: AggSignature = AggSignature( name = "min", @@ -115,8 +114,8 @@ public object Agg_MIN__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMin() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MIN__FLOAT32__FLOAT32 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MIN__FLOAT32__FLOAT32 : Agg { override val signature: AggSignature = AggSignature( name = "min", @@ -131,8 +130,8 @@ public object Agg_MIN__FLOAT32__FLOAT32 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMin() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MIN__FLOAT64__FLOAT64 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MIN__FLOAT64__FLOAT64 : Agg { override val signature: AggSignature = AggSignature( name = "min", @@ -147,8 +146,8 @@ public object Agg_MIN__FLOAT64__FLOAT64 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorMin() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_MIN__ANY__ANY : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_MIN__ANY__ANY : Agg { override val signature: AggSignature = AggSignature( name = "min", diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggSome.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggSome.kt similarity index 71% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggSome.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggSome.kt index 1480c27a8f..acb6571dc4 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggSome.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggSome.kt @@ -1,19 +1,18 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorAnySome import org.partiql.spi.fn.Agg import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnParameter +import org.partiql.spi.fn.builtins.internal.AccumulatorAnySome import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SOME__BOOL__BOOL : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SOME__BOOL__BOOL : Agg { override val signature: AggSignature = AggSignature( name = "some", @@ -28,8 +27,8 @@ public object Agg_SOME__BOOL__BOOL : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorAnySome() } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SOME__ANY__BOOL : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SOME__ANY__BOOL : Agg { override val signature: AggSignature = AggSignature( name = "some", diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggSum.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggSum.kt similarity index 75% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggSum.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggSum.kt index 9fc312159e..c9a35d8a6f 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/AggSum.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/AggSum.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorSum import org.partiql.spi.fn.Agg import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnParameter +import org.partiql.spi.fn.builtins.internal.AccumulatorSum import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.DECIMAL_ARBITRARY @@ -19,8 +18,8 @@ import org.partiql.value.PartiQLValueType.INT32 import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.INT8 -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SUM__INT8__INT8 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SUM__INT8__INT8 : Agg { override val signature: AggSignature = AggSignature( name = "sum", @@ -35,8 +34,8 @@ public object Agg_SUM__INT8__INT8 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorSum(INT8) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SUM__INT16__INT16 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SUM__INT16__INT16 : Agg { override val signature: AggSignature = AggSignature( name = "sum", @@ -51,8 +50,8 @@ public object Agg_SUM__INT16__INT16 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorSum(INT16) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SUM__INT32__INT32 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SUM__INT32__INT32 : Agg { override val signature: AggSignature = AggSignature( name = "sum", @@ -67,8 +66,8 @@ public object Agg_SUM__INT32__INT32 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorSum(INT32) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SUM__INT64__INT64 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SUM__INT64__INT64 : Agg { override val signature: AggSignature = AggSignature( name = "sum", @@ -83,8 +82,8 @@ public object Agg_SUM__INT64__INT64 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorSum(INT64) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SUM__INT__INT : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SUM__INT__INT : Agg { override val signature: AggSignature = AggSignature( name = "sum", @@ -99,8 +98,8 @@ public object Agg_SUM__INT__INT : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorSum(INT) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SUM__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SUM__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { override val signature: AggSignature = AggSignature( name = "sum", @@ -115,8 +114,8 @@ public object Agg_SUM__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorSum(DECIMAL_ARBITRARY) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SUM__FLOAT32__FLOAT32 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SUM__FLOAT32__FLOAT32 : Agg { override val signature: AggSignature = AggSignature( name = "sum", @@ -131,8 +130,8 @@ public object Agg_SUM__FLOAT32__FLOAT32 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorSum(FLOAT32) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SUM__FLOAT64__FLOAT64 : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SUM__FLOAT64__FLOAT64 : Agg { override val signature: AggSignature = AggSignature( name = "sum", @@ -147,8 +146,8 @@ public object Agg_SUM__FLOAT64__FLOAT64 : Agg { override fun accumulator(): Agg.Accumulator = AccumulatorSum(FLOAT64) } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -public object Agg_SUM__ANY__ANY : Agg { +@OptIn(PartiQLValueExperimental::class) +internal object Agg_SUM__ANY__ANY : Agg { override val signature: AggSignature = AggSignature( name = "sum", diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnAbs.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnAbs.kt similarity index 89% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnAbs.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnAbs.kt index bfd4a054a0..3dd184a734 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnAbs.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnAbs.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DecimalValue @@ -37,7 +36,7 @@ import org.partiql.value.intValue import kotlin.math.absoluteValue // TODO: When negate a negative value, we need to consider overflow -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_ABS__INT8__INT8 : Fn { override val signature = FnSignature( @@ -54,7 +53,7 @@ internal object Fn_ABS__INT8__INT8 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_ABS__INT16__INT16 : Fn { override val signature = FnSignature( @@ -71,7 +70,7 @@ internal object Fn_ABS__INT16__INT16 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_ABS__INT32__INT32 : Fn { override val signature = FnSignature( @@ -88,7 +87,7 @@ internal object Fn_ABS__INT32__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_ABS__INT64__INT64 : Fn { override val signature = FnSignature( @@ -105,7 +104,7 @@ internal object Fn_ABS__INT64__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_ABS__INT__INT : Fn { override val signature = FnSignature( @@ -122,7 +121,7 @@ internal object Fn_ABS__INT__INT : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_ABS__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { override val signature = FnSignature( @@ -139,7 +138,7 @@ internal object Fn_ABS__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_ABS__FLOAT32__FLOAT32 : Fn { override val signature = FnSignature( @@ -156,7 +155,7 @@ internal object Fn_ABS__FLOAT32__FLOAT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_ABS__FLOAT64__FLOAT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnAnd.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnAnd.kt similarity index 89% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnAnd.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnAnd.kt index f5c552cfe9..7e6a1969cc 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnAnd.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnAnd.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BoolValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_AND__BOOL_BOOL__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnBetween.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnBetween.kt similarity index 91% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnBetween.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnBetween.kt index a60d7d6469..c65f096ebc 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnBetween.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnBetween.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.ClobValue @@ -40,7 +39,7 @@ import org.partiql.value.TimestampValue import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__INT8_INT8_INT8__BOOL : Fn { override val signature = FnSignature( @@ -63,7 +62,7 @@ internal object Fn_BETWEEN__INT8_INT8_INT8__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__INT16_INT16_INT16__BOOL : Fn { override val signature = FnSignature( @@ -86,7 +85,7 @@ internal object Fn_BETWEEN__INT16_INT16_INT16__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__INT32_INT32_INT32__BOOL : Fn { override val signature = FnSignature( @@ -109,7 +108,7 @@ internal object Fn_BETWEEN__INT32_INT32_INT32__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__INT64_INT64_INT64__BOOL : Fn { override val signature = FnSignature( @@ -132,7 +131,7 @@ internal object Fn_BETWEEN__INT64_INT64_INT64__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__INT_INT_INT__BOOL : Fn { override val signature = FnSignature( @@ -155,7 +154,7 @@ internal object Fn_BETWEEN__INT_INT_INT__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__BOOL : Fn { override val signature = FnSignature( @@ -178,7 +177,7 @@ internal object Fn_BETWEEN__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY_DECIMAL_ARBITRAR } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__FLOAT32_FLOAT32_FLOAT32__BOOL : Fn { override val signature = FnSignature( @@ -201,7 +200,7 @@ internal object Fn_BETWEEN__FLOAT32_FLOAT32_FLOAT32__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__FLOAT64_FLOAT64_FLOAT64__BOOL : Fn { override val signature = FnSignature( @@ -224,7 +223,7 @@ internal object Fn_BETWEEN__FLOAT64_FLOAT64_FLOAT64__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__STRING_STRING_STRING__BOOL : Fn { override val signature = FnSignature( @@ -247,7 +246,7 @@ internal object Fn_BETWEEN__STRING_STRING_STRING__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__SYMBOL_SYMBOL_SYMBOL__BOOL : Fn { override val signature = FnSignature( @@ -270,7 +269,7 @@ internal object Fn_BETWEEN__SYMBOL_SYMBOL_SYMBOL__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__CLOB_CLOB_CLOB__BOOL : Fn { override val signature = FnSignature( @@ -293,7 +292,7 @@ internal object Fn_BETWEEN__CLOB_CLOB_CLOB__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__DATE_DATE_DATE__BOOL : Fn { override val signature = FnSignature( @@ -316,7 +315,7 @@ internal object Fn_BETWEEN__DATE_DATE_DATE__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__TIME_TIME_TIME__BOOL : Fn { override val signature = FnSignature( @@ -339,7 +338,7 @@ internal object Fn_BETWEEN__TIME_TIME_TIME__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BETWEEN__TIMESTAMP_TIMESTAMP_TIMESTAMP__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnBitLength.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnBitLength.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnBitLength.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnBitLength.kt index 2f129af5b7..ab956c9aaa 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnBitLength.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnBitLength.kt @@ -1,7 +1,6 @@ -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.ClobValue @@ -14,7 +13,7 @@ import org.partiql.value.check import org.partiql.value.int32Value // SQL spec section 6.17 contains -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BIT_LENGTH__STRING__INT32 : Fn { override val signature = FnSignature( @@ -34,7 +33,7 @@ internal object Fn_BIT_LENGTH__STRING__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BIT_LENGTH__SYMBOL__INT32 : Fn { override val signature = FnSignature( @@ -54,7 +53,7 @@ internal object Fn_BIT_LENGTH__SYMBOL__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BIT_LENGTH__CLOB__INT32 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnBitwiseAnd.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnBitwiseAnd.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnBitwiseAnd.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnBitwiseAnd.kt index 33c5f5660c..2b0555bd61 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnBitwiseAnd.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnBitwiseAnd.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.Int16Value @@ -27,7 +26,7 @@ import org.partiql.value.int8Value import org.partiql.value.intValue import kotlin.experimental.and -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BITWISE_AND__INT8_INT8__INT8 : Fn { override val signature = FnSignature( @@ -48,7 +47,7 @@ internal object Fn_BITWISE_AND__INT8_INT8__INT8 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BITWISE_AND__INT16_INT16__INT16 : Fn { override val signature = FnSignature( @@ -69,7 +68,7 @@ internal object Fn_BITWISE_AND__INT16_INT16__INT16 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BITWISE_AND__INT32_INT32__INT32 : Fn { override val signature = FnSignature( @@ -90,7 +89,7 @@ internal object Fn_BITWISE_AND__INT32_INT32__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BITWISE_AND__INT64_INT64__INT64 : Fn { override val signature = FnSignature( @@ -111,7 +110,7 @@ internal object Fn_BITWISE_AND__INT64_INT64__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_BITWISE_AND__INT_INT__INT : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCardinality.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCardinality.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCardinality.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCardinality.kt index 93f9498a0b..e77581a75a 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCardinality.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCardinality.kt @@ -1,7 +1,6 @@ -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BagValue @@ -14,7 +13,7 @@ import org.partiql.value.StructValue import org.partiql.value.check import org.partiql.value.int32Value -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CARDINALITY__BAG__INT32 : Fn { override val signature = FnSignature( @@ -33,7 +32,7 @@ internal object Fn_CARDINALITY__BAG__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CARDINALITY__LIST__INT32 : Fn { override val signature = FnSignature( @@ -52,7 +51,7 @@ internal object Fn_CARDINALITY__LIST__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CARDINALITY__SEXP__INT32 : Fn { override val signature = FnSignature( @@ -71,7 +70,7 @@ internal object Fn_CARDINALITY__SEXP__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CARDINALITY__STRUCT__INT32 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCharLength.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCharLength.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCharLength.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCharLength.kt index e2c0b40003..0e9b8594c2 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCharLength.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCharLength.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.ClobValue @@ -20,7 +19,7 @@ import org.partiql.value.SymbolValue import org.partiql.value.check import org.partiql.value.int32Value -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CHAR_LENGTH__STRING__INT : Fn { override val signature = FnSignature( @@ -39,7 +38,7 @@ internal object Fn_CHAR_LENGTH__STRING__INT : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CHAR_LENGTH__SYMBOL__INT : Fn { override val signature = FnSignature( @@ -58,7 +57,7 @@ internal object Fn_CHAR_LENGTH__SYMBOL__INT : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CHAR_LENGTH__CLOB__INT : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCollAgg.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCollAgg.kt similarity index 78% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCollAgg.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCollAgg.kt index c480edb9ec..a5930241ce 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCollAgg.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCollAgg.kt @@ -1,28 +1,27 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.builtins.internal.Accumulator -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorAnySome -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorAvg -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorCount -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorEvery -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorMax -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorMin -import org.partiql.spi.connector.sql.builtins.internal.AccumulatorSum import org.partiql.spi.fn.Agg 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.spi.fn.builtins.internal.Accumulator +import org.partiql.spi.fn.builtins.internal.AccumulatorAnySome +import org.partiql.spi.fn.builtins.internal.AccumulatorAvg +import org.partiql.spi.fn.builtins.internal.AccumulatorCount +import org.partiql.spi.fn.builtins.internal.AccumulatorEvery +import org.partiql.spi.fn.builtins.internal.AccumulatorMax +import org.partiql.spi.fn.builtins.internal.AccumulatorMin +import org.partiql.spi.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 -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal abstract class Fn_COLL_AGG__BAG__ANY : Fn { abstract fun getAccumulator(): Agg.Accumulator diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnConcat.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnConcat.kt similarity index 89% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnConcat.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnConcat.kt index b4b18beee5..1689b269a4 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnConcat.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnConcat.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.ClobValue @@ -20,7 +19,7 @@ import org.partiql.value.clobValue import org.partiql.value.stringValue import org.partiql.value.symbolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CONCAT__STRING_STRING__STRING : Fn { override val signature = FnSignature( @@ -41,7 +40,7 @@ internal object Fn_CONCAT__STRING_STRING__STRING : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CONCAT__SYMBOL_SYMBOL__SYMBOL : Fn { override val signature = FnSignature( @@ -62,7 +61,7 @@ internal object Fn_CONCAT__SYMBOL_SYMBOL__SYMBOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CONCAT__CLOB_CLOB__CLOB : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCurrentDate.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCurrentDate.kt similarity index 80% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCurrentDate.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCurrentDate.kt index b802665068..a34e229d56 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCurrentDate.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCurrentDate.kt @@ -1,16 +1,15 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.DATE -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CURRENT_DATE____DATE : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCurrentUser.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCurrentUser.kt similarity index 80% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCurrentUser.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCurrentUser.kt index 94f427dbde..ff3514087b 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnCurrentUser.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnCurrentUser.kt @@ -1,16 +1,15 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.STRING -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_CURRENT_USER____STRING : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddDay.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddDay.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddDay.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddDay.kt index 1f6c6cc08b..e57231aada 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddDay.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddDay.kt @@ -1,12 +1,11 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException 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.value.DateValue @@ -25,7 +24,7 @@ import org.partiql.value.check import org.partiql.value.dateValue import org.partiql.value.timestampValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_DAY__INT32_DATE__DATE : Fn { override val signature = FnSignature( @@ -48,7 +47,7 @@ internal object Fn_DATE_ADD_DAY__INT32_DATE__DATE : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_DAY__INT64_DATE__DATE : Fn { override val signature = FnSignature( @@ -71,7 +70,7 @@ internal object Fn_DATE_ADD_DAY__INT64_DATE__DATE : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_DAY__INT_DATE__DATE : Fn { override val signature = FnSignature( @@ -89,14 +88,16 @@ internal object Fn_DATE_ADD_DAY__INT_DATE__DATE : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { throw TypeCheckException() } return dateValue(datetimeValue.plusDays(intervalValue)) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_DAY__INT32_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -119,7 +120,7 @@ internal object Fn_DATE_ADD_DAY__INT32_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_DAY__INT64_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -142,7 +143,7 @@ internal object Fn_DATE_ADD_DAY__INT64_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_DAY__INT_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -160,7 +161,9 @@ internal object Fn_DATE_ADD_DAY__INT_TIMESTAMP__TIMESTAMP : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { throw TypeCheckException() } return timestampValue(datetimeValue.plusDays(intervalValue)) diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddHour.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddHour.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddHour.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddHour.kt index 72d59304cc..049e72aa61 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddHour.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddHour.kt @@ -1,12 +1,11 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException 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.value.Int32Value @@ -25,7 +24,7 @@ import org.partiql.value.check import org.partiql.value.timeValue import org.partiql.value.timestampValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_HOUR__INT32_TIME__TIME : Fn { override val signature = FnSignature( @@ -48,7 +47,7 @@ internal object Fn_DATE_ADD_HOUR__INT32_TIME__TIME : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_HOUR__INT64_TIME__TIME : Fn { override val signature = FnSignature( @@ -71,7 +70,7 @@ internal object Fn_DATE_ADD_HOUR__INT64_TIME__TIME : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_HOUR__INT_TIME__TIME : Fn { override val signature = FnSignature( @@ -89,12 +88,16 @@ internal object Fn_DATE_ADD_HOUR__INT_TIME__TIME : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { throw TypeCheckException() } + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { + throw TypeCheckException() + } return timeValue(datetimeValue.plusHours(intervalValue)) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_HOUR__INT32_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -117,7 +120,7 @@ internal object Fn_DATE_ADD_HOUR__INT32_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_HOUR__INT64_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -140,7 +143,7 @@ internal object Fn_DATE_ADD_HOUR__INT64_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_HOUR__INT_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -158,7 +161,11 @@ internal object Fn_DATE_ADD_HOUR__INT_TIMESTAMP__TIMESTAMP : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { throw TypeCheckException() } + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { + throw TypeCheckException() + } return timestampValue(datetimeValue.plusHours(intervalValue)) } } diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddMinute.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddMinute.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddMinute.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddMinute.kt index b8c11b2910..41d42b72e0 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddMinute.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddMinute.kt @@ -1,12 +1,11 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException 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.value.Int32Value @@ -25,7 +24,7 @@ import org.partiql.value.check import org.partiql.value.timeValue import org.partiql.value.timestampValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MINUTE__INT32_TIME__TIME : Fn { override val signature = FnSignature( @@ -48,7 +47,7 @@ internal object Fn_DATE_ADD_MINUTE__INT32_TIME__TIME : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MINUTE__INT64_TIME__TIME : Fn { override val signature = FnSignature( @@ -71,7 +70,7 @@ internal object Fn_DATE_ADD_MINUTE__INT64_TIME__TIME : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MINUTE__INT_TIME__TIME : Fn { override val signature = FnSignature( @@ -89,12 +88,16 @@ internal object Fn_DATE_ADD_MINUTE__INT_TIME__TIME : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { throw TypeCheckException() } + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { + throw TypeCheckException() + } return timeValue(datetimeValue.plusMinutes(intervalValue)) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MINUTE__INT32_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -117,7 +120,7 @@ internal object Fn_DATE_ADD_MINUTE__INT32_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MINUTE__INT64_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -140,7 +143,7 @@ internal object Fn_DATE_ADD_MINUTE__INT64_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MINUTE__INT_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -158,7 +161,11 @@ internal object Fn_DATE_ADD_MINUTE__INT_TIMESTAMP__TIMESTAMP : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { throw TypeCheckException() } + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { + throw TypeCheckException() + } return timestampValue(datetimeValue.plusMinutes(intervalValue)) } } diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddMonth.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddMonth.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddMonth.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddMonth.kt index c243dea3d1..bed8f18025 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddMonth.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddMonth.kt @@ -1,12 +1,11 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException 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.value.DateValue @@ -25,7 +24,7 @@ import org.partiql.value.check import org.partiql.value.dateValue import org.partiql.value.timestampValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MONTH__INT32_DATE__DATE : Fn { override val signature = FnSignature( @@ -48,7 +47,7 @@ internal object Fn_DATE_ADD_MONTH__INT32_DATE__DATE : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MONTH__INT64_DATE__DATE : Fn { override val signature = FnSignature( @@ -71,7 +70,7 @@ internal object Fn_DATE_ADD_MONTH__INT64_DATE__DATE : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MONTH__INT_DATE__DATE : Fn { override val signature = FnSignature( @@ -89,12 +88,16 @@ internal object Fn_DATE_ADD_MONTH__INT_DATE__DATE : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { throw TypeCheckException() } + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { + throw TypeCheckException() + } return dateValue(datetimeValue.plusMonths(intervalValue)) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MONTH__INT32_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -117,7 +120,7 @@ internal object Fn_DATE_ADD_MONTH__INT32_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MONTH__INT64_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -140,7 +143,7 @@ internal object Fn_DATE_ADD_MONTH__INT64_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_MONTH__INT_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -158,7 +161,11 @@ internal object Fn_DATE_ADD_MONTH__INT_TIMESTAMP__TIMESTAMP : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { throw TypeCheckException() } + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { + throw TypeCheckException() + } return timestampValue(datetimeValue.plusMonths(intervalValue)) } } diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddSecond.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddSecond.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddSecond.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddSecond.kt index 8d1715037d..59e778e57e 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddSecond.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddSecond.kt @@ -1,12 +1,11 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException 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.value.Int32Value @@ -25,7 +24,7 @@ import org.partiql.value.check import org.partiql.value.timeValue import org.partiql.value.timestampValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_SECOND__INT32_TIME__TIME : Fn { override val signature = FnSignature( @@ -48,7 +47,7 @@ internal object Fn_DATE_ADD_SECOND__INT32_TIME__TIME : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_SECOND__INT64_TIME__TIME : Fn { override val signature = FnSignature( @@ -71,7 +70,7 @@ internal object Fn_DATE_ADD_SECOND__INT64_TIME__TIME : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_SECOND__INT_TIME__TIME : Fn { override val signature = FnSignature( @@ -89,12 +88,16 @@ internal object Fn_DATE_ADD_SECOND__INT_TIME__TIME : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { throw TypeCheckException() } + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { + throw TypeCheckException() + } return timeValue(datetimeValue.plusSeconds(intervalValue)) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_SECOND__INT32_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -117,7 +120,7 @@ internal object Fn_DATE_ADD_SECOND__INT32_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_SECOND__INT64_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -140,7 +143,7 @@ internal object Fn_DATE_ADD_SECOND__INT64_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_SECOND__INT_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -158,7 +161,11 @@ internal object Fn_DATE_ADD_SECOND__INT_TIMESTAMP__TIMESTAMP : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { throw TypeCheckException() } + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { + throw TypeCheckException() + } return timestampValue(datetimeValue.plusSeconds(intervalValue)) } } diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddYear.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddYear.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddYear.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddYear.kt index 3d34375e42..e9087c7d72 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateAddYear.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateAddYear.kt @@ -1,12 +1,11 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException 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.value.DateValue @@ -25,7 +24,7 @@ import org.partiql.value.check import org.partiql.value.dateValue import org.partiql.value.timestampValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_YEAR__INT32_DATE__DATE : Fn { override val signature = FnSignature( @@ -48,7 +47,7 @@ internal object Fn_DATE_ADD_YEAR__INT32_DATE__DATE : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_YEAR__INT64_DATE__DATE : Fn { override val signature = FnSignature( @@ -71,7 +70,7 @@ internal object Fn_DATE_ADD_YEAR__INT64_DATE__DATE : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_YEAR__INT_DATE__DATE : Fn { override val signature = FnSignature( @@ -89,12 +88,16 @@ internal object Fn_DATE_ADD_YEAR__INT_DATE__DATE : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { throw TypeCheckException() } + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { + throw TypeCheckException() + } return dateValue(datetimeValue.plusYears(intervalValue)) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_YEAR__INT32_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -117,7 +120,7 @@ internal object Fn_DATE_ADD_YEAR__INT32_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_YEAR__INT64_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -140,7 +143,7 @@ internal object Fn_DATE_ADD_YEAR__INT64_TIMESTAMP__TIMESTAMP : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_ADD_YEAR__INT_TIMESTAMP__TIMESTAMP : Fn { override val signature = FnSignature( @@ -158,7 +161,11 @@ internal object Fn_DATE_ADD_YEAR__INT_TIMESTAMP__TIMESTAMP : Fn { val interval = args[0].check() val datetime = args[1].check() val datetimeValue = datetime.value!! - val intervalValue = try { interval.toInt64().value!! } catch (e: DataException) { throw TypeCheckException() } + val intervalValue = try { + interval.toInt64().value!! + } catch (e: DataException) { + throw TypeCheckException() + } return timestampValue(datetimeValue.plusYears(intervalValue)) } } diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffDay.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffDay.kt similarity index 86% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffDay.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffDay.kt index 8298d3ba9e..9b52c26431 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffDay.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffDay.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -13,7 +12,7 @@ import org.partiql.value.PartiQLValueType.DATE import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.TIMESTAMP -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_DAY__DATE_DATE__INT64 : Fn { override val signature = FnSignature( @@ -32,7 +31,7 @@ internal object Fn_DATE_DIFF_DAY__DATE_DATE__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_DAY__TIMESTAMP_TIMESTAMP__INT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffHour.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffHour.kt similarity index 86% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffHour.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffHour.kt index 28c838c62f..7c59386f50 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffHour.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffHour.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -13,7 +12,7 @@ import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.TIME import org.partiql.value.PartiQLValueType.TIMESTAMP -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_HOUR__TIME_TIME__INT64 : Fn { override val signature = FnSignature( @@ -32,7 +31,7 @@ internal object Fn_DATE_DIFF_HOUR__TIME_TIME__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_HOUR__TIMESTAMP_TIMESTAMP__INT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffMinute.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffMinute.kt similarity index 86% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffMinute.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffMinute.kt index 49ddfdfa23..45ba18b4f0 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffMinute.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffMinute.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -13,7 +12,7 @@ import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.TIME import org.partiql.value.PartiQLValueType.TIMESTAMP -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_MINUTE__TIME_TIME__INT64 : Fn { override val signature = FnSignature( @@ -32,7 +31,7 @@ internal object Fn_DATE_DIFF_MINUTE__TIME_TIME__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_MINUTE__TIMESTAMP_TIMESTAMP__INT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffMonth.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffMonth.kt similarity index 86% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffMonth.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffMonth.kt index db8520d9eb..0743ac109e 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffMonth.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffMonth.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -13,7 +12,7 @@ import org.partiql.value.PartiQLValueType.DATE import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.TIMESTAMP -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_MONTH__DATE_DATE__INT64 : Fn { override val signature = FnSignature( @@ -32,7 +31,7 @@ internal object Fn_DATE_DIFF_MONTH__DATE_DATE__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_MONTH__TIMESTAMP_TIMESTAMP__INT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffSecond.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffSecond.kt similarity index 86% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffSecond.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffSecond.kt index 2ba596c735..855ee5d908 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffSecond.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffSecond.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -13,7 +12,7 @@ import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.TIME import org.partiql.value.PartiQLValueType.TIMESTAMP -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_SECOND__TIME_TIME__INT64 : Fn { override val signature = FnSignature( @@ -32,7 +31,7 @@ internal object Fn_DATE_DIFF_SECOND__TIME_TIME__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_SECOND__TIMESTAMP_TIMESTAMP__INT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffYear.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffYear.kt similarity index 86% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffYear.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffYear.kt index f308618330..866ee2d492 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDateDiffYear.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDateDiffYear.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -13,7 +12,7 @@ import org.partiql.value.PartiQLValueType.DATE import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.TIMESTAMP -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_YEAR__DATE_DATE__INT64 : Fn { override val signature = FnSignature( @@ -32,7 +31,7 @@ internal object Fn_DATE_DIFF_YEAR__DATE_DATE__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DATE_DIFF_YEAR__TIMESTAMP_TIMESTAMP__INT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDivide.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDivide.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDivide.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDivide.kt index 55a2188fe6..f2a8161611 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnDivide.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnDivide.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DecimalValue @@ -36,7 +35,7 @@ import org.partiql.value.int8Value import org.partiql.value.intValue // TODO: Handle Overflow -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DIVIDE__INT8_INT8__INT8 : Fn { override val signature = FnSignature( @@ -57,7 +56,7 @@ internal object Fn_DIVIDE__INT8_INT8__INT8 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DIVIDE__INT16_INT16__INT16 : Fn { override val signature = FnSignature( @@ -78,7 +77,7 @@ internal object Fn_DIVIDE__INT16_INT16__INT16 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DIVIDE__INT32_INT32__INT32 : Fn { override val signature = FnSignature( @@ -99,7 +98,7 @@ internal object Fn_DIVIDE__INT32_INT32__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DIVIDE__INT64_INT64__INT64 : Fn { override val signature = FnSignature( @@ -120,7 +119,7 @@ internal object Fn_DIVIDE__INT64_INT64__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DIVIDE__INT_INT__INT : Fn { override val signature = FnSignature( @@ -141,7 +140,7 @@ internal object Fn_DIVIDE__INT_INT__INT : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DIVIDE__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { override val signature = FnSignature( @@ -162,7 +161,7 @@ internal object Fn_DIVIDE__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__DECIMAL_ARBITRAR } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DIVIDE__FLOAT32_FLOAT32__FLOAT32 : Fn { override val signature = FnSignature( @@ -183,7 +182,7 @@ internal object Fn_DIVIDE__FLOAT32_FLOAT32__FLOAT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_DIVIDE__FLOAT64_FLOAT64__FLOAT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnEq.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnEq.kt similarity index 92% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnEq.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnEq.kt index 3febb655a6..c339b36d49 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnEq.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnEq.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -28,7 +27,7 @@ import org.partiql.value.boolValue * TODO: The PartiQL Specification needs to clearly define the semantics of MISSING. That being said, this implementation * follows the existing conformance tests and SQL:1999. */ -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EQ__ANY_ANY__BOOL : Fn { private val comparator = PartiQLValue.comparator() diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/exts/FnExists.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnExists.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/exts/FnExists.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnExists.kt index 6d13fcd80e..e59fde2b78 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/exts/FnExists.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnExists.kt @@ -1,7 +1,6 @@ -package org.partiql.spi.connector.sql.exts +package org.partiql.spi.fn.builtins 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.value.BagValue @@ -14,7 +13,7 @@ import org.partiql.value.StructValue import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXISTS__BAG__BOOL : Fn { override val signature = FnSignature( @@ -34,7 +33,7 @@ internal object Fn_EXISTS__BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXISTS__LIST__BOOL : Fn { override val signature = FnSignature( @@ -54,7 +53,7 @@ internal object Fn_EXISTS__LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXISTS__SEXP__BOOL : Fn { override val signature = FnSignature( @@ -74,7 +73,7 @@ internal object Fn_EXISTS__SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXISTS__STRUCT__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnExtract.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnExtract.kt similarity index 89% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnExtract.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnExtract.kt index b1d723c675..def109ed79 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnExtract.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnExtract.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DateValue @@ -25,7 +24,7 @@ import org.partiql.value.int32Value // // Extract Year // -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_YEAR__DATE__INT32 : Fn { override val signature = FnSignature( @@ -44,7 +43,7 @@ internal object Fn_EXTRACT_YEAR__DATE__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_YEAR__TIMESTAMP__INT32 : Fn { override val signature = FnSignature( @@ -66,7 +65,7 @@ internal object Fn_EXTRACT_YEAR__TIMESTAMP__INT32 : Fn { // // Extract Month // -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_MONTH__DATE__INT32 : Fn { override val signature = FnSignature( @@ -85,7 +84,7 @@ internal object Fn_EXTRACT_MONTH__DATE__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_MONTH__TIMESTAMP__INT32 : Fn { override val signature = FnSignature( @@ -108,7 +107,7 @@ internal object Fn_EXTRACT_MONTH__TIMESTAMP__INT32 : Fn { // Extract Day // -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_DAY__DATE__INT32 : Fn { override val signature = FnSignature( @@ -127,7 +126,7 @@ internal object Fn_EXTRACT_DAY__DATE__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_DAY__TIMESTAMP__INT32 : Fn { override val signature = FnSignature( @@ -149,7 +148,7 @@ internal object Fn_EXTRACT_DAY__TIMESTAMP__INT32 : Fn { // // Extract Hour // -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_HOUR__TIME__INT32 : Fn { override val signature = FnSignature( @@ -168,7 +167,7 @@ internal object Fn_EXTRACT_HOUR__TIME__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_HOUR__TIMESTAMP__INT32 : Fn { override val signature = FnSignature( @@ -190,7 +189,7 @@ internal object Fn_EXTRACT_HOUR__TIMESTAMP__INT32 : Fn { // // Extract Minute // -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_MINUTE__TIME__INT32 : Fn { override val signature = FnSignature( @@ -209,7 +208,7 @@ internal object Fn_EXTRACT_MINUTE__TIME__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_MINUTE__TIMESTAMP__INT32 : Fn { override val signature = FnSignature( @@ -231,7 +230,7 @@ internal object Fn_EXTRACT_MINUTE__TIMESTAMP__INT32 : Fn { // // Extract Second // -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_SECOND__TIME__DECIMAL_ARBITRARY : Fn { override val signature = FnSignature( @@ -250,7 +249,7 @@ internal object Fn_EXTRACT_SECOND__TIME__DECIMAL_ARBITRARY : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_SECOND__TIMESTAMP__DECIMAL_ARBITRARY : Fn { override val signature = FnSignature( @@ -272,7 +271,7 @@ internal object Fn_EXTRACT_SECOND__TIMESTAMP__DECIMAL_ARBITRARY : Fn { // // Extract Timezone Hour // -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_TIMEZONE_HOUR__TIME__INT32 : Fn { override val signature = FnSignature( @@ -295,7 +294,7 @@ internal object Fn_EXTRACT_TIMEZONE_HOUR__TIME__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_TIMEZONE_HOUR__TIMESTAMP__INT32 : Fn { override val signature = FnSignature( @@ -321,7 +320,7 @@ internal object Fn_EXTRACT_TIMEZONE_HOUR__TIMESTAMP__INT32 : Fn { // // Extract Timezone Minute // -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_TIMEZONE_MINUTE__TIME__INT32 : Fn { override val signature = FnSignature( @@ -344,7 +343,7 @@ internal object Fn_EXTRACT_TIMEZONE_MINUTE__TIME__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_EXTRACT_TIMEZONE_MINUTE__TIMESTAMP__INT32 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnGt.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnGt.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnGt.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnGt.kt index 983f19a7a6..7f464176a0 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnGt.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnGt.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BoolValue @@ -40,7 +39,7 @@ import org.partiql.value.TimestampValue import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__INT8_INT8__BOOL : Fn { override val signature = FnSignature( @@ -61,7 +60,7 @@ internal object Fn_GT__INT8_INT8__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__INT16_INT16__BOOL : Fn { override val signature = FnSignature( @@ -82,7 +81,7 @@ internal object Fn_GT__INT16_INT16__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__INT32_INT32__BOOL : Fn { override val signature = FnSignature( @@ -103,7 +102,7 @@ internal object Fn_GT__INT32_INT32__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__INT64_INT64__BOOL : Fn { override val signature = FnSignature( @@ -124,7 +123,7 @@ internal object Fn_GT__INT64_INT64__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__INT_INT__BOOL : Fn { override val signature = FnSignature( @@ -145,7 +144,7 @@ internal object Fn_GT__INT_INT__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__BOOL : Fn { override val signature = FnSignature( @@ -166,7 +165,7 @@ internal object Fn_GT__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__FLOAT32_FLOAT32__BOOL : Fn { override val signature = FnSignature( @@ -187,7 +186,7 @@ internal object Fn_GT__FLOAT32_FLOAT32__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__FLOAT64_FLOAT64__BOOL : Fn { override val signature = FnSignature( @@ -208,7 +207,7 @@ internal object Fn_GT__FLOAT64_FLOAT64__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__STRING_STRING__BOOL : Fn { override val signature = FnSignature( @@ -229,7 +228,7 @@ internal object Fn_GT__STRING_STRING__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__SYMBOL_SYMBOL__BOOL : Fn { override val signature = FnSignature( @@ -250,7 +249,7 @@ internal object Fn_GT__SYMBOL_SYMBOL__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__DATE_DATE__BOOL : Fn { override val signature = FnSignature( @@ -271,7 +270,7 @@ internal object Fn_GT__DATE_DATE__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__TIME_TIME__BOOL : Fn { override val signature = FnSignature( @@ -292,7 +291,7 @@ internal object Fn_GT__TIME_TIME__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__TIMESTAMP_TIMESTAMP__BOOL : Fn { override val signature = FnSignature( @@ -313,7 +312,7 @@ internal object Fn_GT__TIMESTAMP_TIMESTAMP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GT__BOOL_BOOL__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnGte.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnGte.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnGte.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnGte.kt index 3148b3d3da..376e94e0eb 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnGte.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnGte.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BoolValue @@ -40,7 +39,7 @@ import org.partiql.value.TimestampValue import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__INT8_INT8__BOOL : Fn { override val signature = FnSignature( @@ -61,7 +60,7 @@ internal object Fn_GTE__INT8_INT8__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__INT16_INT16__BOOL : Fn { override val signature = FnSignature( @@ -82,7 +81,7 @@ internal object Fn_GTE__INT16_INT16__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__INT32_INT32__BOOL : Fn { override val signature = FnSignature( @@ -103,7 +102,7 @@ internal object Fn_GTE__INT32_INT32__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__INT64_INT64__BOOL : Fn { override val signature = FnSignature( @@ -124,7 +123,7 @@ internal object Fn_GTE__INT64_INT64__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__INT_INT__BOOL : Fn { override val signature = FnSignature( @@ -145,7 +144,7 @@ internal object Fn_GTE__INT_INT__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__BOOL : Fn { override val signature = FnSignature( @@ -166,7 +165,7 @@ internal object Fn_GTE__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__FLOAT32_FLOAT32__BOOL : Fn { override val signature = FnSignature( @@ -187,7 +186,7 @@ internal object Fn_GTE__FLOAT32_FLOAT32__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__FLOAT64_FLOAT64__BOOL : Fn { override val signature = FnSignature( @@ -208,7 +207,7 @@ internal object Fn_GTE__FLOAT64_FLOAT64__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__STRING_STRING__BOOL : Fn { override val signature = FnSignature( @@ -229,7 +228,7 @@ internal object Fn_GTE__STRING_STRING__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__SYMBOL_SYMBOL__BOOL : Fn { override val signature = FnSignature( @@ -250,7 +249,7 @@ internal object Fn_GTE__SYMBOL_SYMBOL__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__DATE_DATE__BOOL : Fn { override val signature = FnSignature( @@ -271,7 +270,7 @@ internal object Fn_GTE__DATE_DATE__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__TIME_TIME__BOOL : Fn { override val signature = FnSignature( @@ -292,7 +291,7 @@ internal object Fn_GTE__TIME_TIME__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__TIMESTAMP_TIMESTAMP__BOOL : Fn { override val signature = FnSignature( @@ -313,7 +312,7 @@ internal object Fn_GTE__TIMESTAMP_TIMESTAMP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_GTE__BOOL_BOOL__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnInCollection.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnInCollection.kt similarity index 92% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnInCollection.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnInCollection.kt index 40452eb68b..c179f2bff5 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnInCollection.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnInCollection.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BagValue @@ -62,7 +61,7 @@ import org.partiql.value.TimestampValue import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__ANY_BAG__BOOL : Fn { override val signature = FnSignature( @@ -90,7 +89,7 @@ internal object Fn_IN_COLLECTION__ANY_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__ANY_LIST__BOOL : Fn { override val signature = FnSignature( @@ -118,7 +117,7 @@ internal object Fn_IN_COLLECTION__ANY_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__ANY_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -146,7 +145,7 @@ internal object Fn_IN_COLLECTION__ANY_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BOOL_BAG__BOOL : Fn { override val signature = FnSignature( @@ -174,7 +173,7 @@ internal object Fn_IN_COLLECTION__BOOL_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BOOL_LIST__BOOL : Fn { override val signature = FnSignature( @@ -202,7 +201,7 @@ internal object Fn_IN_COLLECTION__BOOL_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BOOL_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -230,7 +229,7 @@ internal object Fn_IN_COLLECTION__BOOL_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT8_BAG__BOOL : Fn { override val signature = FnSignature( @@ -258,7 +257,7 @@ internal object Fn_IN_COLLECTION__INT8_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT8_LIST__BOOL : Fn { override val signature = FnSignature( @@ -286,7 +285,7 @@ internal object Fn_IN_COLLECTION__INT8_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT8_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -314,7 +313,7 @@ internal object Fn_IN_COLLECTION__INT8_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT16_BAG__BOOL : Fn { override val signature = FnSignature( @@ -342,7 +341,7 @@ internal object Fn_IN_COLLECTION__INT16_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT16_LIST__BOOL : Fn { override val signature = FnSignature( @@ -370,7 +369,7 @@ internal object Fn_IN_COLLECTION__INT16_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT16_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -398,7 +397,7 @@ internal object Fn_IN_COLLECTION__INT16_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT32_BAG__BOOL : Fn { override val signature = FnSignature( @@ -426,7 +425,7 @@ internal object Fn_IN_COLLECTION__INT32_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT32_LIST__BOOL : Fn { override val signature = FnSignature( @@ -454,7 +453,7 @@ internal object Fn_IN_COLLECTION__INT32_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT32_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -482,7 +481,7 @@ internal object Fn_IN_COLLECTION__INT32_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT64_BAG__BOOL : Fn { override val signature = FnSignature( @@ -510,7 +509,7 @@ internal object Fn_IN_COLLECTION__INT64_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT64_LIST__BOOL : Fn { override val signature = FnSignature( @@ -538,7 +537,7 @@ internal object Fn_IN_COLLECTION__INT64_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT64_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -566,7 +565,7 @@ internal object Fn_IN_COLLECTION__INT64_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT_BAG__BOOL : Fn { override val signature = FnSignature( @@ -594,7 +593,7 @@ internal object Fn_IN_COLLECTION__INT_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT_LIST__BOOL : Fn { override val signature = FnSignature( @@ -622,7 +621,7 @@ internal object Fn_IN_COLLECTION__INT_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INT_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -650,7 +649,7 @@ internal object Fn_IN_COLLECTION__INT_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__DECIMAL_BAG__BOOL : Fn { override val signature = FnSignature( @@ -678,7 +677,7 @@ internal object Fn_IN_COLLECTION__DECIMAL_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__DECIMAL_LIST__BOOL : Fn { override val signature = FnSignature( @@ -706,7 +705,7 @@ internal object Fn_IN_COLLECTION__DECIMAL_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__DECIMAL_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -734,7 +733,7 @@ internal object Fn_IN_COLLECTION__DECIMAL_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__DECIMAL_ARBITRARY_BAG__BOOL : Fn { override val signature = FnSignature( @@ -762,7 +761,7 @@ internal object Fn_IN_COLLECTION__DECIMAL_ARBITRARY_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__DECIMAL_ARBITRARY_LIST__BOOL : Fn { override val signature = FnSignature( @@ -790,7 +789,7 @@ internal object Fn_IN_COLLECTION__DECIMAL_ARBITRARY_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__DECIMAL_ARBITRARY_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -818,7 +817,7 @@ internal object Fn_IN_COLLECTION__DECIMAL_ARBITRARY_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__FLOAT32_BAG__BOOL : Fn { override val signature = FnSignature( @@ -846,7 +845,7 @@ internal object Fn_IN_COLLECTION__FLOAT32_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__FLOAT32_LIST__BOOL : Fn { override val signature = FnSignature( @@ -874,7 +873,7 @@ internal object Fn_IN_COLLECTION__FLOAT32_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__FLOAT32_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -902,7 +901,7 @@ internal object Fn_IN_COLLECTION__FLOAT32_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__FLOAT64_BAG__BOOL : Fn { override val signature = FnSignature( @@ -930,7 +929,7 @@ internal object Fn_IN_COLLECTION__FLOAT64_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__FLOAT64_LIST__BOOL : Fn { override val signature = FnSignature( @@ -958,7 +957,7 @@ internal object Fn_IN_COLLECTION__FLOAT64_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__FLOAT64_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -986,7 +985,7 @@ internal object Fn_IN_COLLECTION__FLOAT64_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__CHAR_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1014,7 +1013,7 @@ internal object Fn_IN_COLLECTION__CHAR_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__CHAR_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1042,7 +1041,7 @@ internal object Fn_IN_COLLECTION__CHAR_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__CHAR_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1070,7 +1069,7 @@ internal object Fn_IN_COLLECTION__CHAR_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__STRING_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1098,7 +1097,7 @@ internal object Fn_IN_COLLECTION__STRING_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__STRING_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1126,7 +1125,7 @@ internal object Fn_IN_COLLECTION__STRING_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__STRING_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1154,7 +1153,7 @@ internal object Fn_IN_COLLECTION__STRING_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__SYMBOL_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1182,7 +1181,7 @@ internal object Fn_IN_COLLECTION__SYMBOL_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__SYMBOL_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1210,7 +1209,7 @@ internal object Fn_IN_COLLECTION__SYMBOL_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__SYMBOL_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1238,7 +1237,7 @@ internal object Fn_IN_COLLECTION__SYMBOL_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BINARY_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1266,7 +1265,7 @@ internal object Fn_IN_COLLECTION__BINARY_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BINARY_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1294,7 +1293,7 @@ internal object Fn_IN_COLLECTION__BINARY_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BINARY_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1322,7 +1321,7 @@ internal object Fn_IN_COLLECTION__BINARY_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BYTE_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1350,7 +1349,7 @@ internal object Fn_IN_COLLECTION__BYTE_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BYTE_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1378,7 +1377,7 @@ internal object Fn_IN_COLLECTION__BYTE_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BYTE_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1406,7 +1405,7 @@ internal object Fn_IN_COLLECTION__BYTE_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BLOB_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1434,7 +1433,7 @@ internal object Fn_IN_COLLECTION__BLOB_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BLOB_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1462,7 +1461,7 @@ internal object Fn_IN_COLLECTION__BLOB_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BLOB_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1490,7 +1489,7 @@ internal object Fn_IN_COLLECTION__BLOB_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__CLOB_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1518,7 +1517,7 @@ internal object Fn_IN_COLLECTION__CLOB_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__CLOB_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1546,7 +1545,7 @@ internal object Fn_IN_COLLECTION__CLOB_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__CLOB_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1574,7 +1573,7 @@ internal object Fn_IN_COLLECTION__CLOB_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__DATE_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1602,7 +1601,7 @@ internal object Fn_IN_COLLECTION__DATE_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__DATE_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1630,7 +1629,7 @@ internal object Fn_IN_COLLECTION__DATE_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__DATE_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1658,7 +1657,7 @@ internal object Fn_IN_COLLECTION__DATE_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__TIME_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1686,7 +1685,7 @@ internal object Fn_IN_COLLECTION__TIME_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__TIME_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1714,7 +1713,7 @@ internal object Fn_IN_COLLECTION__TIME_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__TIME_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1742,7 +1741,7 @@ internal object Fn_IN_COLLECTION__TIME_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__TIMESTAMP_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1770,7 +1769,7 @@ internal object Fn_IN_COLLECTION__TIMESTAMP_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__TIMESTAMP_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1798,7 +1797,7 @@ internal object Fn_IN_COLLECTION__TIMESTAMP_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__TIMESTAMP_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1826,7 +1825,7 @@ internal object Fn_IN_COLLECTION__TIMESTAMP_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INTERVAL_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1854,7 +1853,7 @@ internal object Fn_IN_COLLECTION__INTERVAL_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INTERVAL_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1882,7 +1881,7 @@ internal object Fn_IN_COLLECTION__INTERVAL_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__INTERVAL_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1910,7 +1909,7 @@ internal object Fn_IN_COLLECTION__INTERVAL_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BAG_BAG__BOOL : Fn { override val signature = FnSignature( @@ -1938,7 +1937,7 @@ internal object Fn_IN_COLLECTION__BAG_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BAG_LIST__BOOL : Fn { override val signature = FnSignature( @@ -1966,7 +1965,7 @@ internal object Fn_IN_COLLECTION__BAG_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__BAG_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -1994,7 +1993,7 @@ internal object Fn_IN_COLLECTION__BAG_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__LIST_BAG__BOOL : Fn { override val signature = FnSignature( @@ -2022,7 +2021,7 @@ internal object Fn_IN_COLLECTION__LIST_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__LIST_LIST__BOOL : Fn { override val signature = FnSignature( @@ -2050,7 +2049,7 @@ internal object Fn_IN_COLLECTION__LIST_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__LIST_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -2078,7 +2077,7 @@ internal object Fn_IN_COLLECTION__LIST_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__SEXP_BAG__BOOL : Fn { override val signature = FnSignature( @@ -2106,7 +2105,7 @@ internal object Fn_IN_COLLECTION__SEXP_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__SEXP_LIST__BOOL : Fn { override val signature = FnSignature( @@ -2134,7 +2133,7 @@ internal object Fn_IN_COLLECTION__SEXP_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__SEXP_SEXP__BOOL : Fn { override val signature = FnSignature( @@ -2162,7 +2161,7 @@ internal object Fn_IN_COLLECTION__SEXP_SEXP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__STRUCT_BAG__BOOL : Fn { override val signature = FnSignature( @@ -2190,7 +2189,7 @@ internal object Fn_IN_COLLECTION__STRUCT_BAG__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__STRUCT_LIST__BOOL : Fn { override val signature = FnSignature( @@ -2218,7 +2217,7 @@ internal object Fn_IN_COLLECTION__STRUCT_LIST__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IN_COLLECTION__STRUCT_SEXP__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsAny.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsAny.kt similarity index 82% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsAny.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsAny.kt index ce632c819e..15be81a955 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsAny.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsAny.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -12,7 +11,7 @@ import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_ANY__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBag.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBag.kt similarity index 83% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBag.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBag.kt index d3260269a1..e97c2d74dc 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBag.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBag.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BagValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_BAG__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBinary.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBinary.kt similarity index 84% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBinary.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBinary.kt index 8f8e1e106e..a99bf1f2cf 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBinary.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBinary.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BinaryValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_BINARY__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBlob.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBlob.kt similarity index 83% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBlob.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBlob.kt index ae4dfbf1b1..2c23dcd65c 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBlob.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBlob.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BlobValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_BLOB__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBool.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBool.kt similarity index 83% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBool.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBool.kt index c2074ced2a..20e4afeb5b 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsBool.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsBool.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BoolValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_BOOL__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsByte.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsByte.kt similarity index 83% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsByte.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsByte.kt index a6d6b7722c..921b78b9e9 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsByte.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsByte.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.ByteValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_BYTE__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsChar.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsChar.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsChar.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsChar.kt index 9b1c812811..45bf98a570 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsChar.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsChar.kt @@ -1,11 +1,10 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.errors.TypeCheckException 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.value.CharValue @@ -19,7 +18,7 @@ import org.partiql.value.StringValue import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_CHAR__ANY__BOOL : Fn { override val signature = FnSignature( @@ -35,7 +34,7 @@ internal object Fn_IS_CHAR__ANY__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_CHAR__INT32_ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsClob.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsClob.kt similarity index 83% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsClob.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsClob.kt index 256e54f84f..68c9d5291a 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsClob.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsClob.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.ClobValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_CLOB__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsDate.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsDate.kt similarity index 83% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsDate.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsDate.kt index 903751f694..de08a97fdc 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsDate.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsDate.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DateValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_DATE__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsDecimal.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsDecimal.kt similarity index 92% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsDecimal.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsDecimal.kt index d639d3be9f..4ef0008ec1 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsDecimal.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsDecimal.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DecimalValue @@ -19,7 +18,7 @@ import org.partiql.value.check import java.math.RoundingMode import kotlin.math.max -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_DECIMAL__ANY__BOOL : Fn { override val signature = FnSignature( @@ -35,7 +34,7 @@ internal object Fn_IS_DECIMAL__ANY__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_DECIMAL__INT32_INT32_ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsDecimalArbitrary.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsDecimalArbitrary.kt similarity index 84% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsDecimalArbitrary.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsDecimalArbitrary.kt index 547b0b1fbb..73455102e2 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsDecimalArbitrary.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsDecimalArbitrary.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DecimalValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_DECIMAL_ARBITRARY__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsFloat32.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsFloat32.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsFloat32.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsFloat32.kt index 4dce429b7a..69f17ebc3d 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsFloat32.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsFloat32.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.Float32Value @@ -15,7 +14,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_FLOAT32__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsFloat64.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsFloat64.kt similarity index 86% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsFloat64.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsFloat64.kt index 945ca5b622..a0226961bb 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsFloat64.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsFloat64.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.Float32Value @@ -15,7 +14,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_FLOAT64__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt.kt index 51fa4d7f20..ed34ffd649 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.Int16Value @@ -18,7 +17,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_INT__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt16.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt16.kt similarity index 91% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt16.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt16.kt index 153e54f9a1..796cb03b16 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt16.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt16.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.Int16Value @@ -18,7 +17,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_INT16__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt32.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt32.kt similarity index 91% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt32.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt32.kt index 996ff9f067..82220a6164 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt32.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt32.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.Int16Value @@ -18,7 +17,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_INT32__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt64.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt64.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt64.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt64.kt index 838f1b55a1..5d00e38881 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt64.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt64.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.Int16Value @@ -18,7 +17,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_INT64__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt8.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt8.kt similarity index 92% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt8.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt8.kt index f8d1a4285d..4e78e001d0 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInt8.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInt8.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.Int16Value @@ -18,7 +17,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_INT8__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInterval.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInterval.kt similarity index 84% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInterval.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInterval.kt index 95022392f5..1951e16c85 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsInterval.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsInterval.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.IntervalValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_INTERVAL__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsList.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsList.kt similarity index 84% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsList.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsList.kt index 31fa7c2d33..8dda6985c8 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsList.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsList.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.ListValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_LIST__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsMissing.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsMissing.kt similarity index 85% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsMissing.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsMissing.kt index e0d25570dd..2eb127811e 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsMissing.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsMissing.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.MissingValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_MISSING__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsNull.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsNull.kt similarity index 86% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsNull.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsNull.kt index 671364bb3a..a2469405dd 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsNull.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsNull.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.PartiQLValueType.MISSING import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_NULL__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsSexp.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsSexp.kt similarity index 84% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsSexp.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsSexp.kt index c96962c71d..fb73459635 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsSexp.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsSexp.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.SexpValue import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_SEXP__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsString.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsString.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsString.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsString.kt index 8470dbbdca..5dc76bdb36 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsString.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsString.kt @@ -1,11 +1,10 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.errors.TypeCheckException 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.value.Int32Value @@ -18,7 +17,7 @@ import org.partiql.value.StringValue import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_STRING__ANY__BOOL : Fn { override val signature = FnSignature( @@ -34,7 +33,7 @@ internal object Fn_IS_STRING__ANY__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_STRING__INT32_ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsStruct.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsStruct.kt similarity index 84% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsStruct.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsStruct.kt index 998bd2a123..f82b82f131 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsStruct.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsStruct.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.StructValue import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_STRUCT__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsSymbol.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsSymbol.kt similarity index 84% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsSymbol.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsSymbol.kt index 231e3dddaa..ea506a8d3a 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsSymbol.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsSymbol.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.SymbolValue import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_SYMBOL__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsTime.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsTime.kt similarity index 86% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsTime.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsTime.kt index 7308e5b2f6..a1787ef20c 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsTime.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsTime.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -15,7 +14,7 @@ import org.partiql.value.PartiQLValueType.INT32 import org.partiql.value.TimeValue import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_TIME__ANY__BOOL : Fn { override val signature = FnSignature( @@ -31,7 +30,7 @@ internal object Fn_IS_TIME__ANY__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_TIME__BOOL_INT32_ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsTimestamp.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsTimestamp.kt similarity index 86% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsTimestamp.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsTimestamp.kt index 932d6667c5..fc9711808d 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnIsTimestamp.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnIsTimestamp.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -15,7 +14,7 @@ import org.partiql.value.PartiQLValueType.INT32 import org.partiql.value.TimestampValue import org.partiql.value.boolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_TIMESTAMP__ANY__BOOL : Fn { override val signature = FnSignature( @@ -31,7 +30,7 @@ internal object Fn_IS_TIMESTAMP__ANY__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_IS_TIMESTAMP__BOOL_INT32_ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLike.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLike.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLike.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLike.kt index 3a73855a8e..f25dbcfaaf 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLike.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLike.kt @@ -1,14 +1,13 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.utils.PatternUtils.matchRegexPattern -import org.partiql.spi.connector.sql.utils.PatternUtils.parsePattern 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.spi.fn.utils.PatternUtils.matchRegexPattern +import org.partiql.spi.fn.utils.PatternUtils.parsePattern import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -21,7 +20,7 @@ import org.partiql.value.boolValue import org.partiql.value.check import java.util.regex.Pattern -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LIKE__STRING_STRING__BOOL : Fn { override val signature = FnSignature( @@ -49,7 +48,7 @@ internal object Fn_LIKE__STRING_STRING__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LIKE__SYMBOL_SYMBOL__BOOL : Fn { override val signature = FnSignature( @@ -77,7 +76,7 @@ internal object Fn_LIKE__SYMBOL_SYMBOL__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LIKE__CLOB_CLOB__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLikeEscape.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLikeEscape.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLikeEscape.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLikeEscape.kt index 6c1a86e28e..da0fd57b63 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLikeEscape.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLikeEscape.kt @@ -1,16 +1,15 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.errors.TypeCheckException -import org.partiql.spi.connector.sql.utils.PatternUtils -import org.partiql.spi.connector.sql.utils.PatternUtils.checkPattern -import org.partiql.spi.connector.sql.utils.PatternUtils.parsePattern 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.spi.fn.utils.PatternUtils +import org.partiql.spi.fn.utils.PatternUtils.checkPattern +import org.partiql.spi.fn.utils.PatternUtils.parsePattern import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -23,7 +22,7 @@ import org.partiql.value.boolValue import org.partiql.value.check import java.util.regex.Pattern -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LIKE_ESCAPE__STRING_STRING_STRING__BOOL : Fn { override val signature = FnSignature( @@ -59,7 +58,7 @@ internal object Fn_LIKE_ESCAPE__STRING_STRING_STRING__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LIKE_ESCAPE__SYMBOL_SYMBOL_SYMBOL__BOOL : Fn { override val signature = FnSignature( @@ -95,7 +94,7 @@ internal object Fn_LIKE_ESCAPE__SYMBOL_SYMBOL_SYMBOL__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LIKE_ESCAPE__CLOB_CLOB_CLOB__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLower.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLower.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLower.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLower.kt index c3ba2d4c01..e8f7c82d7a 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLower.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLower.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -16,7 +15,7 @@ import org.partiql.value.StringValue import org.partiql.value.check import org.partiql.value.stringValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LOWER__STRING__STRING : Fn { override val signature = FnSignature( @@ -34,7 +33,7 @@ internal object Fn_LOWER__STRING__STRING : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LOWER__SYMBOL__SYMBOL : Fn { override val signature = FnSignature( @@ -52,7 +51,7 @@ internal object Fn_LOWER__SYMBOL__SYMBOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LOWER__CLOB__CLOB : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLt.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLt.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLt.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLt.kt index 688c33f03b..70a831f360 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLt.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLt.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BoolValue @@ -40,7 +39,7 @@ import org.partiql.value.TimestampValue import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__INT8_INT8__BOOL : Fn { override val signature = FnSignature( @@ -61,7 +60,7 @@ internal object Fn_LT__INT8_INT8__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__INT16_INT16__BOOL : Fn { override val signature = FnSignature( @@ -82,7 +81,7 @@ internal object Fn_LT__INT16_INT16__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__INT32_INT32__BOOL : Fn { override val signature = FnSignature( @@ -103,7 +102,7 @@ internal object Fn_LT__INT32_INT32__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__INT64_INT64__BOOL : Fn { override val signature = FnSignature( @@ -124,7 +123,7 @@ internal object Fn_LT__INT64_INT64__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__INT_INT__BOOL : Fn { override val signature = FnSignature( @@ -145,7 +144,7 @@ internal object Fn_LT__INT_INT__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__BOOL : Fn { override val signature = FnSignature( @@ -166,7 +165,7 @@ internal object Fn_LT__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__FLOAT32_FLOAT32__BOOL : Fn { override val signature = FnSignature( @@ -187,7 +186,7 @@ internal object Fn_LT__FLOAT32_FLOAT32__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__FLOAT64_FLOAT64__BOOL : Fn { override val signature = FnSignature( @@ -208,7 +207,7 @@ internal object Fn_LT__FLOAT64_FLOAT64__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__STRING_STRING__BOOL : Fn { override val signature = FnSignature( @@ -229,7 +228,7 @@ internal object Fn_LT__STRING_STRING__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__SYMBOL_SYMBOL__BOOL : Fn { override val signature = FnSignature( @@ -250,7 +249,7 @@ internal object Fn_LT__SYMBOL_SYMBOL__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__DATE_DATE__BOOL : Fn { override val signature = FnSignature( @@ -271,7 +270,7 @@ internal object Fn_LT__DATE_DATE__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__TIME_TIME__BOOL : Fn { override val signature = FnSignature( @@ -292,7 +291,7 @@ internal object Fn_LT__TIME_TIME__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__TIMESTAMP_TIMESTAMP__BOOL : Fn { override val signature = FnSignature( @@ -313,7 +312,7 @@ internal object Fn_LT__TIMESTAMP_TIMESTAMP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LT__BOOL_BOOL__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLte.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLte.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLte.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLte.kt index 820e256643..d1047f63bf 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnLte.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnLte.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BoolValue @@ -40,7 +39,7 @@ import org.partiql.value.TimestampValue import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__INT8_INT8__BOOL : Fn { override val signature = FnSignature( @@ -61,7 +60,7 @@ internal object Fn_LTE__INT8_INT8__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__INT16_INT16__BOOL : Fn { override val signature = FnSignature( @@ -82,7 +81,7 @@ internal object Fn_LTE__INT16_INT16__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__INT32_INT32__BOOL : Fn { override val signature = FnSignature( @@ -103,7 +102,7 @@ internal object Fn_LTE__INT32_INT32__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__INT64_INT64__BOOL : Fn { override val signature = FnSignature( @@ -124,7 +123,7 @@ internal object Fn_LTE__INT64_INT64__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__INT_INT__BOOL : Fn { override val signature = FnSignature( @@ -145,7 +144,7 @@ internal object Fn_LTE__INT_INT__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__BOOL : Fn { override val signature = FnSignature( @@ -166,7 +165,7 @@ internal object Fn_LTE__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__FLOAT32_FLOAT32__BOOL : Fn { override val signature = FnSignature( @@ -187,7 +186,7 @@ internal object Fn_LTE__FLOAT32_FLOAT32__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__FLOAT64_FLOAT64__BOOL : Fn { override val signature = FnSignature( @@ -208,7 +207,7 @@ internal object Fn_LTE__FLOAT64_FLOAT64__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__STRING_STRING__BOOL : Fn { override val signature = FnSignature( @@ -229,7 +228,7 @@ internal object Fn_LTE__STRING_STRING__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__SYMBOL_SYMBOL__BOOL : Fn { override val signature = FnSignature( @@ -250,7 +249,7 @@ internal object Fn_LTE__SYMBOL_SYMBOL__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__DATE_DATE__BOOL : Fn { override val signature = FnSignature( @@ -271,7 +270,7 @@ internal object Fn_LTE__DATE_DATE__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__TIME_TIME__BOOL : Fn { override val signature = FnSignature( @@ -292,7 +291,7 @@ internal object Fn_LTE__TIME_TIME__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__TIMESTAMP_TIMESTAMP__BOOL : Fn { override val signature = FnSignature( @@ -313,7 +312,7 @@ internal object Fn_LTE__TIMESTAMP_TIMESTAMP__BOOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_LTE__BOOL_BOOL__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnMinus.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnMinus.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnMinus.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnMinus.kt index 4cfdc8dfb9..d3511c93f4 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnMinus.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnMinus.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DecimalValue @@ -36,7 +35,7 @@ import org.partiql.value.int8Value import org.partiql.value.intValue // TODO: Handle Overflow -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MINUS__INT8_INT8__INT8 : Fn { override val signature = FnSignature( @@ -57,7 +56,7 @@ internal object Fn_MINUS__INT8_INT8__INT8 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MINUS__INT16_INT16__INT16 : Fn { override val signature = FnSignature( @@ -78,7 +77,7 @@ internal object Fn_MINUS__INT16_INT16__INT16 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MINUS__INT32_INT32__INT32 : Fn { override val signature = FnSignature( @@ -99,7 +98,7 @@ internal object Fn_MINUS__INT32_INT32__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MINUS__INT64_INT64__INT64 : Fn { override val signature = FnSignature( @@ -120,7 +119,7 @@ internal object Fn_MINUS__INT64_INT64__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MINUS__INT_INT__INT : Fn { override val signature = FnSignature( @@ -141,7 +140,7 @@ internal object Fn_MINUS__INT_INT__INT : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MINUS__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { override val signature = FnSignature( @@ -162,7 +161,7 @@ internal object Fn_MINUS__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__DECIMAL_ARBITRARY } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MINUS__FLOAT32_FLOAT32__FLOAT32 : Fn { override val signature = FnSignature( @@ -183,7 +182,7 @@ internal object Fn_MINUS__FLOAT32_FLOAT32__FLOAT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MINUS__FLOAT64_FLOAT64__FLOAT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnModulo.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnModulo.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnModulo.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnModulo.kt index 6a8bdb6965..f16af45026 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnModulo.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnModulo.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DecimalValue @@ -37,7 +36,7 @@ import org.partiql.value.intValue // TODO: Thore are untested and may be wrong. Java's mod operation does not match SQL's. -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MODULO__INT8_INT8__INT8 : Fn { override val signature = FnSignature( @@ -58,7 +57,7 @@ internal object Fn_MODULO__INT8_INT8__INT8 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MODULO__INT16_INT16__INT16 : Fn { override val signature = FnSignature( @@ -79,7 +78,7 @@ internal object Fn_MODULO__INT16_INT16__INT16 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MODULO__INT32_INT32__INT32 : Fn { override val signature = FnSignature( @@ -100,7 +99,7 @@ internal object Fn_MODULO__INT32_INT32__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MODULO__INT64_INT64__INT64 : Fn { override val signature = FnSignature( @@ -121,7 +120,7 @@ internal object Fn_MODULO__INT64_INT64__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MODULO__INT_INT__INT : Fn { override val signature = FnSignature( @@ -142,7 +141,7 @@ internal object Fn_MODULO__INT_INT__INT : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MODULO__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { override val signature = FnSignature( @@ -163,7 +162,7 @@ internal object Fn_MODULO__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__DECIMAL_ARBITRAR } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MODULO__FLOAT32_FLOAT32__FLOAT32 : Fn { override val signature = FnSignature( @@ -184,7 +183,7 @@ internal object Fn_MODULO__FLOAT32_FLOAT32__FLOAT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_MODULO__FLOAT64_FLOAT64__FLOAT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnNeg.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnNeg.kt similarity index 89% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnNeg.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnNeg.kt index 12f0593b5d..3c753d140c 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnNeg.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnNeg.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DecimalValue @@ -36,7 +35,7 @@ import org.partiql.value.int8Value import org.partiql.value.intValue // TODO: Handle Overflow -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_NEG__INT8__INT8 : Fn { override val signature = FnSignature( @@ -53,7 +52,7 @@ internal object Fn_NEG__INT8__INT8 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_NEG__INT16__INT16 : Fn { override val signature = FnSignature( @@ -70,7 +69,7 @@ internal object Fn_NEG__INT16__INT16 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_NEG__INT32__INT32 : Fn { override val signature = FnSignature( @@ -87,7 +86,7 @@ internal object Fn_NEG__INT32__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_NEG__INT64__INT64 : Fn { override val signature = FnSignature( @@ -104,7 +103,7 @@ internal object Fn_NEG__INT64__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_NEG__INT__INT : Fn { override val signature = FnSignature( @@ -121,7 +120,7 @@ internal object Fn_NEG__INT__INT : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_NEG__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { override val signature = FnSignature( @@ -138,7 +137,7 @@ internal object Fn_NEG__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_NEG__FLOAT32__FLOAT32 : Fn { override val signature = FnSignature( @@ -155,7 +154,7 @@ internal object Fn_NEG__FLOAT32__FLOAT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_NEG__FLOAT64__FLOAT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnNot.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnNot.kt similarity index 85% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnNot.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnNot.kt index 935857e927..62ee94fc01 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnNot.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnNot.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BoolValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_NOT__BOOL__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnOctetLength.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnOctetLength.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnOctetLength.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnOctetLength.kt index 75d7953806..ed55d75943 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnOctetLength.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnOctetLength.kt @@ -1,7 +1,6 @@ -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.ClobValue @@ -13,7 +12,7 @@ import org.partiql.value.StringValue import org.partiql.value.check import org.partiql.value.int32Value -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_OCTET_LENGTH__STRING__INT32 : Fn { override val signature = FnSignature( @@ -33,7 +32,7 @@ internal object Fn_OCTET_LENGTH__STRING__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_OCTET_LENGTH__SYMBOL__INT32 : Fn { override val signature = FnSignature( @@ -53,7 +52,7 @@ internal object Fn_OCTET_LENGTH__SYMBOL__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_OCTET_LENGTH__CLOB__INT32 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnOr.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnOr.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnOr.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnOr.kt index 4444d08bcf..d839e2c004 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnOr.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnOr.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.BoolValue @@ -14,7 +13,7 @@ import org.partiql.value.PartiQLValueType.BOOL import org.partiql.value.boolValue import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_OR__BOOL_BOOL__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnPlus.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnPlus.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnPlus.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnPlus.kt index 45666ce7aa..4fdaf03772 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnPlus.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnPlus.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DecimalValue @@ -36,7 +35,7 @@ import org.partiql.value.int8Value import org.partiql.value.intValue // TODO: Handle Overflow -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_PLUS__INT8_INT8__INT8 : Fn { override val signature = FnSignature( @@ -57,7 +56,7 @@ internal object Fn_PLUS__INT8_INT8__INT8 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_PLUS__INT16_INT16__INT16 : Fn { override val signature = FnSignature( @@ -78,7 +77,7 @@ internal object Fn_PLUS__INT16_INT16__INT16 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_PLUS__INT32_INT32__INT32 : Fn { override val signature = FnSignature( @@ -99,7 +98,7 @@ internal object Fn_PLUS__INT32_INT32__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_PLUS__INT64_INT64__INT64 : Fn { override val signature = FnSignature( @@ -120,7 +119,7 @@ internal object Fn_PLUS__INT64_INT64__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_PLUS__INT_INT__INT : Fn { override val signature = FnSignature( @@ -141,7 +140,7 @@ internal object Fn_PLUS__INT_INT__INT : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_PLUS__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { override val signature = FnSignature( @@ -162,7 +161,7 @@ internal object Fn_PLUS__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__DECIMAL_ARBITRARY } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_PLUS__FLOAT32_FLOAT32__FLOAT32 : Fn { override val signature = FnSignature( @@ -183,7 +182,7 @@ internal object Fn_PLUS__FLOAT32_FLOAT32__FLOAT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_PLUS__FLOAT64_FLOAT64__FLOAT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnPos.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnPos.kt similarity index 85% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnPos.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnPos.kt index 30ce1187cb..7b3974485f 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnPos.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnPos.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.PartiQLValue @@ -18,7 +17,7 @@ import org.partiql.value.PartiQLValueType.INT32 import org.partiql.value.PartiQLValueType.INT64 import org.partiql.value.PartiQLValueType.INT8 -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POS__INT8__INT8 : Fn { override val signature = FnSignature( @@ -34,7 +33,7 @@ internal object Fn_POS__INT8__INT8 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POS__INT16__INT16 : Fn { override val signature = FnSignature( @@ -50,7 +49,7 @@ internal object Fn_POS__INT16__INT16 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POS__INT32__INT32 : Fn { override val signature = FnSignature( @@ -66,7 +65,7 @@ internal object Fn_POS__INT32__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POS__INT64__INT64 : Fn { override val signature = FnSignature( @@ -82,7 +81,7 @@ internal object Fn_POS__INT64__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POS__INT__INT : Fn { override val signature = FnSignature( @@ -98,7 +97,7 @@ internal object Fn_POS__INT__INT : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POS__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { override val signature = FnSignature( @@ -114,7 +113,7 @@ internal object Fn_POS__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POS__FLOAT32__FLOAT32 : Fn { override val signature = FnSignature( @@ -130,7 +129,7 @@ internal object Fn_POS__FLOAT32__FLOAT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POS__FLOAT64__FLOAT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnPosition.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnPosition.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnPosition.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnPosition.kt index 0f6b457254..462ccdc344 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnPosition.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnPosition.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.utils.StringUtils.codepointPosition 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.spi.fn.utils.StringUtils.codepointPosition import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -20,7 +19,7 @@ import org.partiql.value.SymbolValue import org.partiql.value.check import org.partiql.value.int64Value -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POSITION__STRING_STRING__INT64 : Fn { override val signature = FnSignature( @@ -42,7 +41,7 @@ internal object Fn_POSITION__STRING_STRING__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POSITION__SYMBOL_SYMBOL__INT64 : Fn { override val signature = FnSignature( @@ -64,7 +63,7 @@ internal object Fn_POSITION__SYMBOL_SYMBOL__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_POSITION__CLOB_CLOB__INT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/exts/FnSize.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnSize.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/exts/FnSize.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnSize.kt index 368d5d98cd..53895d1f17 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/exts/FnSize.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnSize.kt @@ -1,7 +1,6 @@ -package org.partiql.spi.connector.sql.exts +package org.partiql.spi.fn.builtins 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.value.BagValue @@ -14,7 +13,7 @@ import org.partiql.value.StructValue import org.partiql.value.check import org.partiql.value.int32Value -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_SIZE__BAG__INT32 : Fn { override val signature = FnSignature( @@ -33,7 +32,7 @@ internal object Fn_SIZE__BAG__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_SIZE__LIST__INT32 : Fn { override val signature = FnSignature( @@ -52,7 +51,7 @@ internal object Fn_SIZE__LIST__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_SIZE__SEXP__INT32 : Fn { override val signature = FnSignature( @@ -71,7 +70,7 @@ internal object Fn_SIZE__SEXP__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_SIZE__STRUCT__INT32 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnSubstring.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnSubstring.kt similarity index 78% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnSubstring.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnSubstring.kt index 92c1566626..606c5bddbd 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnSubstring.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnSubstring.kt @@ -1,15 +1,14 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.errors.DataException import org.partiql.errors.TypeCheckException -import org.partiql.spi.connector.sql.utils.StringUtils.codepointSubstring 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.spi.fn.utils.StringUtils.codepointSubstring import org.partiql.value.ClobValue import org.partiql.value.Int64Value import org.partiql.value.PartiQLValue @@ -94,7 +93,7 @@ import org.partiql.value.symbolValue * L1 = E1 - S1 * return java's substring(C, S1, E1) */ -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_SUBSTRING__STRING_INT64__STRING : Fn { override val signature = FnSignature( @@ -110,13 +109,17 @@ internal object Fn_SUBSTRING__STRING_INT64__STRING : Fn { override fun invoke(args: Array): PartiQLValue { val value = args[0].check().string!! - val start = try { args[1].check().toInt32().value!! } catch (e: DataException) { throw TypeCheckException() } + val start = try { + args[1].check().toInt32().value!! + } catch (e: DataException) { + throw TypeCheckException() + } val result = value.codepointSubstring(start) return stringValue(result) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_SUBSTRING__STRING_INT64_INT64__STRING : Fn { override val signature = FnSignature( @@ -133,15 +136,23 @@ internal object Fn_SUBSTRING__STRING_INT64_INT64__STRING : Fn { override fun invoke(args: Array): PartiQLValue { val value = args[0].check().string!! - val start = try { args[1].check().toInt32().value!! } catch (e: DataException) { throw TypeCheckException() } - val end = try { args[2].check().toInt32().value!! } catch (e: DataException) { throw TypeCheckException() } + val start = try { + args[1].check().toInt32().value!! + } catch (e: DataException) { + throw TypeCheckException() + } + val end = try { + args[2].check().toInt32().value!! + } catch (e: DataException) { + throw TypeCheckException() + } if (end < 0) throw TypeCheckException() val result = value.codepointSubstring(start, end) return stringValue(result) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_SUBSTRING__SYMBOL_INT64__SYMBOL : Fn { override val signature = FnSignature( @@ -157,13 +168,17 @@ internal object Fn_SUBSTRING__SYMBOL_INT64__SYMBOL : Fn { override fun invoke(args: Array): PartiQLValue { val value = args[0].check().string!! - val start = try { args[1].check().toInt32().value!! } catch (e: DataException) { throw TypeCheckException() } + val start = try { + args[1].check().toInt32().value!! + } catch (e: DataException) { + throw TypeCheckException() + } val result = value.codepointSubstring(start) return symbolValue(result) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_SUBSTRING__SYMBOL_INT64_INT64__SYMBOL : Fn { override val signature = FnSignature( @@ -180,15 +195,23 @@ internal object Fn_SUBSTRING__SYMBOL_INT64_INT64__SYMBOL : Fn { override fun invoke(args: Array): PartiQLValue { val value = args[0].check().string!! - val start = try { args[1].check().toInt32().value!! } catch (e: DataException) { throw TypeCheckException() } - val end = try { args[2].check().toInt32().value!! } catch (e: DataException) { throw TypeCheckException() } + val start = try { + args[1].check().toInt32().value!! + } catch (e: DataException) { + throw TypeCheckException() + } + val end = try { + args[2].check().toInt32().value!! + } catch (e: DataException) { + throw TypeCheckException() + } if (end < 0) throw TypeCheckException() val result = value.codepointSubstring(start, end) return symbolValue(result) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_SUBSTRING__CLOB_INT64__CLOB : Fn { override val signature = FnSignature( @@ -204,13 +227,17 @@ internal object Fn_SUBSTRING__CLOB_INT64__CLOB : Fn { override fun invoke(args: Array): PartiQLValue { val value = args[0].check().value!!.toString(Charsets.UTF_8) - val start = try { args[1].check().toInt32().value!! } catch (e: DataException) { throw TypeCheckException() } + val start = try { + args[1].check().toInt32().value!! + } catch (e: DataException) { + throw TypeCheckException() + } val result = value.codepointSubstring(start) return clobValue(result.toByteArray()) } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_SUBSTRING__CLOB_INT64_INT64__CLOB : Fn { override val signature = FnSignature( @@ -227,8 +254,16 @@ internal object Fn_SUBSTRING__CLOB_INT64_INT64__CLOB : Fn { override fun invoke(args: Array): PartiQLValue { val string = args[0].check().value!!.toString(Charsets.UTF_8) - val start = try { args[1].check().toInt32().value!! } catch (e: DataException) { throw TypeCheckException() } - val end = try { args[2].check().toInt32().value!! } catch (e: DataException) { throw TypeCheckException() } + val start = try { + args[1].check().toInt32().value!! + } catch (e: DataException) { + throw TypeCheckException() + } + val end = try { + args[2].check().toInt32().value!! + } catch (e: DataException) { + throw TypeCheckException() + } if (end < 0) throw TypeCheckException() val result = string.codepointSubstring(start, end) return clobValue(result.toByteArray()) diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTimes.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTimes.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTimes.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTimes.kt index a4ea9882b6..7540a330fe 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTimes.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTimes.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.DecimalValue @@ -36,7 +35,7 @@ import org.partiql.value.int8Value import org.partiql.value.intValue // TODO: Handle Overflow -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TIMES__INT8_INT8__INT8 : Fn { override val signature = FnSignature( @@ -57,7 +56,7 @@ internal object Fn_TIMES__INT8_INT8__INT8 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TIMES__INT16_INT16__INT16 : Fn { override val signature = FnSignature( @@ -78,7 +77,7 @@ internal object Fn_TIMES__INT16_INT16__INT16 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TIMES__INT32_INT32__INT32 : Fn { override val signature = FnSignature( @@ -99,7 +98,7 @@ internal object Fn_TIMES__INT32_INT32__INT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TIMES__INT64_INT64__INT64 : Fn { override val signature = FnSignature( @@ -120,7 +119,7 @@ internal object Fn_TIMES__INT64_INT64__INT64 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TIMES__INT_INT__INT : Fn { override val signature = FnSignature( @@ -141,7 +140,7 @@ internal object Fn_TIMES__INT_INT__INT : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TIMES__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Fn { override val signature = FnSignature( @@ -162,7 +161,7 @@ internal object Fn_TIMES__DECIMAL_ARBITRARY_DECIMAL_ARBITRARY__DECIMAL_ARBITRARY } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TIMES__FLOAT32_FLOAT32__FLOAT32 : Fn { override val signature = FnSignature( @@ -183,7 +182,7 @@ internal object Fn_TIMES__FLOAT32_FLOAT32__FLOAT32 : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TIMES__FLOAT64_FLOAT64__FLOAT64 : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrim.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrim.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrim.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrim.kt index e9d7b230d6..32ceb9bab4 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrim.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrim.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.utils.StringUtils.codepointTrim 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.spi.fn.utils.StringUtils.codepointTrim import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -50,7 +49,7 @@ import org.partiql.value.symbolValue * * ` ::= ` * * ` ::= ` */ -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM__STRING__STRING : Fn { override val signature = FnSignature( @@ -68,7 +67,7 @@ internal object Fn_TRIM__STRING__STRING : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM__SYMBOL__SYMBOL : Fn { override val signature = FnSignature( @@ -86,7 +85,7 @@ internal object Fn_TRIM__SYMBOL__SYMBOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM__CLOB__CLOB : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimChars.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimChars.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimChars.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimChars.kt index a355fcfde2..bb52f86b6d 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimChars.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimChars.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.utils.StringUtils.codepointTrim 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.spi.fn.utils.StringUtils.codepointTrim import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -21,7 +20,7 @@ import org.partiql.value.clobValue import org.partiql.value.stringValue import org.partiql.value.symbolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_CHARS__STRING_STRING__STRING : Fn { override val signature = FnSignature( @@ -43,7 +42,7 @@ internal object Fn_TRIM_CHARS__STRING_STRING__STRING : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_CHARS__SYMBOL_SYMBOL__SYMBOL : Fn { override val signature = FnSignature( @@ -65,7 +64,7 @@ internal object Fn_TRIM_CHARS__SYMBOL_SYMBOL__SYMBOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_CHARS__CLOB_CLOB__CLOB : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimLeading.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimLeading.kt similarity index 85% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimLeading.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimLeading.kt index ddf8fecbeb..b1a3759207 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimLeading.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimLeading.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.utils.StringUtils.codepointTrimLeading 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.spi.fn.utils.StringUtils.codepointTrimLeading import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -21,7 +20,7 @@ import org.partiql.value.clobValue import org.partiql.value.stringValue import org.partiql.value.symbolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_LEADING__STRING__STRING : Fn { override val signature = FnSignature( @@ -39,7 +38,7 @@ internal object Fn_TRIM_LEADING__STRING__STRING : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_LEADING__SYMBOL__SYMBOL : Fn { override val signature = FnSignature( @@ -57,7 +56,7 @@ internal object Fn_TRIM_LEADING__SYMBOL__SYMBOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_LEADING__CLOB__CLOB : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimLeadingChars.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimLeadingChars.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimLeadingChars.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimLeadingChars.kt index 605d7164fe..8e096b1b89 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimLeadingChars.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimLeadingChars.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.utils.StringUtils.codepointTrimLeading 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.spi.fn.utils.StringUtils.codepointTrimLeading import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -21,7 +20,7 @@ import org.partiql.value.clobValue import org.partiql.value.stringValue import org.partiql.value.symbolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_LEADING_CHARS__STRING_STRING__STRING : Fn { override val signature = FnSignature( @@ -43,7 +42,7 @@ internal object Fn_TRIM_LEADING_CHARS__STRING_STRING__STRING : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_LEADING_CHARS__SYMBOL_SYMBOL__SYMBOL : Fn { override val signature = FnSignature( @@ -65,7 +64,7 @@ internal object Fn_TRIM_LEADING_CHARS__SYMBOL_SYMBOL__SYMBOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_LEADING_CHARS__CLOB_CLOB__CLOB : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimTrailing.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimTrailing.kt similarity index 85% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimTrailing.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimTrailing.kt index c0e24bdf0f..822837ee82 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimTrailing.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimTrailing.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.utils.StringUtils.codepointTrimTrailing 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.spi.fn.utils.StringUtils.codepointTrimTrailing import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -21,7 +20,7 @@ import org.partiql.value.clobValue import org.partiql.value.stringValue import org.partiql.value.symbolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_TRAILING__STRING__STRING : Fn { override val signature = FnSignature( @@ -39,7 +38,7 @@ internal object Fn_TRIM_TRAILING__STRING__STRING : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_TRAILING__SYMBOL__SYMBOL : Fn { override val signature = FnSignature( @@ -57,7 +56,7 @@ internal object Fn_TRIM_TRAILING__SYMBOL__SYMBOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_TRAILING__CLOB__CLOB : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimTrailingChars.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimTrailingChars.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimTrailingChars.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimTrailingChars.kt index 05a4fa8cf6..0a2c32a13c 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnTrimTrailingChars.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnTrimTrailingChars.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins -import org.partiql.spi.connector.sql.utils.StringUtils.codepointTrimTrailing 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.spi.fn.utils.StringUtils.codepointTrimTrailing import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -21,7 +20,7 @@ import org.partiql.value.clobValue import org.partiql.value.stringValue import org.partiql.value.symbolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_TRAILING_CHARS__STRING_STRING__STRING : Fn { override val signature = FnSignature( @@ -43,7 +42,7 @@ internal object Fn_TRIM_TRAILING_CHARS__STRING_STRING__STRING : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_TRAILING_CHARS__SYMBOL_SYMBOL__SYMBOL : Fn { override val signature = FnSignature( @@ -65,7 +64,7 @@ internal object Fn_TRIM_TRAILING_CHARS__SYMBOL_SYMBOL__SYMBOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_TRIM_TRAILING_CHARS__CLOB_CLOB__CLOB : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnUpper.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnUpper.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnUpper.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnUpper.kt index cc4a0341dd..bd8680c4b8 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnUpper.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnUpper.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins 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.value.ClobValue @@ -20,7 +19,7 @@ import org.partiql.value.clobValue import org.partiql.value.stringValue import org.partiql.value.symbolValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_UPPER__STRING__STRING : Fn { override val signature = FnSignature( @@ -38,7 +37,7 @@ internal object Fn_UPPER__STRING__STRING : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_UPPER__SYMBOL__SYMBOL : Fn { override val signature = FnSignature( @@ -56,7 +55,7 @@ internal object Fn_UPPER__SYMBOL__SYMBOL : Fn { } } -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_UPPER__CLOB__CLOB : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnUtcnow.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnUtcnow.kt similarity index 83% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnUtcnow.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnUtcnow.kt index db149597c4..779239b027 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/FnUtcnow.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/FnUtcnow.kt @@ -1,10 +1,9 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.spi.connector.sql.builtins +package org.partiql.spi.fn.builtins import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental import org.partiql.spi.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -12,7 +11,7 @@ import org.partiql.value.PartiQLValueType.TIMESTAMP import org.partiql.value.datetime.TimestampWithTimeZone import org.partiql.value.timestampValue -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal object Fn_UTCNOW____TIMESTAMP : Fn { override val signature = FnSignature( diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/Accumulator.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/Accumulator.kt similarity index 98% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/Accumulator.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/Accumulator.kt index 8cfec2bca3..99bca5144e 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/Accumulator.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/Accumulator.kt @@ -14,12 +14,11 @@ @file:OptIn(PartiQLValueExperimental::class) -package org.partiql.spi.connector.sql.builtins.internal +package org.partiql.spi.fn.builtins.internal import com.amazon.ion.Decimal import org.partiql.errors.TypeCheckException import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.FnExperimental import org.partiql.value.BoolValue import org.partiql.value.DecimalValue import org.partiql.value.Float32Value @@ -47,7 +46,6 @@ import java.math.BigInteger import java.math.MathContext import java.math.RoundingMode -@OptIn(FnExperimental::class) internal abstract class Accumulator : Agg.Accumulator { /** Accumulates the next value into this [Accumulator]. */ @@ -161,7 +159,8 @@ internal fun PartiQLValueType.isNumber(): Boolean = when (this) { PartiQLValueType.DECIMAL, PartiQLValueType.DECIMAL_ARBITRARY, PartiQLValueType.FLOAT32, - PartiQLValueType.FLOAT64 -> true + PartiQLValueType.FLOAT64, + -> true else -> false } diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorAnySome.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorAnySome.kt similarity index 90% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorAnySome.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorAnySome.kt index fa82aa7d14..7efb051f42 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorAnySome.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorAnySome.kt @@ -1,4 +1,4 @@ -package org.partiql.spi.connector.sql.builtins.internal +package org.partiql.spi.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorAvg.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorAvg.kt similarity index 92% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorAvg.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorAvg.kt index 2704075938..544ce8a01f 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorAvg.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorAvg.kt @@ -1,4 +1,4 @@ -package org.partiql.spi.connector.sql.builtins.internal +package org.partiql.spi.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -6,7 +6,7 @@ import org.partiql.value.PartiQLValueType @OptIn(PartiQLValueExperimental::class) internal class AccumulatorAvg( - private val targetType: PartiQLValueType = PartiQLValueType.ANY + private val targetType: PartiQLValueType = PartiQLValueType.ANY, ) : Accumulator() { var sum: Number = 0.0 diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorCount.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorCount.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorCount.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorCount.kt index ec4d926b24..0156d67079 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorCount.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorCount.kt @@ -1,4 +1,4 @@ -package org.partiql.spi.connector.sql.builtins.internal +package org.partiql.spi.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorCountStar.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorCountStar.kt similarity index 70% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorCountStar.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorCountStar.kt index 82768fdb1b..1ac131ab55 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorCountStar.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorCountStar.kt @@ -1,12 +1,11 @@ -package org.partiql.spi.connector.sql.builtins.internal +package org.partiql.spi.fn.builtins.internal import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.FnExperimental import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.int64Value -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal class AccumulatorCountStar : Agg.Accumulator { var count: Long = 0L diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorEvery.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorEvery.kt similarity index 91% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorEvery.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorEvery.kt index 900fc8238f..22499f9836 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorEvery.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorEvery.kt @@ -1,4 +1,4 @@ -package org.partiql.spi.connector.sql.builtins.internal +package org.partiql.spi.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorGroupAs.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorGroupAs.kt similarity index 87% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorGroupAs.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorGroupAs.kt index 30d1b88778..d3f4431159 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorGroupAs.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorGroupAs.kt @@ -1,4 +1,4 @@ -package org.partiql.spi.connector.sql.builtins.internal +package org.partiql.spi.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorMax.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorMax.kt similarity index 89% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorMax.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorMax.kt index dfce376ed2..e50e3a2017 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorMax.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorMax.kt @@ -1,4 +1,4 @@ -package org.partiql.spi.connector.sql.builtins.internal +package org.partiql.spi.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorMin.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorMin.kt similarity index 88% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorMin.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorMin.kt index 75c0972289..3734ea101c 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorMin.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorMin.kt @@ -1,4 +1,4 @@ -package org.partiql.spi.connector.sql.builtins.internal +package org.partiql.spi.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorSum.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorSum.kt similarity index 92% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorSum.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorSum.kt index a9405d9e4e..1e1c080ad4 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/builtins/internal/AccumulatorSum.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/builtins/internal/AccumulatorSum.kt @@ -1,4 +1,4 @@ -package org.partiql.spi.connector.sql.builtins.internal +package org.partiql.spi.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -6,7 +6,7 @@ import org.partiql.value.PartiQLValueType @OptIn(PartiQLValueExperimental::class) internal class AccumulatorSum( - private val targetType: PartiQLValueType = PartiQLValueType.ANY + private val targetType: PartiQLValueType = PartiQLValueType.ANY, ) : Accumulator() { var sum: Number? = null diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/utils/PatternUtils.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/utils/PatternUtils.kt similarity index 98% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/utils/PatternUtils.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/utils/PatternUtils.kt index 82ab8642b5..60f9f22c3c 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/utils/PatternUtils.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/utils/PatternUtils.kt @@ -1,6 +1,6 @@ -package org.partiql.spi.connector.sql.utils +package org.partiql.spi.fn.utils -import org.partiql.spi.connector.sql.utils.StringUtils.codePointSequence +import org.partiql.spi.fn.utils.StringUtils.codePointSequence import java.util.regex.Pattern internal object PatternUtils { diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/utils/StringUtils.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/utils/StringUtils.kt similarity index 99% rename from partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/utils/StringUtils.kt rename to partiql-spi/src/main/kotlin/org/partiql/spi/fn/utils/StringUtils.kt index 08ad56a7e2..adfa0260ff 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/connector/sql/utils/StringUtils.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/fn/utils/StringUtils.kt @@ -1,4 +1,4 @@ -package org.partiql.spi.connector.sql.utils +package org.partiql.spi.fn.utils internal object StringUtils { diff --git a/partiql-spi/src/test/kotlin/org/partiql/spi/connector/sql/HeaderCodeGen.kt b/partiql-spi/src/test/kotlin/org/partiql/spi/connector/sql/HeaderCodeGen.kt deleted file mode 100644 index 8326b19289..0000000000 --- a/partiql-spi/src/test/kotlin/org/partiql/spi/connector/sql/HeaderCodeGen.kt +++ /dev/null @@ -1,188 +0,0 @@ -package org.partiql.spi.connector.sql - -import net.pearx.kasechange.toPascalCase -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test -import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.FnSignature -import org.partiql.value.PartiQLValueExperimental -import java.io.File - -const val imports = """ -import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.FnParameter -import org.partiql.spi.fn.FnScalar -import org.partiql.spi.fn.FnSignature -import org.partiql.value.PartiQLValueExperimental -import org.partiql.value.* -import org.partiql.value.PartiQLValueType.* -""" - -/** - * 0 -> Pascal case name - * 1 —> Snake case name - * 2 —> Return Type - * 3 —> Parameter list as string - * 4 —> isNullCall - * 5 -> isNullable - * 6 —> Snake case name - */ -const val TEMPLATE_SCALAR = """ -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -internal object %s : FnScalar { - - override val signature = FnSignature( - name = "%s", - returns = %s, - parameters = listOf(%s), - isNullCall = %b, - isNullable = %b, - ) - - override fun invoke(args: Array): PartiQLValue { - TODO("Function %s not implemented") - } -} -""" - -/** - * 0 -> Pascal case name - * 1 —> Snake case name - * 2 —> Return Type - * 3 —> Parameter list as string - * 4 -> isNullable - * 5 —> isDecomposable - * 6 —> Snake case name - */ -const val TEMPLATE_AGG = """ -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -internal object %s : Agg { - - override val signature = AggSignature( - name = "%s", - returns = %s, - parameters = listOf(%s), - isNullable = %b, - isDecomposable = %b - ) - - override fun accumulator(): Agg.Accumulator { - TODO("Aggregation %s not implemented") - } -} -""" - -@Disabled -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -class HeaderCodeGen { - - @Test - fun scalars() { - generateFns("package org.partiql.spi.connector.sql.internal.builtins", TEMPLATE_SCALAR, "Fn", SqlHeader.fns) - } - - @Test - fun aggregations() { - generateAggs("package org.partiql.spi.connector.sql.internal.builtins", TEMPLATE_AGG, "Agg", SqlHeader.aggs) - } - - /** - * Writes function implementation to file, prints list of classes - */ - private fun generateFns( - packageName: String, - template: String, - prefix: String, - signatures: List, - ) { - val clazzes = mutableListOf() - val funcs = signatures.groupBy { it.name } - val pathToDir = "./src/main/kotlin/org/partiql/spi/connector/sql/builtins" - for ((name, fns) in funcs) { - val pre = "${prefix}_$name".toPascalCase() - val file = File("$pathToDir/$pre.kt") - file.printWriter().use { - it.appendLine("// ktlint-disable filename") - it.appendLine("@file:Suppress(\"ClassName\")") - it.appendLine() - it.appendLine(packageName) - it.appendLine() - it.appendLine(imports) - it.appendLine() - fns.forEach { sig -> - val clazz = "${prefix}_${sig.specific}" - val params = toParams(clazz, sig) - val code = String.format(template, *params) - it.appendLine(code) - it.appendLine() - clazzes.add(clazz) - } - } - } - println("-- GENERATED") - println("listOf(${clazzes.joinToString()})") - println() - } - - /** - * Writes function implementation to file, prints list of classes - */ - private fun generateAggs( - packageName: String, - template: String, - prefix: String, - signatures: List, - ) { - val clazzes = mutableListOf() - val funcs = signatures.groupBy { it.name } - val pathToDir = "./src/main/kotlin/org/partiql/spi/connector/sql/builtins" - for ((name, fns) in funcs) { - val pre = "${prefix}_$name".toPascalCase() - val file = File("$pathToDir/$pre.kt") - file.printWriter().use { - it.appendLine("// ktlint-disable filename") - it.appendLine("@file:Suppress(\"ClassName\")") - it.appendLine() - it.appendLine(packageName) - it.appendLine() - it.appendLine(imports) - it.appendLine() - fns.forEach { sig -> - val clazz = "${prefix}_${sig.specific}" - val params = toParams(clazz, sig) - val code = String.format(template, *params) - it.appendLine(code) - it.appendLine() - clazzes.add(clazz) - } - } - } - println("-- GENERATED") - println("listOf(${clazzes.joinToString()})") - println() - } - - @OptIn(FnExperimental::class) - private fun toParams(clazz: String, fn: FnSignature): Array { - val snake = fn.name - val returns = fn.returns.toString() - val parameters = fn.parameters.mapIndexed { i, p -> - "FnParameter(\"${p.name}\", ${p.type})" - }.joinToString(",\n", postfix = ",") - return arrayOf(clazz, snake, returns, parameters, fn.isNullCall, fn.isNullable, snake) - } - - @OptIn(FnExperimental::class) - private fun toParams(clazz: String, agg: AggSignature): Array { - val snake = agg.name - val returns = agg.returns.toString() - var parameters = "" - for (p in agg.parameters) { - parameters += "FnParameter(\"${p.name}\", ${p.type}),\n" - } - return arrayOf(clazz, snake, returns, parameters, agg.isNullable, agg.isDecomposable, snake) - } -} diff --git a/partiql-spi/src/test/kotlin/org/partiql/spi/connector/sql/SqlHeader.kt b/partiql-spi/src/test/kotlin/org/partiql/spi/connector/sql/SqlHeader.kt deleted file mode 100644 index 62e467e032..0000000000 --- a/partiql-spi/src/test/kotlin/org/partiql/spi/connector/sql/SqlHeader.kt +++ /dev/null @@ -1,831 +0,0 @@ -package org.partiql.spi.connector.sql - -import org.partiql.spi.fn.AggSignature -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.FnParameter -import org.partiql.spi.fn.FnSignature -import org.partiql.value.PartiQLValueExperimental -import org.partiql.value.PartiQLValueType -import org.partiql.value.PartiQLValueType.ANY -import org.partiql.value.PartiQLValueType.BAG -import org.partiql.value.PartiQLValueType.BOOL -import org.partiql.value.PartiQLValueType.CHAR -import org.partiql.value.PartiQLValueType.CLOB -import org.partiql.value.PartiQLValueType.DATE -import org.partiql.value.PartiQLValueType.DECIMAL -import org.partiql.value.PartiQLValueType.DECIMAL_ARBITRARY -import org.partiql.value.PartiQLValueType.FLOAT32 -import org.partiql.value.PartiQLValueType.FLOAT64 -import org.partiql.value.PartiQLValueType.INT -import org.partiql.value.PartiQLValueType.INT16 -import org.partiql.value.PartiQLValueType.INT32 -import org.partiql.value.PartiQLValueType.INT64 -import org.partiql.value.PartiQLValueType.INT8 -import org.partiql.value.PartiQLValueType.LIST -import org.partiql.value.PartiQLValueType.MISSING -import org.partiql.value.PartiQLValueType.NULL -import org.partiql.value.PartiQLValueType.SEXP -import org.partiql.value.PartiQLValueType.STRING -import org.partiql.value.PartiQLValueType.SYMBOL -import org.partiql.value.PartiQLValueType.TIME -import org.partiql.value.PartiQLValueType.TIMESTAMP - -/** - * This is a temporary internal object for generating all SQL-99 function signatures. - */ -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) -internal object SqlHeader { - - private val all = PartiQLValueType.values() - - private val nullable = listOf( - NULL, // null.null - MISSING, // missing - ) - - private val integer = listOf( - INT8, - INT16, - INT32, - INT64, - INT, - ) - - private val numeric = listOf( - INT8, - INT16, - INT32, - INT64, - INT, - DECIMAL_ARBITRARY, - FLOAT32, - FLOAT64, - ) - - private val text = listOf( - STRING, - SYMBOL, - CLOB, - ) - - private val collections = listOf( - BAG, - LIST, - SEXP, - ) - - private val datetime = listOf( - DATE, - TIME, - TIMESTAMP, - ) - - private enum class DatetimeField { - YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, TIMEZONE_HOUR, TIMEZONE_MINUTE, - } - /** - * PartiQL Scalar Functions - */ - val fns: List = listOf( - builtins(), - logical(), - predicate(), - operators(), - special(), - system(), - ).flatten() - - /** - * PartiQL Aggregation Functions accessible via - */ - val aggs: List = aggBuiltins() - - /** - * Generate all unary and binary operator signatures. - */ - private fun operators(): List = listOf( - pos(), - neg(), - plus(), - minus(), - times(), - div(), - mod(), - concat(), - bitwiseAnd(), - ).flatten() - - /** - * Predicate function -- Condition that can be evaluated to a boolean value. - * - * Predicate function IS NULL, IS MISSING, `=`(Equal) does not propagate `MISSING`. - */ - private fun predicate(): List = listOf( - // SQL - // 8.2 - comparison predicate - lt(), - lte(), - gt(), - gte(), - eq(), - - // 8.3 - between predicate - between(), - // 8.4 - in predicate - inCollection(), - // 8.5 - like predicate - like(), - // 8.7 - null predicate - isNull(), - - // PartiQL - isMissing(), // missing predication - isType(), // type predicate - isTypeSingleArg(), - isTypeDoubleArgsInt(), - isTypeTime(), - ).flatten() - - /** - * Logical functions follows the three-valued logic truth table: - * - * |A |B |A AND B|A OR B |NOT A | - * |----|----|-------|-------|------| - * |T |T |T |T |F | - * |T |F |F |T |F | - * |T |U |U |T |F | - * |F |T |F |T |T | - * |F |F |F |F |T | - * |F |U |F |U |T | - * |U |T |U |T |U | - * |U |F |F |U |U | - * |U |U |U |U |U | - * - * 1. The `MISSING` value, when convert to a truth value, becomes a `UNKNOWN`. - * 2. `UNKNOWN` truth value, when converting to PartiQL Value, becomes NULL of boolean type. - */ - private fun logical(): List = listOf( - not(), - and(), - or(), - ).flatten() - - /** - * SQL Builtins (not special forms) - */ - private fun builtins(): List = listOf( - upper(), - lower(), - trim(), - utcNow(), - ).flatten() - - /** - * SQL and PartiQL special forms - */ - private fun special(): List = listOf( - position(), - substring(), - trimSpecial(), - overlay(), - extract(), - dateAdd(), - dateDiff(), - ).flatten() - - /** - * System functions (for now, CURRENT_USER and CURRENT_DATE) - * - * @return - */ - private fun system(): List = listOf( - currentUser(), - currentDate(), - ) - - // OPERATORS - - private fun not(): List = listOf( - FnSignature( - name = "not", - returns = BOOL, - isNullCall = true, - isNullable = false, - parameters = listOf(FnParameter("value", BOOL)), - ), - FnSignature( - name = "not", - returns = BOOL, - isNullCall = true, - isNullable = false, - parameters = listOf(FnParameter("value", MISSING)), - ), - ) - - private fun pos(): List = numeric.map { t -> - unary("pos", t, t) - } - - private fun neg(): List = numeric.map { t -> - unary("neg", t, t) - } - - private fun eq(): List = all.map { t -> - FnSignature( - name = "eq", - returns = BOOL, - parameters = listOf(FnParameter("lhs", t), FnParameter("rhs", t)), - isNullable = false, - isNullCall = true, - ) - } - - private fun and(): List = listOf( - FnSignature( - name = "and", - returns = BOOL, - isNullCall = false, - isNullable = true, - parameters = listOf(FnParameter("lhs", BOOL), FnParameter("rhs", BOOL)), - ), - FnSignature( - name = "and", - returns = BOOL, - isNullCall = false, - isNullable = true, - parameters = listOf(FnParameter("lhs", MISSING), FnParameter("rhs", BOOL)), - ), - FnSignature( - name = "and", - returns = BOOL, - isNullCall = false, - isNullable = true, - parameters = listOf(FnParameter("lhs", BOOL), FnParameter("rhs", MISSING)), - ), - FnSignature( - name = "and", - returns = BOOL, - isNullCall = false, - isNullable = true, - parameters = listOf(FnParameter("lhs", MISSING), FnParameter("rhs", MISSING)), - ), - ) - - private fun or(): List = listOf( - FnSignature( - name = "or", - returns = BOOL, - isNullCall = false, - isNullable = true, - parameters = listOf(FnParameter("lhs", BOOL), FnParameter("rhs", BOOL)), - ), - FnSignature( - name = "or", - returns = BOOL, - isNullCall = false, - isNullable = true, - parameters = listOf(FnParameter("lhs", MISSING), FnParameter("rhs", BOOL)), - ), - FnSignature( - name = "or", - returns = BOOL, - isNullCall = false, - isNullable = true, - parameters = listOf(FnParameter("lhs", BOOL), FnParameter("rhs", MISSING)), - ), - FnSignature( - name = "or", - returns = BOOL, - isNullCall = false, - isNullable = true, - parameters = listOf(FnParameter("lhs", MISSING), FnParameter("rhs", MISSING)), - ), - ) - - private fun lt(): List = (numeric + text + datetime + BOOL).map { t -> - binary("lt", BOOL, t, t) - } - - private fun lte(): List = (numeric + text + datetime + BOOL).map { t -> - binary("lte", BOOL, t, t) - } - - private fun gt(): List = (numeric + text + datetime + BOOL).map { t -> - binary("gt", BOOL, t, t) - } - - private fun gte(): List = (numeric + text + datetime + BOOL).map { t -> - binary("gte", BOOL, t, t) - } - - private fun plus(): List = numeric.map { t -> - binary("plus", t, t, t) - } - - private fun minus(): List = numeric.map { t -> - binary("minus", t, t, t) - } - - private fun times(): List = numeric.map { t -> - binary("times", t, t, t) - } - - private fun div(): List = numeric.map { t -> - binary("divide", t, t, t) - } - - private fun mod(): List = numeric.map { t -> - binary("modulo", t, t, t) - } - - private fun concat(): List = text.map { t -> - binary("concat", t, t, t) - } - - private fun bitwiseAnd(): List = integer.map { t -> - binary("bitwise_and", t, t, t) - } - - // BUILT INS - private fun upper(): List = text.map { t -> - FnSignature( - name = "upper", - returns = t, - parameters = listOf(FnParameter("value", t)), - isNullable = false, - isNullCall = true, - ) - } - - private fun lower(): List = text.map { t -> - FnSignature( - name = "lower", - returns = t, - parameters = listOf(FnParameter("value", t)), - isNullable = false, - isNullCall = true, - ) - } - - // SPECIAL FORMS - - private fun like(): List = text.flatMap { t -> - listOf( - FnSignature( - name = "like", - returns = BOOL, - parameters = listOf( - FnParameter("value", t), - FnParameter("pattern", t), - ), - isNullCall = true, - isNullable = false, - ), - FnSignature( - name = "like_escape", - returns = BOOL, - parameters = listOf( - FnParameter("value", t), - FnParameter("pattern", t), - FnParameter("escape", t), - ), - isNullCall = true, - isNullable = false, - ), - ) - } - - private fun between(): List = (numeric + text + datetime).map { t -> - FnSignature( - name = "between", - returns = BOOL, - parameters = listOf( - FnParameter("value", t), - FnParameter("lower", t), - FnParameter("upper", t), - ), - isNullable = false, - isNullCall = true, - ) - } - - private fun inCollection(): List = all.map { element -> - collections.map { collection -> - FnSignature( - name = "in_collection", - returns = BOOL, - parameters = listOf( - FnParameter("value", element), - FnParameter("collection", collection), - ), - isNullable = false, - isNullCall = true, - ) - } - }.flatten() - - private fun isNull(): List = listOf( - FnSignature( - name = "is_null", returns = BOOL, - parameters = listOf( - FnParameter("value", ANY) // TODO: Decide if we need to further segment this - ), - isNullCall = false, isNullable = false - ) - ) - - private fun isMissing(): List = listOf( - FnSignature( - name = "is_missing", returns = BOOL, - parameters = listOf( - FnParameter("value", ANY) // TODO: Decide if we need to further segment this - ), - isNullCall = false, isNullable = false - ) - ) - - // To model type assertion, generating a list of assertion function based on the type, - // and the parameter will be the value entered. - // i.e., 1 is INT2 => is_int16(1) - private fun isType(): List = all.filterNot { it == NULL || it == MISSING }.map { element -> - FnSignature( - name = "is_${element.name.lowercase()}", - returns = BOOL, - parameters = listOf( - FnParameter("value", ANY) - ), - isNullable = false, - isNullCall = false, - ) - } - - // In type assertion, it is possible for types to have args - // i.e., 'a' is CHAR(2) - // we put type parameter before value. - private fun isTypeSingleArg(): List = listOf(CHAR, STRING).map { element -> - FnSignature( - name = "is_${element.name.lowercase()}", returns = BOOL, - parameters = listOf( - FnParameter("type_parameter_1", INT32), FnParameter("value", ANY) - ), - isNullable = false, isNullCall = false - ) - } - - private fun isTypeDoubleArgsInt(): List = listOf(DECIMAL).map { element -> - FnSignature( - name = "is_${element.name.lowercase()}", returns = BOOL, - parameters = listOf( - FnParameter("type_parameter_1", INT32), - FnParameter("type_parameter_2", INT32), - FnParameter("value", ANY) - ), - isNullable = false, isNullCall = false - ) - } - - private fun isTypeTime(): List = listOf(TIME, TIMESTAMP).map { element -> - FnSignature( - name = "is_${element.name.lowercase()}", returns = BOOL, - parameters = listOf( - FnParameter("type_parameter_1", BOOL), - FnParameter("type_parameter_2", INT32), - FnParameter("value", ANY) // TODO: Decide if we need to further segment this - ), - isNullable = false, isNullCall = false - ) - } - - // SUBSTRING (expression, start[, length]?) - // SUBSTRINGG(expression from start [FOR length]? ) - private fun substring(): List = text.map { t -> - listOf( - FnSignature( - name = "substring", - returns = t, - parameters = listOf( - FnParameter("value", t), - FnParameter("start", INT64), - ), - isNullable = false, - isNullCall = true, - ), - FnSignature( - name = "substring", - returns = t, - parameters = listOf( - FnParameter("value", t), - FnParameter("start", INT64), - FnParameter("end", INT64), - ), - isNullable = false, - isNullCall = true, - ) - ) - }.flatten() - - // position (str1, str2) - // position (str1 in str2) - private fun position(): List = text.map { t -> - FnSignature( - name = "position", - returns = INT64, - parameters = listOf( - FnParameter("probe", t), - FnParameter("value", t), - ), - isNullable = false, - isNullCall = true, - ) - } - - // trim(str) - private fun trim(): List = text.map { t -> - FnSignature( - name = "trim", - returns = t, - parameters = listOf( - FnParameter("value", t), - ), - isNullable = false, - isNullCall = true, - ) - } - - // TODO: We need to add a special form function for TRIM(BOTH FROM value) - private fun trimSpecial(): List = text.map { t -> - listOf( - // TRIM(chars FROM value) - // TRIM(both chars from value) - FnSignature( - name = "trim_chars", - returns = t, - parameters = listOf( - FnParameter("value", t), - FnParameter("chars", t), - ), - isNullable = false, - isNullCall = true, - ), - // TRIM(LEADING FROM value) - FnSignature( - name = "trim_leading", - returns = t, - parameters = listOf( - FnParameter("value", t), - ), - isNullable = false, - isNullCall = true, - ), - // TRIM(LEADING chars FROM value) - FnSignature( - name = "trim_leading_chars", - returns = t, - parameters = listOf( - FnParameter("value", t), - FnParameter("chars", t), - ), - isNullable = false, - isNullCall = true, - ), - // TRIM(TRAILING FROM value) - FnSignature( - name = "trim_trailing", - returns = t, - parameters = listOf( - FnParameter("value", t), - ), - isNullable = false, - isNullCall = true, - ), - // TRIM(TRAILING chars FROM value) - FnSignature( - name = "trim_trailing_chars", - returns = t, - parameters = listOf( - FnParameter("value", t), - FnParameter("chars", t), - ), - isNullable = false, - isNullCall = true, - ), - ) - }.flatten() - - // TODO - private fun overlay(): List = emptyList() - - // TODO - private fun extract(): List = emptyList() - - private fun dateAdd(): List { - val intervals = listOf(INT32, INT64, INT) - val operators = mutableListOf() - for (field in DatetimeField.values()) { - for (type in datetime) { - if (field == DatetimeField.TIMEZONE_HOUR || field == DatetimeField.TIMEZONE_MINUTE) { - continue - } - for (interval in intervals) { - val signature = FnSignature( - name = "date_add_${field.name.lowercase()}", - returns = type, - parameters = listOf( - FnParameter("interval", interval), - FnParameter("datetime", type), - ), - isNullable = false, - isNullCall = true, - ) - operators.add(signature) - } - } - } - return operators - } - - private fun dateDiff(): List { - val operators = mutableListOf() - for (field in DatetimeField.values()) { - for (type in datetime) { - if (field == DatetimeField.TIMEZONE_HOUR || field == DatetimeField.TIMEZONE_MINUTE) { - continue - } - val signature = FnSignature( - name = "date_diff_${field.name.lowercase()}", - returns = INT64, - parameters = listOf( - FnParameter("datetime1", type), - FnParameter("datetime2", type), - ), - isNullable = false, - isNullCall = true, - ) - operators.add(signature) - } - } - return operators - } - - private fun utcNow(): List = listOf( - FnSignature( - name = "utcnow", - returns = TIMESTAMP, - parameters = emptyList(), - isNullable = false, - ) - ) - - private fun currentUser() = FnSignature( - name = "current_user", - returns = STRING, - parameters = emptyList(), - isNullable = true, - ) - - private fun currentDate() = FnSignature( - name = "current_date", - returns = DATE, - parameters = emptyList(), - isNullable = false, - ) - - // ==================================== - // AGGREGATIONS - // ==================================== - - /** - * SQL and PartiQL Aggregation Builtins - */ - private fun aggBuiltins(): List = listOf( - every(), - any(), - some(), - count(), - min(), - max(), - sum(), - avg(), - ).flatten() - - private fun every() = listOf( - AggSignature( - name = "every", - returns = BOOL, - parameters = listOf(FnParameter("value", BOOL)), - isNullable = true, - ), - ) - - private fun any() = listOf( - AggSignature( - name = "any", - returns = BOOL, - parameters = listOf(FnParameter("value", BOOL)), - isNullable = true, - ), - ) - - private fun some() = listOf( - AggSignature( - name = "some", - returns = BOOL, - parameters = listOf(FnParameter("value", BOOL)), - isNullable = true, - ), - ) - - private fun count() = listOf( - AggSignature( - name = "count", - returns = INT32, - parameters = listOf(FnParameter("value", ANY)), - isNullable = false, - ), - AggSignature( - name = "count_star", - returns = INT32, - parameters = listOf(), - isNullable = false, - ), - ) - - private fun min() = numeric.map { - AggSignature( - name = "min", - returns = it, - parameters = listOf(FnParameter("value", it)), - isNullable = true, - ) - } - - private fun max() = numeric.map { - AggSignature( - name = "max", - returns = it, - parameters = listOf(FnParameter("value", it)), - isNullable = true, - ) - } - - private fun sum() = numeric.map { - AggSignature( - name = "sum", - returns = it, - parameters = listOf(FnParameter("value", it)), - isNullable = true, - ) - } - - private fun avg() = numeric.map { - AggSignature( - name = "avg", - returns = it, - parameters = listOf(FnParameter("value", it)), - isNullable = true, - ) - } - - // ==================================== - // HELPERS - // ==================================== - - @JvmStatic - internal fun unary(name: String, returns: PartiQLValueType, value: PartiQLValueType) = FnSignature( - name = name, - returns = returns, - parameters = listOf(FnParameter("value", value)), - isNullable = false, - isNullCall = true - ) - - @JvmStatic - internal fun binary(name: String, returns: PartiQLValueType, lhs: PartiQLValueType, rhs: PartiQLValueType) = - FnSignature( - name = name, - returns = returns, - parameters = listOf(FnParameter("lhs", lhs), FnParameter("rhs", rhs)), - isNullable = false, - isNullCall = true - ) - - /** - * Dump the Header as SQL commands - * - * For functions, output CREATE FUNCTION statements. - */ - override fun toString(): String = buildString { - fns.groupBy { it.name }.forEach { - appendLine("-- [${it.key}] ---------") - appendLine() - it.value.forEach { fn -> appendLine(fn) } - appendLine() - } - aggs.groupBy { it.name }.forEach { - appendLine("-- [${it.key}] ---------") - appendLine() - it.value.forEach { fn -> appendLine(fn) } - appendLine() - } - } -} diff --git a/plugins/partiql-local/src/main/kotlin/org/partiql/plugins/local/LocalConnector.kt b/plugins/partiql-local/src/main/kotlin/org/partiql/plugins/local/LocalConnector.kt index 9072c659c8..9a08b03c7d 100644 --- a/plugins/partiql-local/src/main/kotlin/org/partiql/plugins/local/LocalConnector.kt +++ b/plugins/partiql-local/src/main/kotlin/org/partiql/plugins/local/LocalConnector.kt @@ -17,14 +17,11 @@ package org.partiql.plugins.local import com.amazon.ionelement.api.StructElement import org.partiql.spi.BindingPath import org.partiql.spi.connector.Connector -import org.partiql.spi.connector.ConnectorAggProvider import org.partiql.spi.connector.ConnectorBindings -import org.partiql.spi.connector.ConnectorFnProvider import org.partiql.spi.connector.ConnectorHandle import org.partiql.spi.connector.ConnectorMetadata import org.partiql.spi.connector.ConnectorPath import org.partiql.spi.connector.ConnectorSession -import org.partiql.spi.fn.FnExperimental import java.nio.file.Path import java.nio.file.Paths import kotlin.io.path.notExists @@ -67,16 +64,6 @@ public class LocalConnector( TODO("Not yet implemented") } - @FnExperimental - override fun getFunctions(): ConnectorFnProvider { - TODO("Not yet implemented") - } - - @FnExperimental - override fun getAggregations(): ConnectorAggProvider { - TODO("Not yet implemented") - } - internal class Factory : Connector.Factory { private val default: Path = Paths.get(System.getProperty("user.home")).resolve(".partiql/local") @@ -114,14 +101,6 @@ public class LocalConnector( ) } - @FnExperimental - override fun getFunction(path: BindingPath): ConnectorHandle.Fn? { - TODO("Not yet implemented") - } - - @FnExperimental - override fun getAggregation(path: BindingPath): ConnectorHandle.Agg? = null - internal fun listObjects(): List = catalog.listObjects() } } diff --git a/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryCatalog.kt b/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryCatalog.kt index 426b65d496..f138165cb1 100644 --- a/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryCatalog.kt +++ b/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryCatalog.kt @@ -17,12 +17,8 @@ package org.partiql.plugins.memory import org.partiql.spi.BindingName import org.partiql.spi.BindingPath -import org.partiql.spi.connector.ConnectorFnProvider import org.partiql.spi.connector.ConnectorHandle import org.partiql.spi.connector.ConnectorPath -import org.partiql.spi.connector.sql.SqlFnProvider -import org.partiql.spi.connector.sql.info.InfoSchema -import org.partiql.spi.fn.FnExperimental /** * A basic catalog implementation used in testing. @@ -31,10 +27,7 @@ import org.partiql.spi.fn.FnExperimental * * @property name */ -public class MemoryCatalog(public val name: String, public val infoSchema: InfoSchema) { - - @OptIn(FnExperimental::class) - public fun getFunctions(): ConnectorFnProvider = SqlFnProvider(infoSchema.functions) +public class MemoryCatalog(public val name: String) { private val root: Tree.Dir = Tree.Dir(name) @@ -122,12 +115,6 @@ public class MemoryCatalog(public val name: String, public val infoSchema: InfoS @JvmStatic public fun builder(): MemoryCatalogBuilder = MemoryCatalogBuilder() - - @JvmStatic - public fun SQL(): MemoryCatalogBuilder = MemoryCatalogBuilder().info(InfoSchema.default()) - - @JvmStatic - public fun PartiQL(): MemoryCatalogBuilder = MemoryCatalogBuilder().info(InfoSchema.ext()) } private sealed interface Tree { diff --git a/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryCatalogBuilder.kt b/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryCatalogBuilder.kt index 15d6e06c58..e7ba9c799c 100644 --- a/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryCatalogBuilder.kt +++ b/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryCatalogBuilder.kt @@ -19,12 +19,6 @@ import com.amazon.ionelement.api.IonElement import org.partiql.spi.BindingCase import org.partiql.spi.BindingName import org.partiql.spi.BindingPath -import org.partiql.spi.connector.ConnectorPath -import org.partiql.spi.connector.sql.info.InfoSchema -import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.Index import org.partiql.types.StaticType import org.partiql.value.PartiQLValueExperimental import org.partiql.value.io.PartiQLValueIonReaderBuilder @@ -35,13 +29,10 @@ import org.partiql.value.io.PartiQLValueIonReaderBuilder public class MemoryCatalogBuilder { private var _name: String? = null - private var _info: InfoSchema? = null private var _items: MutableList> = mutableListOf() public fun name(name: String): MemoryCatalogBuilder = this.apply { this._name = name } - public fun info(info: InfoSchema): MemoryCatalogBuilder = this.apply { this._info = info } - /** * This is a simple `dot` delimited utility for adding type definitions. * @@ -61,20 +52,9 @@ public class MemoryCatalogBuilder { _items.add(path to obj) } - @OptIn(FnExperimental::class) public fun build(): MemoryCatalog { val name = _name ?: error("MemoryCatalog must have a name") - val info = _info ?: InfoSchema( - object : Index { - override fun get(path: List): List = emptyList() - override fun get(path: ConnectorPath, specific: String): Fn? = null - }, - object : Index { - override fun get(path: List): List = emptyList() - override fun get(path: ConnectorPath, specific: String): Agg? = null - } - ) - val catalog = MemoryCatalog(name, info) + val catalog = MemoryCatalog(name) for (item in _items) { catalog.insert(item.first, item.second) } return catalog } diff --git a/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryConnector.kt b/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryConnector.kt index ea984ae2e8..9ad57afc16 100644 --- a/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryConnector.kt +++ b/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryConnector.kt @@ -18,25 +18,19 @@ package org.partiql.plugins.memory import com.amazon.ionelement.api.StructElement import org.partiql.spi.connector.Connector import org.partiql.spi.connector.ConnectorBindings -import org.partiql.spi.connector.ConnectorFnProvider +import org.partiql.spi.connector.ConnectorMetadata import org.partiql.spi.connector.ConnectorSession -import org.partiql.spi.connector.sql.SqlConnector -import org.partiql.spi.connector.sql.SqlMetadata -import org.partiql.spi.fn.FnExperimental /** * This is a plugin used for testing and is not a versioned API per semver. */ -public class MemoryConnector(private val catalog: MemoryCatalog) : SqlConnector() { +public class MemoryConnector(private val catalog: MemoryCatalog) : Connector { private val bindings = MemoryBindings(catalog) override fun getBindings(): ConnectorBindings = bindings - override fun getMetadata(session: ConnectorSession): SqlMetadata = MemoryMetadata(catalog, session, catalog.infoSchema) - - @OptIn(FnExperimental::class) - override fun getFunctions(): ConnectorFnProvider = catalog.getFunctions() + override fun getMetadata(session: ConnectorSession): ConnectorMetadata = MemoryMetadata(catalog) internal class Factory(private val catalogs: List) : Connector.Factory { @@ -48,13 +42,4 @@ public class MemoryConnector(private val catalog: MemoryCatalog) : SqlConnector( return MemoryConnector(catalog) } } - - public companion object { - - /** - * A connector whose catalogs holds no binding and all SQL-92 function and PartiQL-Builtin - */ - @JvmStatic - public fun partiQL(): MemoryConnector = MemoryConnector(MemoryCatalog.PartiQL().name("default").build()) - } } diff --git a/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryMetadata.kt b/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryMetadata.kt index 2818d85803..9e1182fca9 100644 --- a/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryMetadata.kt +++ b/plugins/partiql-memory/src/main/kotlin/org/partiql/plugins/memory/MemoryMetadata.kt @@ -2,23 +2,11 @@ package org.partiql.plugins.memory import org.partiql.spi.BindingPath import org.partiql.spi.connector.ConnectorHandle -import org.partiql.spi.connector.ConnectorSession -import org.partiql.spi.connector.sql.SqlMetadata -import org.partiql.spi.connector.sql.info.InfoSchema -import org.partiql.spi.fn.FnExperimental +import org.partiql.spi.connector.ConnectorMetadata -internal class MemoryMetadata( - private val catalog: MemoryCatalog, - session: ConnectorSession, - info: InfoSchema, -) : SqlMetadata(session, info) { +internal class MemoryMetadata(private val catalog: MemoryCatalog) : ConnectorMetadata { override fun getObject(path: BindingPath): ConnectorHandle.Obj? { - return super.getObject(path) ?: catalog.find(path) - } - - @FnExperimental - override fun getFunction(path: BindingPath): ConnectorHandle.Fn? { - return super.getFunction(path) + return catalog.find(path) } } 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")