forked from partiql/partiql-lang-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes PartiQLValue and adds support for VARIANT (partiql#1678)
Removes PartiQLValue from public API Removes PartiQLValueType from public API Removes PartiQLValueExperimental from public API Removes PartiQLValue reader/writer from public API Adds full support for the VARIANT type Adds PType static factory methods with default parameters Adds AST-to-Plan typing logic of integers to the Ion Variant Adds a lowerSafe() internal utility method for reducing code size
- Loading branch information
1 parent
ea779ee
commit 1abe677
Showing
104 changed files
with
723 additions
and
1,429 deletions.
There are no files selected for viewing
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
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
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
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
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
20 changes: 20 additions & 0 deletions
20
partiql-eval/src/main/kotlin/org/partiql/eval/internal/helpers/DatumUtils.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,20 @@ | ||
package org.partiql.eval.internal.helpers | ||
|
||
import org.partiql.spi.value.Datum | ||
import org.partiql.types.PType | ||
|
||
internal object DatumUtils { | ||
|
||
/** | ||
* Calls [Datum.lower] if the datum is a variant, otherwise returns the datum. If you don't know whether the value | ||
* is of type [PType.VARIANT], you should use [Datum.lowerSafe] before invoking whatever methods you intend to use. | ||
* This is essentially a workaround for the fact that we currently don't know whether a particular expression will be | ||
* [PType.VARIANT] or not. The planner/plan can eventually be optimized to accommodate this. | ||
*/ | ||
internal fun Datum.lowerSafe(): Datum { | ||
return when (this.type.code()) { | ||
PType.VARIANT -> this.lower() | ||
else -> this | ||
} | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.