-
Notifications
You must be signed in to change notification settings - Fork 30
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
API support for case-(in)sensitive table names #1369
Conversation
af196dc
to
b5bbb51
Compare
@Karakatiza666 , I need your help wrapping up this PR. It requires referring to case-sensitive relation names in quotes in the API, including |
name.to_lowercase() | ||
}; | ||
|
||
self.input_collection_handles.insert(name, handle); |
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.
can this fail?
does this overwrite a previously existing 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.
yes, there's no checking for duplicates at the moment. I'll add that.
|
||
/// A SQL table or view. It has a name and a list of fields. | ||
/// | ||
/// Matches the Calcite JSON format. |
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.
Calcite or SQL compiler?
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.
I didn't write this comment, but I'm pretty sure it's the SQL compiler.
/// - `VARCHAR(255)` sets precision to `255`. | ||
/// - `BIGINT`, `DATE`, `FLOAT`, `DOUBLE`, `GEOMETRY`, etc. sets precision | ||
/// to None | ||
/// - `TIME`, `TIMESTAMP` set precision to `0`. |
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.
This looks wrong, I think that Calcite only works with precision "3" for TIMESTAMP.
Maybe this is a bug we should look into.
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.
I just copied this code into a different location, haven't touched it
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.
at the time, I verified this by manually creating these types and see what I get back from the compiler
8929ad2
to
655a0ab
Compare
a187b02
to
0982fff
Compare
Upcoming commits will use these types in the `adapters` crate, which will need to manipulate program schema. Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
This field was added a while ago by the compiler, but hasn't been used. We are going to start using it in an upcoming commit. Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
The SQL compiler now passes SQL table schema descriptions in the JSON format when registering tables and views in the catalog. Upcoming commits make use of the schema in two ways: 1. Extract case sensitivity information from the schema in order to correctly handle table names in API calls and in pipeline configuration. 2. Use the schema to generate table schema for data formats that require it (initially, Kafka Connect's JSON format). Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
This column was recently added by the compiler. Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
Previously our API insisted on referring to tables and views in upper case. This manifested in two places: `/ingress/TABLE_NAME` and `/egress/VIEW_NAME` API endpoints and in connection configuration, where the user must specify table or view name. In this commit we remove this limitation and allow relations to be addressed using any case. More specifically: - Case-insensitive relation names, i.e., relations declared without quotes in SQL, can be addressed in UPPERCASE, lowercase, or MiXeD CaSe, e.g., `/ingress/TABLE`, `/ingress/table`, and `/ingress/TaBlE` are all accepted. - Case-sensitive relations declared with quotes, e.g., `create table "Foo"(...)` or `create view "BAR" as ...` must be addressed in the same case as their declaration by putting their names in quotes: `/ingress/"Foo"`, `/egress/"BAR"`. Addresses issue #51. Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
Signed-off-by: George <bulakh.96@gmail.com>
0982fff
to
26ae774
Compare
Signed-off-by: George <bulakh.96@gmail.com>
Previously our API insisted on referring to tables and views in upper case.
This manifested in two places:
/ingress/TABLE_NAME
and/egress/VIEW_NAME
API endpoints and in connection configuration, where the user must specify
table or view name.
In this commit we remove this limitation and allow relations to be addressed
using any case. More specifically:
Case-insensitive relation names, i.e., relations declared without
quotes in SQL, can be addressed in UPPERCASE, lowercase, or MiXeD
CaSe, e.g.,
/ingress/TABLE
,/ingress/table
, and/ingress/TaBlE
are allaccepted.
Case-sensitive relations declared with quotes, e.g.,
create table "Foo"(...)
orcreate view "BAR" as ...
must beaddressed in the same case as their declaration by putting their
names in quotes:
/ingress/"Foo"
,/egress/"BAR"
.Addresses issue #51.
Is this a user-visible change (yes/no): yes