-
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.
Ports evaluation changes to v1 plans (#1573)
- Loading branch information
Showing
14 changed files
with
404 additions
and
82 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
27 changes: 22 additions & 5 deletions
27
partiql-plan/src/main/kotlin/org/partiql/plan/v1/operator/rel/RelAggregateCall.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 |
---|---|---|
@@ -1,18 +1,35 @@ | ||
package org.partiql.plan.v1.operator.rel | ||
|
||
import org.partiql.plan.v1.operator.rex.Rex | ||
import org.partiql.types.PType | ||
import org.partiql.spi.fn.Agg | ||
|
||
/** | ||
* TODO DOCUMENTATION | ||
*/ | ||
public interface RelAggregateCall { | ||
|
||
public fun isDistinct(): Boolean | ||
public fun getAgg(): Agg | ||
|
||
public fun getName(): String | ||
public fun getArgs(): List<Rex> | ||
|
||
public fun getType(): PType | ||
public fun isDistinct(): Boolean | ||
} | ||
|
||
public fun getArgs(): List<Rex> | ||
/** | ||
* Internal standard implementation of [RelAggregateCall]. | ||
* | ||
* DO NOT USE FINAL. | ||
* | ||
* @property agg | ||
* @property args | ||
* @property isDistinct | ||
*/ | ||
internal class RelAggregateCallImpl( | ||
private var agg: Agg, | ||
private var args: List<Rex>, | ||
private var isDistinct: Boolean, | ||
) : RelAggregateCall { | ||
override fun getAgg(): Agg = agg | ||
override fun getArgs(): List<Rex> = args | ||
override fun isDistinct(): Boolean = isDistinct | ||
} |
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
117 changes: 90 additions & 27 deletions
117
partiql-plan/src/main/kotlin/org/partiql/plan/v1/operator/rel/RelExcludeStep.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 |
---|---|---|
@@ -1,40 +1,103 @@ | ||
package org.partiql.plan.v1.operator.rel | ||
|
||
/** | ||
* TODO DOCUMENTATION | ||
* Logical EXCLUDE step, one of: index, key, symbol, struct wildcard, or collection wildcard. | ||
*/ | ||
public interface RelExcludeStep { | ||
|
||
public fun getSubsteps(): List<RelExcludeStep> | ||
public fun getSubsteps(): Collection<RelExcludeStep> | ||
|
||
/** | ||
* TODO DOCUMENTATION | ||
*/ | ||
public interface Index : RelExcludeStep { | ||
public fun getIndex(): Int | ||
} | ||
companion object { | ||
|
||
/** | ||
* TODO DOCUMENTATION | ||
*/ | ||
public interface Key : RelExcludeStep { | ||
public fun getKey(): String | ||
} | ||
@JvmStatic | ||
public fun index(index: Int, substeps: List<RelExcludeStep> = emptyList()): RelExcludeIndex = | ||
RelExcludeIndexImpl(index, substeps) | ||
|
||
@JvmStatic | ||
public fun key(key: String, substeps: List<RelExcludeStep> = emptyList()): RelExcludeKey = | ||
RelExcludeKeyImpl(key, substeps) | ||
|
||
@JvmStatic | ||
public fun symbol(symbol: String, substeps: List<RelExcludeStep> = emptyList()): RelExcludeSymbol = | ||
RelExcludeSymbolImpl(symbol, substeps) | ||
|
||
/** | ||
* TODO DOCUMENTATION | ||
*/ | ||
public interface Symbol : RelExcludeStep { | ||
public fun getSymbol(): String | ||
@JvmStatic | ||
public fun struct(substeps: List<RelExcludeStep> = emptyList()): RelExcludeStructWildcard = | ||
RelExcludeStructWildcardImpl(substeps) | ||
|
||
@JvmStatic | ||
public fun collection(substeps: List<RelExcludeStep> = emptyList()): RelExcludeCollectionWildcard = | ||
RelExcludeCollectionWildcardImpl(substeps) | ||
} | ||
} | ||
|
||
/** | ||
* Logical representation of an EXCLUDE path index step. | ||
*/ | ||
public interface RelExcludeIndex : RelExcludeStep { | ||
public fun getIndex(): Int | ||
} | ||
|
||
private data class RelExcludeIndexImpl( | ||
private val index: Int, | ||
private val substeps: List<RelExcludeStep> = emptyList(), | ||
) : RelExcludeIndex { | ||
override fun getSubsteps(): Collection<RelExcludeStep> = substeps | ||
override fun getIndex(): Int = index | ||
} | ||
|
||
/** | ||
* Logical representation of an EXCLUDE path key step. | ||
*/ | ||
public interface RelExcludeKey : RelExcludeStep { | ||
public fun getKey(): String | ||
} | ||
|
||
/** | ||
* TODO DOCUMENTATION | ||
*/ | ||
public interface StructWildcard : RelExcludeStep | ||
// TODO hashcode/equals without data class | ||
private data class RelExcludeKeyImpl( | ||
private val key: String, | ||
private val substeps: List<RelExcludeStep> = emptyList(), | ||
) : RelExcludeKey { | ||
override fun getSubsteps(): Collection<RelExcludeStep> = substeps | ||
override fun getKey(): String = key | ||
} | ||
|
||
/** | ||
* Logical representation of an EXCLUDE path symbol step. | ||
*/ | ||
public interface RelExcludeSymbol : RelExcludeStep { | ||
public fun getSymbol(): String | ||
} | ||
|
||
// TODO hashcode/equals without data class | ||
private data class RelExcludeSymbolImpl( | ||
private val symbol: String, | ||
private val substeps: List<RelExcludeStep> = emptyList(), | ||
) : RelExcludeSymbol { | ||
override fun getSubsteps(): Collection<RelExcludeStep> = substeps | ||
override fun getSymbol(): String = symbol | ||
} | ||
|
||
/** | ||
* Logical representation of an EXCLUDE struct wildcard step. | ||
*/ | ||
public interface RelExcludeStructWildcard : RelExcludeStep | ||
|
||
// TODO hashcode/equals without data class | ||
private data class RelExcludeStructWildcardImpl( | ||
private val substeps: List<RelExcludeStep> = emptyList(), | ||
) : RelExcludeStructWildcard { | ||
override fun getSubsteps(): Collection<RelExcludeStep> = substeps | ||
} | ||
|
||
/** | ||
* Logical representation of an EXCLUDE collection wildcard step. | ||
*/ | ||
public interface RelExcludeCollectionWildcard : RelExcludeStep | ||
|
||
/** | ||
* TODO DOCUMENTATION | ||
*/ | ||
public interface CollectionWildcard : RelExcludeStep | ||
// TODO hashcode/equals without data class | ||
private data class RelExcludeCollectionWildcardImpl( | ||
private val substeps: List<RelExcludeStep> = emptyList(), | ||
) : RelExcludeCollectionWildcard { | ||
override fun getSubsteps(): Collection<RelExcludeStep> = substeps | ||
} |
Oops, something went wrong.