From b4eed3fc35e7e96564354157b9fd1efcf37b4f93 Mon Sep 17 00:00:00 2001 From: "R. C. Howell" Date: Fri, 26 Jul 2024 14:23:39 -0700 Subject: [PATCH] Intermediate internalization of functions to planner --- .../org/partiql/eval/internal/Compiler.kt | 6 +- .../org/partiql/eval/internal/Symbols.kt | 2 +- .../eval/internal/operator/Operator.kt | 2 +- .../org/partiql/planner/internal/Env.kt | 24 +-- .../partiql/planner/internal/FnComparator.kt | 7 +- .../org/partiql/planner/internal/FnMatch.kt | 5 +- .../partiql/planner/internal/FnResolver.kt | 5 +- .../planner/internal/PathResolverAgg.kt | 20 --- .../planner/internal/PathResolverFn.kt | 32 ---- .../org/partiql/planner/internal/fn/Agg.kt | 1 - .../planner/internal/fn/AggSignature.kt | 1 - .../org/partiql/planner/internal/fn/Fn.kt | 1 - .../planner/internal/fn/FnParameter.kt | 1 - .../planner/internal/fn/FnSignature.kt | 1 - .../org/partiql/planner/internal/fn/Index.kt | 76 -------- .../partiql/planner/internal/fn/IndexMap.kt | 23 --- .../internal/fn/{sql => }/SqlBuiltins.kt | 19 +- .../planner/internal/fn/SqlFnProvider.kt | 33 ++++ .../internal/fn/{sql => }/builtins/AggAny.kt | 19 +- .../internal/fn/{sql => }/builtins/AggAvg.kt | 47 +++-- .../fn/{sql => }/builtins/AggCount.kt | 15 +- .../fn/{sql => }/builtins/AggEvery.kt | 19 +- .../fn/{sql => }/builtins/AggGroupAs.kt | 15 +- .../internal/fn/{sql => }/builtins/AggMax.kt | 47 +++-- .../internal/fn/{sql => }/builtins/AggMin.kt | 47 +++-- .../internal/fn/{sql => }/builtins/AggSome.kt | 19 +- .../internal/fn/{sql => }/builtins/AggSum.kt | 47 +++-- .../internal/fn/{sql => }/builtins/FnAbs.kt | 27 +-- .../internal/fn/{sql => }/builtins/FnAnd.kt | 12 +- .../fn/{sql => }/builtins/FnBetween.kt | 38 ++-- .../fn/{sql => }/builtins/FnBitLength.kt | 17 +- .../fn/{sql => }/builtins/FnBitwiseAnd.kt | 20 +-- .../fn/{sql => }/builtins/FnCardinality.kt | 18 +- .../fn/{sql => }/builtins/FnCharLength.kt | 16 +- .../fn/{sql => }/builtins/FnCollAgg.kt | 29 ++- .../fn/{sql => }/builtins/FnConcat.kt | 16 +- .../fn/{sql => }/builtins/FnCurrentDate.kt | 10 +- .../fn/{sql => }/builtins/FnCurrentUser.kt | 10 +- .../fn/{sql => }/builtins/FnDateAddDay.kt | 30 ++-- .../fn/{sql => }/builtins/FnDateAddHour.kt | 34 ++-- .../fn/{sql => }/builtins/FnDateAddMinute.kt | 34 ++-- .../fn/{sql => }/builtins/FnDateAddMonth.kt | 34 ++-- .../fn/{sql => }/builtins/FnDateAddSecond.kt | 34 ++-- .../fn/{sql => }/builtins/FnDateAddYear.kt | 34 ++-- .../fn/{sql => }/builtins/FnDateDiffDay.kt | 14 +- .../fn/{sql => }/builtins/FnDateDiffHour.kt | 14 +- .../fn/{sql => }/builtins/FnDateDiffMinute.kt | 14 +- .../fn/{sql => }/builtins/FnDateDiffMonth.kt | 14 +- .../fn/{sql => }/builtins/FnDateDiffSecond.kt | 14 +- .../fn/{sql => }/builtins/FnDateDiffYear.kt | 14 +- .../fn/{sql => }/builtins/FnDivide.kt | 26 +-- .../internal/fn/{sql => }/builtins/FnEq.kt | 15 +- .../fn/{sql/exts => builtins}/FnExists.kt | 17 +- .../fn/{sql => }/builtins/FnExtract.kt | 49 +++--- .../internal/fn/{sql => }/builtins/FnGt.kt | 38 ++-- .../internal/fn/{sql => }/builtins/FnGte.kt | 38 ++-- .../fn/{sql => }/builtins/FnInCollection.kt | 166 +++++++++--------- .../internal/fn/{sql => }/builtins/FnIsAny.kt | 12 +- .../internal/fn/{sql => }/builtins/FnIsBag.kt | 12 +- .../fn/{sql => }/builtins/FnIsBinary.kt | 12 +- .../fn/{sql => }/builtins/FnIsBlob.kt | 12 +- .../fn/{sql => }/builtins/FnIsBool.kt | 12 +- .../fn/{sql => }/builtins/FnIsByte.kt | 12 +- .../fn/{sql => }/builtins/FnIsChar.kt | 14 +- .../fn/{sql => }/builtins/FnIsClob.kt | 12 +- .../fn/{sql => }/builtins/FnIsDate.kt | 12 +- .../fn/{sql => }/builtins/FnIsDecimal.kt | 14 +- .../builtins/FnIsDecimalArbitrary.kt | 12 +- .../fn/{sql => }/builtins/FnIsFloat32.kt | 12 +- .../fn/{sql => }/builtins/FnIsFloat64.kt | 12 +- .../internal/fn/{sql => }/builtins/FnIsInt.kt | 12 +- .../fn/{sql => }/builtins/FnIsInt16.kt | 12 +- .../fn/{sql => }/builtins/FnIsInt32.kt | 12 +- .../fn/{sql => }/builtins/FnIsInt64.kt | 12 +- .../fn/{sql => }/builtins/FnIsInt8.kt | 12 +- .../fn/{sql => }/builtins/FnIsInterval.kt | 12 +- .../fn/{sql => }/builtins/FnIsList.kt | 12 +- .../fn/{sql => }/builtins/FnIsMissing.kt | 12 +- .../fn/{sql => }/builtins/FnIsNull.kt | 15 +- .../fn/{sql => }/builtins/FnIsSexp.kt | 12 +- .../fn/{sql => }/builtins/FnIsString.kt | 14 +- .../fn/{sql => }/builtins/FnIsStruct.kt | 12 +- .../fn/{sql => }/builtins/FnIsSymbol.kt | 12 +- .../fn/{sql => }/builtins/FnIsTime.kt | 14 +- .../fn/{sql => }/builtins/FnIsTimestamp.kt | 14 +- .../internal/fn/{sql => }/builtins/FnLike.kt | 19 +- .../fn/{sql => }/builtins/FnLikeEscape.kt | 21 ++- .../internal/fn/{sql => }/builtins/FnLower.kt | 16 +- .../internal/fn/{sql => }/builtins/FnLt.kt | 38 ++-- .../internal/fn/{sql => }/builtins/FnLte.kt | 38 ++-- .../internal/fn/{sql => }/builtins/FnMinus.kt | 27 +-- .../fn/{sql => }/builtins/FnModulo.kt | 26 +-- .../internal/fn/{sql => }/builtins/FnNeg.kt | 27 +-- .../internal/fn/{sql => }/builtins/FnNot.kt | 12 +- .../fn/{sql => }/builtins/FnOctetLength.kt | 16 +- .../internal/fn/{sql => }/builtins/FnOr.kt | 12 +- .../internal/fn/{sql => }/builtins/FnPlus.kt | 27 +-- .../internal/fn/{sql => }/builtins/FnPos.kt | 26 +-- .../fn/{sql => }/builtins/FnPosition.kt | 17 +- .../fn/{sql/exts => builtins}/FnSize.kt | 17 +- .../fn/{sql => }/builtins/FnSubstring.kt | 78 +++++--- .../internal/fn/{sql => }/builtins/FnTimes.kt | 27 +-- .../internal/fn/{sql => }/builtins/FnTrim.kt | 18 +- .../fn/{sql => }/builtins/FnTrimChars.kt | 17 +- .../fn/{sql => }/builtins/FnTrimLeading.kt | 17 +- .../{sql => }/builtins/FnTrimLeadingChars.kt | 17 +- .../fn/{sql => }/builtins/FnTrimTrailing.kt | 17 +- .../{sql => }/builtins/FnTrimTrailingChars.kt | 17 +- .../internal/fn/{sql => }/builtins/FnUpper.kt | 16 +- .../fn/{sql => }/builtins/FnUtcnow.kt | 10 +- .../builtins/internal/Accumulator.kt | 12 +- .../builtins/internal/AccumulatorAnySome.kt | 2 +- .../builtins/internal/AccumulatorAvg.kt | 4 +- .../builtins/internal/AccumulatorCount.kt | 2 +- .../builtins/internal/AccumulatorCountStar.kt | 7 +- .../builtins/internal/AccumulatorEvery.kt | 2 +- .../builtins/internal/AccumulatorGroupAs.kt | 2 +- .../builtins/internal/AccumulatorMax.kt | 2 +- .../builtins/internal/AccumulatorMin.kt | 2 +- .../builtins/internal/AccumulatorSum.kt | 4 +- .../planner/internal/fn/sql/PartiQLExts.kt | 23 --- .../partiql/planner/internal/fn/sql/SqlAgg.kt | 35 ---- .../planner/internal/fn/sql/SqlAggProvider.kt | 33 ---- .../planner/internal/fn/sql/SqlBindings.kt | 32 ---- .../planner/internal/fn/sql/SqlConnector.kt | 53 ------ .../partiql/planner/internal/fn/sql/SqlFn.kt | 34 ---- .../planner/internal/fn/sql/SqlFnProvider.kt | 32 ---- .../planner/internal/fn/sql/SqlMetadata.kt | 65 ------- .../internal/fn/sql/info/InfoSchema.kt | 54 ------ .../planner/internal/fn/sql/info/InfoView.kt | 16 -- .../internal/fn/sql/info/InfoViewRoutines.kt | 35 ---- .../fn/{sql => }/utils/PatternUtils.kt | 4 +- .../fn/{sql => }/utils/StringUtils.kt | 2 +- .../org/partiql/planner/internal/ir/Nodes.kt | 6 +- .../planner/internal/transforms/Symbols.kt | 6 +- .../planner/internal/typer/PlanTyper.kt | 10 +- 136 files changed, 1152 insertions(+), 1629 deletions(-) delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/PathResolverAgg.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/PathResolverFn.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/Index.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/IndexMap.kt rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/SqlBuiltins.kt (97%) create mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlFnProvider.kt rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/AggAny.kt (63%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/AggAvg.kt (74%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/AggCount.kt (57%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/AggEvery.kt (63%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/AggGroupAs.kt (57%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/AggMax.kt (73%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/AggMin.kt (73%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/AggSome.kt (63%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/AggSum.kt (73%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnAbs.kt (87%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnAnd.kt (81%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnBetween.kt (91%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnBitLength.kt (83%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnBitwiseAnd.kt (87%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnCardinality.kt (83%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnCharLength.kt (83%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnCollAgg.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnConcat.kt (85%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnCurrentDate.kt (71%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnCurrentUser.kt (71%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateAddDay.kt (86%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateAddHour.kt (85%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateAddMinute.kt (85%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateAddMonth.kt (85%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateAddSecond.kt (85%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateAddYear.kt (85%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateDiffDay.kt (79%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateDiffHour.kt (79%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateDiffMinute.kt (79%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateDiffMonth.kt (79%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateDiffSecond.kt (79%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDateDiffYear.kt (79%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnDivide.kt (89%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnEq.kt (81%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql/exts => builtins}/FnExists.kt (84%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnExtract.kt (88%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnGt.kt (89%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnGte.kt (89%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnInCollection.kt (92%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsAny.kt (70%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsBag.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsBinary.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsBlob.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsBool.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsByte.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsChar.kt (83%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsClob.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsDate.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsDecimal.kt (89%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsDecimalArbitrary.kt (73%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsFloat32.kt (78%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsFloat64.kt (76%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsInt.kt (79%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsInt16.kt (85%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsInt32.kt (84%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsInt64.kt (83%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsInt8.kt (86%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsInterval.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsList.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsMissing.kt (74%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsNull.kt (68%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsSexp.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsString.kt (82%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsStruct.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsSymbol.kt (72%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsTime.kt (79%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnIsTimestamp.kt (79%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnLike.kt (85%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnLikeEscape.kt (87%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnLower.kt (82%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnLt.kt (89%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnLte.kt (89%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnMinus.kt (89%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnModulo.kt (89%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnNeg.kt (86%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnNot.kt (74%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnOctetLength.kt (83%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnOr.kt (79%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnPlus.kt (88%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnPos.kt (82%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnPosition.kt (83%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql/exts => builtins}/FnSize.kt (83%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnSubstring.kt (77%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnTimes.kt (89%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnTrim.kt (87%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnTrimChars.kt (84%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnTrimLeading.kt (81%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnTrimLeadingChars.kt (84%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnTrimTrailing.kt (81%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnTrimTrailingChars.kt (84%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnUpper.kt (83%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/FnUtcnow.kt (75%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/internal/Accumulator.kt (97%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/internal/AccumulatorAnySome.kt (89%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/internal/AccumulatorAvg.kt (91%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/internal/AccumulatorCount.kt (86%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/internal/AccumulatorCountStar.kt (64%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/internal/AccumulatorEvery.kt (90%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/internal/AccumulatorGroupAs.kt (86%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/internal/AccumulatorMax.kt (88%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/internal/AccumulatorMin.kt (87%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/builtins/internal/AccumulatorSum.kt (91%) delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/PartiQLExts.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlAgg.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlAggProvider.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlBindings.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlConnector.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlFn.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlFnProvider.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlMetadata.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoSchema.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoView.kt delete mode 100644 partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoViewRoutines.kt rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/utils/PatternUtils.kt (98%) rename partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/{sql => }/utils/StringUtils.kt (99%) 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..6accc02d31 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 @@ -179,7 +179,7 @@ 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 +212,7 @@ 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 +225,7 @@ 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..5987b5bb88 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 @@ -20,7 +20,7 @@ import org.partiql.spi.fn.FnExperimental * * @property catalogs */ -@OptIn(FnExperimental::class) + internal class Symbols private constructor(private val catalogs: Array) { private class C( 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..216e0fc398 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 @@ -30,7 +30,7 @@ internal sealed interface Operator { interface Aggregation : Operator { - @OptIn(FnExperimental::class) + val delegate: Agg val args: List 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..3a54ee6993 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 @@ -4,6 +4,7 @@ import org.partiql.planner.catalog.Name import org.partiql.planner.catalog.Session import org.partiql.planner.internal.casts.CastTable import org.partiql.planner.internal.casts.Coercions +import org.partiql.planner.internal.fn.AggSignature import org.partiql.planner.internal.ir.Ref import org.partiql.planner.internal.ir.Rel import org.partiql.planner.internal.ir.Rex @@ -22,8 +23,8 @@ 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.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnExperimental import org.partiql.types.PType import org.partiql.types.PType.Kind @@ -52,16 +53,6 @@ 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. - */ - private val fns: PathResolverFn = PathResolverFn(catalog, catalogs, session) - - /** - * A [PathResolver] for aggregation function lookup. - */ - private val aggs: PathResolverAgg = PathResolverAgg(catalog, catalogs, session) - /** * This function looks up a global [BindingPath], returning a global reference expression. * @@ -84,8 +75,7 @@ internal class Env(private val session: Session) { val tail = path.steps.drop(depth) 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 @@ -144,7 +134,6 @@ 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? { // TODO: Eventually, do we want to support sensitive lookup? With a path? val path = BindingPath(listOf(BindingName(name, BindingCase.INSENSITIVE))) @@ -217,7 +206,7 @@ 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 +232,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 +248,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..5996c59621 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.planner.internal.fn.FnParameter +import org.partiql.planner.internal.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..cf6d1336e3 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.fn.FnSignature 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..c1ba79edc5 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,8 +4,7 @@ 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.planner.internal.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/fn/Agg.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/Agg.kt index 7477e33e49..8119a1f220 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/Agg.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/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-planner/src/main/kotlin/org/partiql/planner/internal/fn/AggSignature.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/AggSignature.kt index 4c197c76ae..76103cef56 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/AggSignature.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/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-planner/src/main/kotlin/org/partiql/planner/internal/fn/Fn.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/Fn.kt index ed4e41ff87..02dd3bef62 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/Fn.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/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-planner/src/main/kotlin/org/partiql/planner/internal/fn/FnParameter.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/FnParameter.kt index d2448be80b..47c44c3402 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/FnParameter.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/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-planner/src/main/kotlin/org/partiql/planner/internal/fn/FnSignature.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/FnSignature.kt index 71595ae0a2..82e48e8058 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/FnSignature.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/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-planner/src/main/kotlin/org/partiql/planner/internal/fn/Index.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/Index.kt deleted file mode 100644 index 218bc5d373..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/Index.kt +++ /dev/null @@ -1,76 +0,0 @@ -package org.partiql.planner.internal.fn - -import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/IndexMap.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/IndexMap.kt deleted file mode 100644 index 2587897455..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/IndexMap.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.partiql.planner.internal.fn - -import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlBuiltins.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlBuiltins.kt similarity index 97% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlBuiltins.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlBuiltins.kt index b52a423b36..a920ffc6fc 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlBuiltins.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlBuiltins.kt @@ -1,15 +1,11 @@ -package org.partiql.planner.internal.fn.sql +package org.partiql.planner.internal.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.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlFnProvider.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlFnProvider.kt new file mode 100644 index 0000000000..2f6f5bab9a --- /dev/null +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/SqlFnProvider.kt @@ -0,0 +1,33 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at: + * + * http://aws.amazon.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific + * language governing permissions and limitations under the License. + */ + +package org.partiql.planner.internal.fn + +/** + * TODO !! TEMPORARY AS FUNCTIONS ARE MOVED FROM CONNECTORS TO PLANNER. + */ +public object SqlFnProvider { + + // planner and evaluator lookup + private val fnNameIndex: Map = SqlBuiltins.builtins.associateBy { it.signature.name } + private val fnSpecIndex: Map = SqlBuiltins.builtins.associateBy { it.signature.specific } + public fun getFnByName(name: String): Fn? = fnNameIndex[name] + public fun getFnBySpecific(specific: String): Fn? = fnSpecIndex[specific] + + // planner and evaluator lookup + private val aggNameIndex: Map = SqlBuiltins.aggregations.associateBy { it.signature.name } + private val aggSpecIndex: Map = SqlBuiltins.aggregations.associateBy { it.signature.specific } + public fun getAggByName(name: String): Agg? = aggNameIndex[name] + public fun getAggBySpecific(specific: String): Agg? = aggSpecIndex[specific] +} diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggAny.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggAny.kt similarity index 63% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggAny.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggAny.kt index a9ab32fe54..f28101941b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggAny.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggAny.kt @@ -1,19 +1,18 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggAvg.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggAvg.kt similarity index 74% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggAvg.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggAvg.kt index 6487fcd5aa..9cc1f7ea86 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggAvg.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggAvg.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggCount.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggCount.kt similarity index 57% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggCount.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggCount.kt index 163f751ef5..675035561f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggCount.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggCount.kt @@ -1,19 +1,18 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggEvery.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggEvery.kt similarity index 63% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggEvery.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggEvery.kt index 6094fa33eb..529128214b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggEvery.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggEvery.kt @@ -1,19 +1,18 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggGroupAs.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggGroupAs.kt similarity index 57% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggGroupAs.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggGroupAs.kt index 74d29d84b4..acacf90491 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggGroupAs.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggGroupAs.kt @@ -1,18 +1,17 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggMax.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggMax.kt similarity index 73% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggMax.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggMax.kt index 7875a17811..b2148ba40a 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggMax.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggMax.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggMin.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggMin.kt similarity index 73% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggMin.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggMin.kt index 9b4a30cb49..dfa2af13f1 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggMin.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggMin.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggSome.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggSome.kt similarity index 63% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggSome.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggSome.kt index 62e76690f2..3a4eb6e67a 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggSome.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggSome.kt @@ -1,19 +1,18 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggSum.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggSum.kt similarity index 73% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggSum.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggSum.kt index b65ae29a70..e34003157b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/AggSum.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/AggSum.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnAbs.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAbs.kt similarity index 87% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnAbs.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAbs.kt index 984cd827d1..c85d15b69a 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnAbs.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAbs.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue import org.partiql.value.Float32Value import org.partiql.value.Float64Value @@ -37,7 +37,8 @@ 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 +55,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 +72,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 +89,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 +106,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 +123,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 +140,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 +157,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnAnd.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAnd.kt similarity index 81% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnAnd.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAnd.kt index 134328d5c5..40f15afb94 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnAnd.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnAnd.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,7 +14,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnBetween.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBetween.kt similarity index 91% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnBetween.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBetween.kt index 762ae4f01d..b65f5e1d7b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnBetween.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBetween.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue import org.partiql.value.DateValue import org.partiql.value.DecimalValue @@ -40,7 +40,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 +63,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 +86,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 +109,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 +132,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 +155,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 +178,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 +201,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 +224,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 +247,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 +270,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 +293,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 +316,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 +339,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnBitLength.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitLength.kt similarity index 83% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnBitLength.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitLength.kt index 67f0783cb6..856ee9cb1f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnBitLength.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitLength.kt @@ -1,9 +1,9 @@ -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue import org.partiql.value.Int32Value import org.partiql.value.PartiQLValue @@ -14,7 +14,8 @@ 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 +35,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 +55,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnBitwiseAnd.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitwiseAnd.kt similarity index 87% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnBitwiseAnd.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitwiseAnd.kt index cc70a36b2b..235f999f44 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnBitwiseAnd.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnBitwiseAnd.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value import org.partiql.value.Int32Value import org.partiql.value.Int64Value @@ -27,7 +27,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 +48,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 +69,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 +90,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 +111,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCardinality.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCardinality.kt similarity index 83% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCardinality.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCardinality.kt index 367693790c..62934af09e 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCardinality.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCardinality.kt @@ -1,9 +1,9 @@ -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BagValue import org.partiql.value.ListValue import org.partiql.value.PartiQLValue @@ -14,7 +14,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 +33,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 +52,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 +71,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCharLength.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCharLength.kt similarity index 83% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCharLength.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCharLength.kt index 137888db1c..04fa1e2550 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCharLength.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCharLength.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue import org.partiql.value.Int32Value import org.partiql.value.PartiQLValue @@ -20,7 +20,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 +39,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 +58,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCollAgg.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCollAgg.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCollAgg.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCollAgg.kt index 2ddcf13efb..391402b80d 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCollAgg.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCollAgg.kt @@ -1,28 +1,25 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Agg +import org.partiql.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.fn.builtins.internal.Accumulator +import org.partiql.planner.internal.fn.builtins.internal.AccumulatorAnySome +import org.partiql.planner.internal.fn.builtins.internal.AccumulatorAvg +import org.partiql.planner.internal.fn.builtins.internal.AccumulatorCount +import org.partiql.planner.internal.fn.builtins.internal.AccumulatorEvery +import org.partiql.planner.internal.fn.builtins.internal.AccumulatorMax +import org.partiql.planner.internal.fn.builtins.internal.AccumulatorMin +import org.partiql.planner.internal.fn.builtins.internal.AccumulatorSum import org.partiql.value.BagValue import org.partiql.value.PartiQLValue -import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType import org.partiql.value.check -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) internal abstract class Fn_COLL_AGG__BAG__ANY : Fn { abstract fun getAccumulator(): Agg.Accumulator diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnConcat.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnConcat.kt similarity index 85% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnConcat.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnConcat.kt index c670d758bb..91421ec3a9 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnConcat.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnConcat.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -20,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_CONCAT__STRING_STRING__STRING : Fn { override val signature = FnSignature( @@ -41,7 +41,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 +62,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCurrentDate.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentDate.kt similarity index 71% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCurrentDate.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentDate.kt index 191d508172..8a96d53731 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCurrentDate.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentDate.kt @@ -1,16 +1,16 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.fn.builtins -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.FnSignature +import org.partiql.planner.internal.fn.Fn + +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCurrentUser.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentUser.kt similarity index 71% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCurrentUser.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentUser.kt index 1aad0cba5b..0b6d269d8e 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnCurrentUser.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnCurrentUser.kt @@ -1,16 +1,16 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.fn.builtins -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.FnSignature +import org.partiql.planner.internal.fn.Fn + +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddDay.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddDay.kt similarity index 86% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddDay.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddDay.kt index 7d00a4bb30..9db3cb5c3c 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddDay.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddDay.kt @@ -1,14 +1,14 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DateValue import org.partiql.value.Int32Value import org.partiql.value.Int64Value @@ -25,7 +25,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 +48,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 +71,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 +89,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 +121,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 +144,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 +162,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddHour.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddHour.kt similarity index 85% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddHour.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddHour.kt index 55198ae647..89f5d3a765 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddHour.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddHour.kt @@ -1,14 +1,14 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int32Value import org.partiql.value.Int64Value import org.partiql.value.IntValue @@ -25,7 +25,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 +48,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 +71,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 +89,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 +121,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 +144,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 +162,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddMinute.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMinute.kt similarity index 85% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddMinute.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMinute.kt index e6ddf23bca..ef97829121 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddMinute.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMinute.kt @@ -1,14 +1,14 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int32Value import org.partiql.value.Int64Value import org.partiql.value.IntValue @@ -25,7 +25,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 +48,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 +71,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 +89,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 +121,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 +144,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 +162,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddMonth.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMonth.kt similarity index 85% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddMonth.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMonth.kt index c44a67eaeb..580267eda1 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddMonth.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddMonth.kt @@ -1,14 +1,14 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DateValue import org.partiql.value.Int32Value import org.partiql.value.Int64Value @@ -25,7 +25,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 +48,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 +71,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 +89,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 +121,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 +144,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 +162,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddSecond.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddSecond.kt similarity index 85% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddSecond.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddSecond.kt index cd56c9058f..318f12efdb 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddSecond.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddSecond.kt @@ -1,14 +1,14 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int32Value import org.partiql.value.Int64Value import org.partiql.value.IntValue @@ -25,7 +25,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 +48,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 +71,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 +89,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 +121,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 +144,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 +162,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddYear.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddYear.kt similarity index 85% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddYear.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddYear.kt index 251d4f0a9d..1dc8602523 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateAddYear.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateAddYear.kt @@ -1,14 +1,14 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DateValue import org.partiql.value.Int32Value import org.partiql.value.Int64Value @@ -25,7 +25,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 +48,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 +71,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 +89,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 +121,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 +144,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 +162,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffDay.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffDay.kt similarity index 79% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffDay.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffDay.kt index 129dbce9db..77a026730b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffDay.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffDay.kt @@ -1,19 +1,19 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.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 +32,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffHour.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffHour.kt similarity index 79% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffHour.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffHour.kt index b6b85d47bb..90ef086feb 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffHour.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffHour.kt @@ -1,19 +1,19 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.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 +32,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffMinute.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMinute.kt similarity index 79% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffMinute.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMinute.kt index df56be84ea..f18fd67a99 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffMinute.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMinute.kt @@ -1,19 +1,19 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.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 +32,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffMonth.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMonth.kt similarity index 79% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffMonth.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMonth.kt index 50d30fe7dc..e9704c516d 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffMonth.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffMonth.kt @@ -1,19 +1,19 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.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 +32,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffSecond.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffSecond.kt similarity index 79% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffSecond.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffSecond.kt index 444d0911ca..194c848c7a 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffSecond.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffSecond.kt @@ -1,19 +1,19 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.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 +32,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffYear.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffYear.kt similarity index 79% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffYear.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffYear.kt index 8ab1d361bd..75c07249a7 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDateDiffYear.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDateDiffYear.kt @@ -1,19 +1,19 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.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 +32,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDivide.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDivide.kt similarity index 89% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDivide.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDivide.kt index 8abe84bf60..9ebbcdcb5b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnDivide.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnDivide.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue import org.partiql.value.Float32Value import org.partiql.value.Float64Value @@ -36,7 +36,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 +57,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 +78,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 +99,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 +120,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 +141,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 +162,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 +183,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnEq.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnEq.kt similarity index 81% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnEq.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnEq.kt index aeedd74a83..468ba01a44 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnEq.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnEq.kt @@ -1,17 +1,16 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY import org.partiql.value.PartiQLValueType.BOOL -import org.partiql.value.PartiQLValueType.MISSING import org.partiql.value.boolValue /** @@ -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() @@ -49,7 +48,7 @@ internal object Fn_EQ__ANY_ANY__BOOL : Fn { override fun invoke(args: Array): PartiQLValue { val lhs = args[0] val rhs = args[1] - if (lhs.type == MISSING || rhs.type == MISSING) { + if (lhs.type == ANY || rhs.type == ANY) { return boolValue(null) } return boolValue(comparator.compare(lhs, rhs) == 0) diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/exts/FnExists.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnExists.kt similarity index 84% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/exts/FnExists.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnExists.kt index 43fe1084d5..ba4b75ff68 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/exts/FnExists.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnExists.kt @@ -1,9 +1,8 @@ -package org.partiql.planner.internal.fn.sql.exts +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BagValue import org.partiql.value.ListValue import org.partiql.value.PartiQLValue @@ -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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnExtract.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnExtract.kt similarity index 88% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnExtract.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnExtract.kt index 7387e52409..5060d6ee95 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnExtract.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnExtract.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DateValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -25,7 +25,8 @@ 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 +45,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 +67,8 @@ 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 +87,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 +110,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 +129,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 +151,8 @@ 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 +171,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 +193,8 @@ 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 +213,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 +235,8 @@ 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 +255,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 +277,8 @@ 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 +301,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 +327,8 @@ 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 +351,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnGt.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGt.kt similarity index 89% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnGt.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGt.kt index 501b51147c..76c9b9f233 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnGt.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGt.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue import org.partiql.value.DateValue import org.partiql.value.DecimalValue @@ -40,7 +40,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 +61,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 +82,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 +103,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 +124,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 +145,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 +166,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 +187,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 +208,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 +229,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 +250,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 +271,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 +292,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 +313,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnGte.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGte.kt similarity index 89% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnGte.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGte.kt index e3de57f7ef..57d1bac674 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnGte.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnGte.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue import org.partiql.value.DateValue import org.partiql.value.DecimalValue @@ -40,7 +40,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 +61,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 +82,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 +103,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 +124,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 +145,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 +166,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 +187,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 +208,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 +229,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 +250,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 +271,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 +292,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 +313,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnInCollection.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnInCollection.kt similarity index 92% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnInCollection.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnInCollection.kt index 03d94fdef4..0cf8d14089 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnInCollection.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnInCollection.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BagValue import org.partiql.value.BinaryValue import org.partiql.value.BlobValue @@ -62,7 +62,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 +90,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 +118,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 +146,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 +174,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 +202,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 +230,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 +258,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 +286,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 +314,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 +342,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 +370,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 +398,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 +426,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 +454,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 +482,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 +510,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 +538,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 +566,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 +594,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 +622,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 +650,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 +678,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 +706,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 +734,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 +762,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 +790,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 +818,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 +846,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 +874,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 +902,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 +930,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 +958,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 +986,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 +1014,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 +1042,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 +1070,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 +1098,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 +1126,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 +1154,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 +1182,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 +1210,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 +1238,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 +1266,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 +1294,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 +1322,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 +1350,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 +1378,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 +1406,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 +1434,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 +1462,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 +1490,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 +1518,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 +1546,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 +1574,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 +1602,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 +1630,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 +1658,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 +1686,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 +1714,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 +1742,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 +1770,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 +1798,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 +1826,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 +1854,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 +1882,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 +1910,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 +1938,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 +1966,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 +1994,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 +2022,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 +2050,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 +2078,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 +2106,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 +2134,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 +2162,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 +2190,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 +2218,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsAny.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsAny.kt similarity index 70% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsAny.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsAny.kt index 152ba74666..9d3d3e89b5 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsAny.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsAny.kt @@ -1,18 +1,18 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBag.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBag.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBag.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBag.kt index 779295c1e5..60db2f5e6f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBag.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBag.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BagValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_BAG__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBinary.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBinary.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBinary.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBinary.kt index 5f602dff58..e18c662121 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBinary.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBinary.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BinaryValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_BINARY__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBlob.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBlob.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBlob.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBlob.kt index 0edf621340..d20c9459db 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBlob.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBlob.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BlobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_BLOB__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBool.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBool.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBool.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBool.kt index 83967c68f9..fafee6415c 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsBool.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsBool.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_BOOL__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsByte.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsByte.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsByte.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsByte.kt index 78bf451b53..ef5ea5a880 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsByte.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsByte.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ByteValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_BYTE__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsChar.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsChar.kt similarity index 83% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsChar.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsChar.kt index 5c5644bece..affb7e60b2 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsChar.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsChar.kt @@ -1,13 +1,13 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.CharValue import org.partiql.value.Int32Value import org.partiql.value.PartiQLValue @@ -19,7 +19,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 +35,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsClob.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsClob.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsClob.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsClob.kt index 6154a10545..43862e32d6 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsClob.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsClob.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_CLOB__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsDate.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDate.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsDate.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDate.kt index c2edd8d510..9fb3b7fd30 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsDate.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDate.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DateValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_DATE__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsDecimal.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimal.kt similarity index 89% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsDecimal.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimal.kt index a1bca2470d..ee99a1fed5 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsDecimal.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimal.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue import org.partiql.value.Int32Value import org.partiql.value.PartiQLValue @@ -19,7 +19,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 +35,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsDecimalArbitrary.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimalArbitrary.kt similarity index 73% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsDecimalArbitrary.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimalArbitrary.kt index e9011c92c2..5fddb2f16e 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsDecimalArbitrary.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsDecimalArbitrary.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_DECIMAL_ARBITRARY__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsFloat32.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat32.kt similarity index 78% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsFloat32.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat32.kt index bc6b6e7b2b..7b902ebaa6 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsFloat32.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat32.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Float32Value import org.partiql.value.Float64Value import org.partiql.value.PartiQLValue @@ -15,7 +15,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsFloat64.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat64.kt similarity index 76% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsFloat64.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat64.kt index d79f8baccc..a75562bb02 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsFloat64.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsFloat64.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Float32Value import org.partiql.value.Float64Value import org.partiql.value.PartiQLValue @@ -15,7 +15,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt.kt similarity index 79% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt.kt index db5f0a4e4a..f38c610b90 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value import org.partiql.value.Int32Value import org.partiql.value.Int64Value @@ -18,7 +18,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt16.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt16.kt similarity index 85% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt16.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt16.kt index f733752ece..0e9e5b6ddf 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt16.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt16.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value import org.partiql.value.Int32Value import org.partiql.value.Int64Value @@ -18,7 +18,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt32.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt32.kt similarity index 84% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt32.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt32.kt index aafb185454..b2c50b67db 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt32.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt32.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value import org.partiql.value.Int32Value import org.partiql.value.Int64Value @@ -18,7 +18,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt64.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt64.kt similarity index 83% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt64.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt64.kt index 431701b972..37291ca156 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt64.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt64.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value import org.partiql.value.Int32Value import org.partiql.value.Int64Value @@ -18,7 +18,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt8.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt8.kt similarity index 86% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt8.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt8.kt index aa5c12ff6f..b6aef74d61 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInt8.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInt8.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int16Value import org.partiql.value.Int32Value import org.partiql.value.Int64Value @@ -18,7 +18,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInterval.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInterval.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInterval.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInterval.kt index 6046d19f7a..bdfa373102 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsInterval.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsInterval.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.IntervalValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_INTERVAL__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsList.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsList.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsList.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsList.kt index 02a45a1cdb..1a8f891f1d 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsList.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsList.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ListValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_LIST__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsMissing.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsMissing.kt similarity index 74% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsMissing.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsMissing.kt index 93252f0e28..6a08bfc77c 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsMissing.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsMissing.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.MissingValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,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_MISSING__ANY__BOOL : Fn { override val signature = FnSignature( diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsNull.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsNull.kt similarity index 68% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsNull.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsNull.kt index ca1ed7d677..841098ad3a 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsNull.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsNull.kt @@ -1,20 +1,19 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY 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( @@ -28,7 +27,7 @@ internal object Fn_IS_NULL__ANY__BOOL : Fn { ) override fun invoke(args: Array): PartiQLValue { - if (args[0].type == MISSING) { + if (args[0].type == ANY) { return boolValue(true) } return boolValue(args[0].isNull) diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsSexp.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSexp.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsSexp.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSexp.kt index c81773f651..c4630d1ab0 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsSexp.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSexp.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY @@ -14,7 +14,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsString.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsString.kt similarity index 82% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsString.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsString.kt index a4f8b45a88..0e052e9678 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsString.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsString.kt @@ -1,13 +1,13 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.Int32Value import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -18,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_STRING__ANY__BOOL : Fn { override val signature = FnSignature( @@ -34,7 +34,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsStruct.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsStruct.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsStruct.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsStruct.kt index 6fe423073b..466ba9551b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsStruct.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsStruct.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY @@ -14,7 +14,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsSymbol.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSymbol.kt similarity index 72% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsSymbol.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSymbol.kt index 19595e81d6..30d38df3ab 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsSymbol.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsSymbol.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY @@ -14,7 +14,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsTime.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTime.kt similarity index 79% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsTime.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTime.kt index 6f55ad88d7..bc5c5c97e3 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsTime.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTime.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY @@ -15,7 +15,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 +31,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsTimestamp.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTimestamp.kt similarity index 79% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsTimestamp.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTimestamp.kt index 11241f580c..c97a7b5bfe 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnIsTimestamp.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnIsTimestamp.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.ANY @@ -15,7 +15,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 +31,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLike.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLike.kt similarity index 85% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLike.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLike.kt index 4a570db264..c5bf79f73f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLike.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLike.kt @@ -1,14 +1,13 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.fn.utils.PatternUtils.matchRegexPattern +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLikeEscape.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLikeEscape.kt similarity index 87% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLikeEscape.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLikeEscape.kt index 0443b69dea..3733d50b5b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLikeEscape.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLikeEscape.kt @@ -1,16 +1,15 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.fn.utils.PatternUtils +import org.partiql.planner.internal.fn.utils.PatternUtils.checkPattern +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLower.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLower.kt similarity index 82% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLower.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLower.kt index c1de41e8ac..076b0ea746 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLower.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLower.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.CLOB @@ -16,7 +16,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 +34,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 +52,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLt.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLt.kt similarity index 89% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLt.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLt.kt index 6761410205..c7f5a580b4 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLt.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLt.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue import org.partiql.value.DateValue import org.partiql.value.DecimalValue @@ -40,7 +40,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 +61,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 +82,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 +103,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 +124,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 +145,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 +166,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 +187,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 +208,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 +229,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 +250,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 +271,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 +292,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 +313,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLte.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLte.kt similarity index 89% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLte.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLte.kt index a0d8da4e13..83a1705b45 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnLte.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnLte.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue import org.partiql.value.DateValue import org.partiql.value.DecimalValue @@ -40,7 +40,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 +61,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 +82,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 +103,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 +124,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 +145,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 +166,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 +187,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 +208,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 +229,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 +250,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 +271,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 +292,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 +313,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnMinus.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnMinus.kt similarity index 89% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnMinus.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnMinus.kt index 3432f42388..ff3f597e1d 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnMinus.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnMinus.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue import org.partiql.value.Float32Value import org.partiql.value.Float64Value @@ -36,7 +36,8 @@ 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 +58,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 +79,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 +100,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 +121,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 +142,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 +163,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 +184,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnModulo.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnModulo.kt similarity index 89% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnModulo.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnModulo.kt index 3943ce63cb..2bc4bffdc8 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnModulo.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnModulo.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue import org.partiql.value.Float32Value import org.partiql.value.Float64Value @@ -37,7 +37,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 +58,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 +79,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 +100,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 +121,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 +142,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 +163,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 +184,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnNeg.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNeg.kt similarity index 86% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnNeg.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNeg.kt index b59309bbc6..3032b9b289 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnNeg.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNeg.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue import org.partiql.value.Float32Value import org.partiql.value.Float64Value @@ -36,7 +36,8 @@ 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 +54,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 +71,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 +88,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 +105,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 +122,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 +139,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 +156,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnNot.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNot.kt similarity index 74% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnNot.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNot.kt index 086584d34f..59c93591e4 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnNot.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnNot.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,7 +14,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnOctetLength.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOctetLength.kt similarity index 83% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnOctetLength.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOctetLength.kt index 7c2385e84a..95380c113a 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnOctetLength.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOctetLength.kt @@ -1,9 +1,9 @@ -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue import org.partiql.value.Int32Value import org.partiql.value.PartiQLValue @@ -13,7 +13,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 +33,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 +53,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnOr.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOr.kt similarity index 79% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnOr.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOr.kt index cd6436f2e7..b654fcfce2 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnOr.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnOr.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BoolValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -14,7 +14,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnPlus.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPlus.kt similarity index 88% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnPlus.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPlus.kt index 1e9aaec61e..2d0fe4fbb0 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnPlus.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPlus.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue import org.partiql.value.Float32Value import org.partiql.value.Float64Value @@ -36,7 +36,8 @@ 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 +58,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 +79,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 +100,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 +121,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 +142,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 +163,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 +184,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnPos.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPos.kt similarity index 82% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnPos.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPos.kt index 71516d09d7..4cce38a92b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnPos.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPos.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.PartiQLValueType.DECIMAL_ARBITRARY @@ -18,7 +18,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 +34,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 +50,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 +66,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 +82,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 +98,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 +114,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 +130,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnPosition.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPosition.kt similarity index 83% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnPosition.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPosition.kt index 61d8ce101b..81558148f9 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnPosition.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnPosition.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/exts/FnSize.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnSize.kt similarity index 83% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/exts/FnSize.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnSize.kt index 36b30d1f93..2fc463297a 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/exts/FnSize.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnSize.kt @@ -1,9 +1,8 @@ -package org.partiql.planner.internal.fn.sql.exts +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.BagValue import org.partiql.value.ListValue import org.partiql.value.PartiQLValue @@ -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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnSubstring.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnSubstring.kt similarity index 77% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnSubstring.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnSubstring.kt index b931864dc7..3e368c2dfb 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnSubstring.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnSubstring.kt @@ -1,15 +1,14 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.fn.utils.StringUtils.codepointSubstring import org.partiql.value.ClobValue import org.partiql.value.Int64Value import org.partiql.value.PartiQLValue @@ -94,7 +93,8 @@ 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 +110,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 +137,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 +169,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 +196,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 +228,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 +255,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTimes.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTimes.kt similarity index 89% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTimes.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTimes.kt index a049a3bfa3..5e62782195 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTimes.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTimes.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.DecimalValue import org.partiql.value.Float32Value import org.partiql.value.Float64Value @@ -36,7 +36,8 @@ 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 +58,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 +79,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 +100,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 +121,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 +142,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 +163,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 +184,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrim.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrim.kt similarity index 87% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrim.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrim.kt index dddc89dc74..2805d707f4 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrim.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrim.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.fn.utils.StringUtils.codepointTrim import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -50,7 +49,8 @@ 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 +68,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 +86,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimChars.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimChars.kt similarity index 84% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimChars.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimChars.kt index cc4da9d8e0..6a9a06fd8d 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimChars.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimChars.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimLeading.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimLeading.kt similarity index 81% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimLeading.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimLeading.kt index d6083b06af..95d4003e7f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimLeading.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimLeading.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimLeadingChars.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimLeadingChars.kt similarity index 84% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimLeadingChars.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimLeadingChars.kt index ec8f340b2f..858038bfd5 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimLeadingChars.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimLeadingChars.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimTrailing.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimTrailing.kt similarity index 81% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimTrailing.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimTrailing.kt index 1bc5119727..9c3bb28985 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimTrailing.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimTrailing.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimTrailingChars.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimTrailingChars.kt similarity index 84% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimTrailingChars.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimTrailingChars.kt index 27ce82ef80..1999c83404 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnTrimTrailingChars.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnTrimTrailingChars.kt @@ -1,13 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature +import org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnUpper.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUpper.kt similarity index 83% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnUpper.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUpper.kt index 06519f2f9e..7fc30a4bd8 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnUpper.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUpper.kt @@ -1,12 +1,12 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.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.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnParameter +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.ClobValue import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental @@ -20,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_UPPER__STRING__STRING : Fn { override val signature = FnSignature( @@ -38,7 +38,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 +56,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnUtcnow.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUtcnow.kt similarity index 75% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnUtcnow.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUtcnow.kt index f44d613ea0..c42c563ae0 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/FnUtcnow.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/FnUtcnow.kt @@ -1,18 +1,18 @@ // ktlint-disable filename @file:Suppress("ClassName") -package org.partiql.planner.internal.fn.sql.builtins +package org.partiql.planner.internal.fn.builtins -import org.partiql.spi.fn.Fn -import org.partiql.spi.fn.FnExperimental -import org.partiql.spi.fn.FnSignature +import org.partiql.planner.internal.fn.Fn + +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental 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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/Accumulator.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/Accumulator.kt similarity index 97% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/Accumulator.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/Accumulator.kt index 3c9eeb8894..5fbd9b008f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/Accumulator.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/Accumulator.kt @@ -14,12 +14,12 @@ @file:OptIn(PartiQLValueExperimental::class) -package org.partiql.planner.internal.fn.sql.builtins.internal +package org.partiql.planner.internal.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.planner.internal.fn.Agg + import org.partiql.value.BoolValue import org.partiql.value.DecimalValue import org.partiql.value.Float32Value @@ -47,7 +47,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]. */ @@ -130,7 +129,7 @@ internal fun checkIsBooleanType(funcName: String, value: PartiQLValue) { } @OptIn(PartiQLValueExperimental::class) -internal fun PartiQLValue.isUnknown(): Boolean = this.type == PartiQLValueType.MISSING || this.isNull +internal fun PartiQLValue.isUnknown(): Boolean = this.type == PartiQLValueType.ANY || this.isNull @OptIn(PartiQLValueExperimental::class) internal fun PartiQLValue.numberValue(): Number = when (this) { @@ -161,7 +160,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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorAnySome.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorAnySome.kt similarity index 89% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorAnySome.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorAnySome.kt index ddfb1342e0..3eba785613 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorAnySome.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorAnySome.kt @@ -1,4 +1,4 @@ -package org.partiql.planner.internal.fn.sql.builtins.internal +package org.partiql.planner.internal.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorAvg.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorAvg.kt similarity index 91% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorAvg.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorAvg.kt index ed3f8237f9..1025292ab9 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorAvg.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorAvg.kt @@ -1,4 +1,4 @@ -package org.partiql.planner.internal.fn.sql.builtins.internal +package org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorCount.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorCount.kt similarity index 86% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorCount.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorCount.kt index c83ec70ae8..e99f030549 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorCount.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorCount.kt @@ -1,4 +1,4 @@ -package org.partiql.planner.internal.fn.sql.builtins.internal +package org.partiql.planner.internal.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorCountStar.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorCountStar.kt similarity index 64% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorCountStar.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorCountStar.kt index a2113209bf..da323db940 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorCountStar.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorCountStar.kt @@ -1,12 +1,11 @@ -package org.partiql.planner.internal.fn.sql.builtins.internal +package org.partiql.planner.internal.fn.builtins.internal -import org.partiql.spi.fn.Agg -import org.partiql.spi.fn.FnExperimental +import org.partiql.planner.internal.fn.Agg import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import org.partiql.value.int64Value -@OptIn(PartiQLValueExperimental::class, FnExperimental::class) +@OptIn(PartiQLValueExperimental::class) internal class AccumulatorCountStar : Agg.Accumulator { var count: Long = 0L diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorEvery.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorEvery.kt similarity index 90% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorEvery.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorEvery.kt index 3d2dc26590..810c43a137 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorEvery.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorEvery.kt @@ -1,4 +1,4 @@ -package org.partiql.planner.internal.fn.sql.builtins.internal +package org.partiql.planner.internal.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorGroupAs.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorGroupAs.kt similarity index 86% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorGroupAs.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorGroupAs.kt index e1d9a4b877..8dcbb8cd74 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorGroupAs.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorGroupAs.kt @@ -1,4 +1,4 @@ -package org.partiql.planner.internal.fn.sql.builtins.internal +package org.partiql.planner.internal.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorMax.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorMax.kt similarity index 88% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorMax.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorMax.kt index 91a3d0c5d1..dc9c2dc1df 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorMax.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorMax.kt @@ -1,4 +1,4 @@ -package org.partiql.planner.internal.fn.sql.builtins.internal +package org.partiql.planner.internal.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorMin.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorMin.kt similarity index 87% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorMin.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorMin.kt index eb9ac373a1..be11254eea 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorMin.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorMin.kt @@ -1,4 +1,4 @@ -package org.partiql.planner.internal.fn.sql.builtins.internal +package org.partiql.planner.internal.fn.builtins.internal import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorSum.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorSum.kt similarity index 91% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorSum.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorSum.kt index 4da993379a..eb74b16a62 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/builtins/internal/AccumulatorSum.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/builtins/internal/AccumulatorSum.kt @@ -1,4 +1,4 @@ -package org.partiql.planner.internal.fn.sql.builtins.internal +package org.partiql.planner.internal.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/PartiQLExts.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/PartiQLExts.kt deleted file mode 100644 index 007f2edabf..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/PartiQLExts.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.partiql.planner.internal.fn.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlAgg.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlAgg.kt deleted file mode 100644 index 880d2de4ef..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/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.planner.internal.fn.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlAggProvider.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlAggProvider.kt deleted file mode 100644 index cfd36e06d9..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/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.planner.internal.fn.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlBindings.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlBindings.kt deleted file mode 100644 index f794f9817a..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/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.planner.internal.fn.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlConnector.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlConnector.kt deleted file mode 100644 index 72af4e008f..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlConnector.kt +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at: - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - */ - -package org.partiql.planner.internal.fn.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): org.partiql.planner.internal.fn.sql.SqlMetadata - - override fun getBindings(): ConnectorBindings = org.partiql.planner.internal.fn.sql.SqlBindings(info) - - @FnExperimental - override fun getFunctions(): ConnectorFnProvider = org.partiql.planner.internal.fn.sql.SqlFnProvider(info.functions) - - @FnExperimental - override fun getAggregations(): ConnectorAggProvider = - org.partiql.planner.internal.fn.sql.SqlAggProvider(info.aggregations) -} diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlFn.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlFn.kt deleted file mode 100644 index dda218c785..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/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.planner.internal.fn.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlFnProvider.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlFnProvider.kt deleted file mode 100644 index 8594ca6696..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/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.planner.internal.fn.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlMetadata.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/SqlMetadata.kt deleted file mode 100644 index 2ee9bfa8d0..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/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.planner.internal.fn.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), org.partiql.planner.internal.fn.sql.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), org.partiql.planner.internal.fn.sql.SqlAgg(name, variants)) - } -} diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoSchema.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoSchema.kt deleted file mode 100644 index 44d45ebd00..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoSchema.kt +++ /dev/null @@ -1,54 +0,0 @@ -package org.partiql.planner.internal.fn.sql.info - -import org.partiql.planner.internal.fn.sql.PartiQLExts -import org.partiql.planner.internal.fn.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(org.partiql.planner.internal.fn.sql.SqlBuiltins.builtins) - .build() - val aggregations = Index.aggBuilder() - .addAll(org.partiql.planner.internal.fn.sql.SqlBuiltins.aggregations) - .build() - return InfoSchema(functions, aggregations) - } - - @OptIn(FnExperimental::class) - public fun ext(): InfoSchema { - val functions = Index.fnBuilder() - .addAll(org.partiql.planner.internal.fn.sql.SqlBuiltins.builtins + org.partiql.planner.internal.fn.sql.PartiQLExts.builtins) - .build() - val aggregations = Index.aggBuilder() - .addAll(org.partiql.planner.internal.fn.sql.SqlBuiltins.aggregations) - .build() - return InfoSchema(functions, aggregations) - } - } -} diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoView.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoView.kt deleted file mode 100644 index 98a0e4343c..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoView.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.partiql.planner.internal.fn.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoViewRoutines.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoViewRoutines.kt deleted file mode 100644 index 238f82aba3..0000000000 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/info/InfoViewRoutines.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.partiql.planner.internal.fn.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-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/utils/PatternUtils.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/utils/PatternUtils.kt similarity index 98% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/utils/PatternUtils.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/utils/PatternUtils.kt index 5366639263..07e24e8049 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/utils/PatternUtils.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/utils/PatternUtils.kt @@ -1,6 +1,6 @@ -package org.partiql.planner.internal.fn.sql.utils +package org.partiql.planner.internal.fn.utils -import org.partiql.spi.connector.sql.utils.StringUtils.codePointSequence +import org.partiql.planner.internal.fn.utils.StringUtils.codePointSequence import java.util.regex.Pattern internal object PatternUtils { diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/utils/StringUtils.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/utils/StringUtils.kt similarity index 99% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/utils/StringUtils.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/utils/StringUtils.kt index f45f7ecd05..24b9e67d99 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/sql/utils/StringUtils.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/fn/utils/StringUtils.kt @@ -1,4 +1,4 @@ -package org.partiql.planner.internal.fn.sql.utils +package org.partiql.planner.internal.fn.utils internal object StringUtils { 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..39dcd508c5 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 @@ -72,9 +72,9 @@ 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.planner.internal.fn.AggSignature +import org.partiql.planner.internal.fn.FnExperimental +import org.partiql.planner.internal.fn.FnSignature import org.partiql.value.PartiQLValue import org.partiql.value.PartiQLValueExperimental import kotlin.collections.Set 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..935743f314 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,7 @@ 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.planner.internal.fn.FnExperimental import org.partiql.plan.Ref as CatalogRef /** @@ -31,13 +31,13 @@ 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..2492ea73d9 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,7 @@ 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.planner.internal.fn.FnExperimental import org.partiql.types.Field import org.partiql.types.PType import org.partiql.types.PType.Kind @@ -804,7 +804,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 +836,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 +1168,7 @@ 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 +1259,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) }