-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Support additional identifier parts for tables #1135
Comments
While this sounds like an interesting feature, it's problematic for a number of reasons. The SQL specification defines a rigid entity namespace structure composed of catalog, schema and object name. Extending that implies going beyond what's specified, so it requires extra careful thought and consideration. One of the most important questions is whether more parts implies more hierarchy levels or is just a syntactic extension to the set of characters allowed for a table name. Both options have downsides. Additional hierarchy levels introduce ambiguities for commands that depend on the rigid 3-part naming structure. It's unclear how commands like It also affects
Changing the semantics to refer to nested table Similarly, what would The option of a syntactic extension to the set of characters allowed for table names also has additional problems. First, there's the cognitive discordance of
Does In the latter case, a query that looks valid to the naked eye (and is actually valid SQL if
|
I agree that it is good to be careful, but I think there are reasonable ways to make this work. Let's ignore the case of nested tables to start with. I think that can over-complicate this because it mixes two things together that should be separate: how to interpret a identifiers and what an identifier references. The main argument here appears to be that
Following these rules, you can always get the catalog and the full identifier to load from that catalog. After that, what gets loaded is up to the catalog, so a metadata table like The only overlap is between the default catalog and full catalog identifiers: These rules also work for several of the cases you mentioned. The multi-part identifier passed to |
this would help Sybase connector (#2481) as server.db.owner.table is valid identifier there |
The Iceberg table format exposes metadata tables to make it easy to inspect a table. This includes data files, manifest files, snapshots, and table history. (Docs)
In Spark, Iceberg exposes the metadata tables by adding another name part to the table identifier. History for
db.table
is loaded usingdb.table.history
. This is easy for users to remember and doesn't require users to escape special characters.Is it possible to update Presto to use the same convention? I know there is some support for
db."table$metaTableName"
, but this is awkward compared to adding another identifier part. It also requires remembering how to escape$
.For background, Spark allows identifying tables by any number of identifier parts. This allows a catalog to expose its internal structure as well as supporting metadata table names.
The text was updated successfully, but these errors were encountered: