-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Process function path #11476
Process function path #11476
Conversation
cc @kasiafi |
|
||
private Collection<FunctionMetadata> getFunctions(CatalogSchemaFunctionName name) | ||
{ | ||
if (name.getCatalogName().equals(GLOBAL_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.
Do we prevent creating a catalog with this 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 "system" catalog is the built in catalog that is information like the nodes in the cluster, and metadata for the jdbc driver.
String catalog = sqlPathElement.getCatalog().map(Identifier::getValue).or(session::getCatalog) | ||
.orElseThrow(() -> new IllegalArgumentException("Session default catalog must be set to resolve a partial function name: " + null)); | ||
names.add(new CatalogSchemaFunctionName(catalog, sqlPathElement.getSchema().getValue(), functionName)); |
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.
Could you use getCanonicalValue()
instead of getValue()
?
I think it's no difference at the moment, as all the names are eventually lowercased, but it would simplify the future transition to SQL identifier semantics.
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.
Sure. Didn't know that method existed.
6b7d00a
to
b09cfbc
Compare
core/trino-main/src/main/java/io/trino/metadata/FunctionMetadata.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/rowpattern/LogicalIndexExtractor.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/FunctionResolver.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/SchemaFunctionName.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/CatalogSchemaFunctionName.java
Outdated
Show resolved
Hide resolved
b09cfbc
to
bb44aeb
Compare
bb44aeb
to
461d3ca
Compare
Does this conflict anyhow with #9831? |
At this point, I don't think so, but in the future maybe. Functions in SQL have a absolute name expressed just like a table with catalog and schema. We will eventually want to express full names to connectors so they can differentiate between functions in different schemas. That said, there is only one schema that has functions right now.
Yes, any pending functions will need to be updated to use the new builders. This translation is easy, so it shouldn't be too much work. |
Description
Related issues, pull requests, and links
Relates to #8
Documentation
There are no actual function namespaces yet, so this does not change anything user visible yet.
(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
There are no actual function namespaces yet, so this does not change anything user visible yet.
(x) No release notes entries required.
() Release notes entries required with the following suggested text: