-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splits v1 functions across eval and planner
- Loading branch information
Showing
253 changed files
with
23,711 additions
and
268 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
partiql-eval/src/main/kotlin/org/partiql/eval/internal/functions/AggAny.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// ktlint-disable filename | ||
@file:Suppress("ClassName") | ||
|
||
package org.partiql.spi.connector.sql.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.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 { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "any", | ||
returns = BOOL, | ||
parameters = listOf( | ||
FnParameter("value", BOOL), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAnySome() | ||
} | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_ANY__ANY__BOOL : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "any", | ||
returns = BOOL, | ||
parameters = listOf( | ||
FnParameter("value", ANY), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAnySome() | ||
} |
165 changes: 165 additions & 0 deletions
165
partiql-eval/src/main/kotlin/org/partiql/eval/internal/functions/AggAvg.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
// ktlint-disable filename | ||
@file:Suppress("ClassName") | ||
|
||
package org.partiql.spi.connector.sql.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.value.PartiQLValueExperimental | ||
import org.partiql.value.PartiQLValueType.ANY | ||
import org.partiql.value.PartiQLValueType.DECIMAL | ||
import org.partiql.value.PartiQLValueType.DECIMAL_ARBITRARY | ||
import org.partiql.value.PartiQLValueType.FLOAT32 | ||
import org.partiql.value.PartiQLValueType.FLOAT64 | ||
import org.partiql.value.PartiQLValueType.INT | ||
import org.partiql.value.PartiQLValueType.INT16 | ||
import org.partiql.value.PartiQLValueType.INT32 | ||
import org.partiql.value.PartiQLValueType.INT64 | ||
import org.partiql.value.PartiQLValueType.INT8 | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_AVG__INT8__INT8 : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "avg", | ||
returns = DECIMAL, | ||
parameters = listOf( | ||
FnParameter("value", INT8), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL) | ||
} | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_AVG__INT16__INT16 : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "avg", | ||
returns = DECIMAL, | ||
parameters = listOf( | ||
FnParameter("value", INT16), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL) | ||
} | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_AVG__INT32__INT32 : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "avg", | ||
returns = DECIMAL, | ||
parameters = listOf( | ||
FnParameter("value", INT32), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL) | ||
} | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_AVG__INT64__INT64 : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "avg", | ||
returns = DECIMAL, | ||
parameters = listOf( | ||
FnParameter("value", INT64), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL) | ||
} | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_AVG__INT__INT : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "avg", | ||
returns = DECIMAL_ARBITRARY, | ||
parameters = listOf( | ||
FnParameter("value", INT), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL_ARBITRARY) | ||
} | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_AVG__DECIMAL_ARBITRARY__DECIMAL_ARBITRARY : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "avg", | ||
returns = DECIMAL_ARBITRARY, | ||
parameters = listOf( | ||
FnParameter("value", DECIMAL_ARBITRARY), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL_ARBITRARY) | ||
} | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_AVG__FLOAT32__FLOAT32 : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "avg", | ||
returns = FLOAT32, | ||
parameters = listOf( | ||
FnParameter("value", FLOAT32), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAvg(FLOAT32) | ||
} | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_AVG__FLOAT64__FLOAT64 : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "avg", | ||
returns = FLOAT64, | ||
parameters = listOf( | ||
FnParameter("value", FLOAT64), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAvg(FLOAT64) | ||
} | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_AVG__ANY__ANY : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "avg", | ||
returns = DECIMAL_ARBITRARY, | ||
parameters = listOf( | ||
FnParameter("value", ANY), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorAvg(DECIMAL_ARBITRARY) | ||
} |
29 changes: 29 additions & 0 deletions
29
partiql-eval/src/main/kotlin/org/partiql/eval/internal/functions/AggCount.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// ktlint-disable filename | ||
@file:Suppress("ClassName") | ||
|
||
package org.partiql.spi.connector.sql.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.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 { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "count", | ||
returns = INT64, | ||
parameters = listOf( | ||
FnParameter("value", ANY), | ||
), | ||
isNullable = false, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorCount() | ||
} |
45 changes: 45 additions & 0 deletions
45
partiql-eval/src/main/kotlin/org/partiql/eval/internal/functions/AggEvery.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// ktlint-disable filename | ||
@file:Suppress("ClassName") | ||
|
||
package org.partiql.spi.connector.sql.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.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 { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "every", | ||
returns = BOOL, | ||
parameters = listOf( | ||
FnParameter("value", BOOL), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorEvery() | ||
} | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_EVERY__ANY__BOOL : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "every", | ||
returns = BOOL, | ||
parameters = listOf( | ||
FnParameter("value", ANY), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorEvery() | ||
} |
28 changes: 28 additions & 0 deletions
28
partiql-eval/src/main/kotlin/org/partiql/eval/internal/functions/AggGroupAs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// ktlint-disable filename | ||
@file:Suppress("ClassName") | ||
|
||
package org.partiql.spi.connector.sql.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.value.PartiQLValueExperimental | ||
import org.partiql.value.PartiQLValueType | ||
|
||
@OptIn(PartiQLValueExperimental::class, FnExperimental::class) | ||
public object Agg_GROUP_AS__ANY__ANY : Agg { | ||
|
||
override val signature: AggSignature = AggSignature( | ||
name = "group_as", | ||
returns = PartiQLValueType.ANY, | ||
parameters = listOf( | ||
FnParameter("value", PartiQLValueType.ANY), | ||
), | ||
isNullable = true, | ||
isDecomposable = true | ||
) | ||
|
||
override fun accumulator(): Agg.Accumulator = AccumulatorGroupAs() | ||
} |
Oops, something went wrong.