-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Initializes PartiQL-system interfaces and document. #1480
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very glad to see this document. Kudos for taking the initiative.
* @property isNullCall | ||
*/ | ||
public data class Properties( | ||
@JvmField public val isNullCall: Boolean = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No isMissingCall
? Are you expecting to add it later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I don't believe it's necessary for function calls, only some very special operators (which will come later).
partiql-planner/README.adoc
Outdated
|
||
Let _N_ be a name with steps _n~1~ . n~2~ ... n~i~_ and let _S_ be the session scope with name _s~1~_ ... _s~j~_. | ||
|
||
. Let _T_ be the fully-qualified table name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The guide might be a bit confusing due to the conflation of SQL terms and PartiQL terms. From above: A name is composed of _n_ steps and can be qualified (_n > 1_) or unqualified (_n = 1_).
It seems like the use of "qualified" only indicates whether a name has more than 1 step (regardless of whether the name is absolute or relative).
Then, A _relative_ name begins with a step whereas an _absolute_ name begins with a leading period.
.
I almost feel as if we should begin to deprecate the use of "qualified". It could just be "absolute path/name". Essentially, does the use of SQL's "qualified" give any additional meaning now with the concept of relative & absolute?
On a similar note, depending on your thoughts on this, it may be a good idea to specify what the root of the system is. Is it a scope? For first launch, it may be useful to say that it is not a scope (so that tables/views/etc) cannot be created outside of a catalog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can have a relative-qualified path.
x.y.z -- relative-qualified
.a.b.c -- absolute-qualified
I don't think "qualified" adds any value here though, and should just be "relative name" and "absolute name".
public fun getKind(): Kind = Kind.TABLE | ||
|
||
/** | ||
* The table's shape; in SQL this is called 'table schema'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* The table's shape; in SQL this is called 'table schema'. | |
* The table's shape; in SQL this is called 'table descriptor'. |
* | ||
* @property steps | ||
*/ | ||
public data class Name(public val steps: List<String>) : Iterable<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to represent an Absolute Name or Relative Name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neither, it's just a name.
* @param name The case-sensitive [Table] name. | ||
* @return The [Table] or null if not found. | ||
*/ | ||
public fun getTable(name: String): Table? = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this method (as well as the ones below), I'm wondering how we can determine the case-sensitive names for third-party consumers (that may not consistently upper-or-lower-case their table names upon storage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't determine the case-sensitive names; I think you have consumer-implementer backwards. We case-normalize to lowercase and it's up to the implementer how to handle.
In other words, all usage of the Scope comes from the planner; so the planner is only "consumer" of Scope — implementers are responsible for handling their own mapping from PartiQL's case-normalized
partiql-planner/README.adoc
Outdated
Let _N_ be a routine name with steps _n~1~ . n~2~ ... n~i~_ and let _S_ be the session scope with name _s~1~_ ... _s~j~_. | ||
|
||
. If n = 1 then the session path is searched left-to-right for _n~1~_. | ||
. If n > 1, then let _R_ be the fully-qualified routine name. | ||
.. If _N_ is a relative name, then _R = s~1~ . s~2~ ... s~j~ . n~1~ . n~2~. ... n~i~_ . | ||
.. If _N_ is an absolute name, then _R = n~1~ . n~2~ ... n~i~_ . | ||
. Lookup the fully-qualified name _R_ and fail compilation if not found. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding "fully-qualified" vs "absolute", I think the following suggestion is a bit more clear.
Let _N_ be a routine name with steps _n~1~ . n~2~ ... n~i~_ and let _S_ be the session scope with name _s~1~_ ... _s~j~_. | |
. If n = 1 then the session path is searched left-to-right for _n~1~_. | |
. If n > 1, then let _R_ be the fully-qualified routine name. | |
.. If _N_ is a relative name, then _R = s~1~ . s~2~ ... s~j~ . n~1~ . n~2~. ... n~i~_ . | |
.. If _N_ is an absolute name, then _R = n~1~ . n~2~ ... n~i~_ . | |
. Lookup the fully-qualified name _R_ and fail compilation if not found. | |
Let _N_ be the routine invocation name (absolute or relative) with steps _n1_, _n2_, …, _ni_. Let _S_ be the session scope with name _.s1.s2. … sj_. Let _R_ by the absolute name of the invoked routine. | |
1. If _N_ is an absolute name, then _R = . n1 . n2 … ni_ . Return _R_. | |
2. If n = 1 then the function path is searched left-to-right for _n1_. | |
3. If n > 1, then _R = . s1 . s2 … sj . n1 . n2. … ni_ . | |
4. Lookup the absolute name _R_. Return function(s) if found. Fail compilation if not found. |
Maybe the "function path" should be SQL Path or invocation path. Up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit, it's meant to be "session path" from the original text.
Conformance comparison report-Cross Engine
Number failing in both: 395 Number passing in legacy engine but fail in eval engine: 4541 Number failing in legacy engine but pass in eval engine: 37 Conformance comparison report-Cross Commit-LEGACY
Number failing in both: 432 Number passing in Base (4dd0972) but now fail: 0 Number failing in Base (4dd0972) but now pass: 1 Click here to see
Conformance comparison report-Cross Commit-EVAL
Number failing in both: 758 Number passing in Base (4dd0972) but now fail: 4179 Number failing in Base (4dd0972) but now pass: 0 |
Description
https://github.com/partiql/partiql-lang-kotlin/blob/v1-path/partiql-planner/README.adoc
This PR initializes the interfaces for the 1.0 planner interfaces which model the PartiQL-system. This review is meant to collect feedback on the high-level public interfaces and documentation before updating internals.
Details can be found in the README.adoc.
License Information
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.