Skip to content

Commit

Permalink
Implement EXCLUDE in EvaluatingCompiler
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Oct 18, 2023
1 parent a3199cf commit 41170c6
Show file tree
Hide file tree
Showing 7 changed files with 1,126 additions and 44 deletions.
350 changes: 314 additions & 36 deletions partiql-lang/src/main/kotlin/org/partiql/lang/eval/EvaluatingCompiler.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ val ExprValue.orderedNames: List<String>?
fun ExprValue.asNamed(): Named = object : Named {
override val name: ExprValue
get() = this@asNamed
override val value = this@asNamed
}

/** Binds the given name value as a [Named] facet delegate over this [ExprValue]. */
fun ExprValue.namedValue(nameValue: ExprValue): ExprValue = object : ExprValue by this, Named {
override val value = this@namedValue
override val name = nameValue
override fun <T : Any?> asFacet(type: Class<T>?): T? =
downcast(type) ?: this@namedValue.asFacet(type)
Expand Down
5 changes: 5 additions & 0 deletions partiql-lang/src/main/kotlin/org/partiql/lang/eval/Named.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ interface Named {
* a `struct` or an `int` for values that have some ordinal in a collection.
*/
val name: ExprValue

/**
* TODO ALAN: docs
*/
val value: ExprValue
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum class StructOrdering {
* Provides a [ExprValueType.STRUCT] implementation lazily backed by a sequence.
*/
internal open class StructExprValue(
private val ordering: StructOrdering,
internal val ordering: StructOrdering,
private val sequence: Sequence<ExprValue>
) : BaseExprValue() {

Expand Down
Loading

0 comments on commit 41170c6

Please sign in to comment.