-
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
Add system.bucket function to Iceberg #24200
base: master
Are you sure you want to change the base?
Conversation
@martint Could you please review the syntax? |
3f098db
to
f5d7a1a
Compare
@@ -33,6 +34,6 @@ public Iterable<ConnectorFactory> getConnectorFactories() | |||
@Override | |||
public Set<Class<?>> getFunctions() | |||
{ | |||
return ImmutableSet.of(IcebergThetaSketchForStats.class); | |||
return ImmutableSet.of(IcebergThetaSketchForStats.class, IcebergBucketFunction.class); |
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 should be exposed as a catalog function, not a global function.
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.
@martint thank you for reviewing! I'm not sure how to do this however? Is there an example of a function exposed as a catalog function in another connector I could look at to understand how to do this?
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 think you can check random_string
function in Faker. Also, we could rename to bucket
once it is implemented as a catalog function.
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.
Sent #24703 so we can avoid depending on trino-main
in Iceberg connector.
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/functions/IcebergBucketFunction.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/functions/IcebergBucketFunction.java
Outdated
Show resolved
Hide resolved
...trino-iceberg/src/test/java/io/trino/plugin/iceberg/functions/TestIcebergBucketFunction.java
Outdated
Show resolved
Hide resolved
...trino-iceberg/src/test/java/io/trino/plugin/iceberg/functions/TestIcebergBucketFunction.java
Outdated
Show resolved
Hide resolved
...trino-iceberg/src/test/java/io/trino/plugin/iceberg/functions/TestIcebergBucketFunction.java
Outdated
Show resolved
Hide resolved
...trino-iceberg/src/test/java/io/trino/plugin/iceberg/functions/TestIcebergBucketFunction.java
Outdated
Show resolved
Hide resolved
...trino-iceberg/src/test/java/io/trino/plugin/iceberg/functions/TestIcebergBucketFunction.java
Outdated
Show resolved
Hide resolved
...trino-iceberg/src/test/java/io/trino/plugin/iceberg/functions/TestIcebergBucketFunction.java
Show resolved
Hide resolved
...trino-iceberg/src/test/java/io/trino/plugin/iceberg/functions/TestIcebergBucketFunction.java
Outdated
Show resolved
Hide resolved
...trino-iceberg/src/test/java/io/trino/plugin/iceberg/functions/TestIcebergBucketFunction.java
Show resolved
Hide resolved
f5d7a1a
to
f96e88a
Compare
@ebyhr thank you for reviewing! I think I addressed all your comments if you want to have another look when you get a chance. |
This pull request has gone a while without any activity. Tagging for triage help: @mosabua |
f96e88a
to
8265b27
Compare
Description
Add a UDF to expose the iceberg bucket transform via SQL. This can be used to help determine what bucket a value would be placed in. This could be used with the
optimize
procedure to only optimize specific buckets.Spark has a similar UDF - https://iceberg.apache.org/javadoc/1.5.1/org/apache/iceberg/spark/functions/BucketFunction.html
Release notes