Make Iceberg's procedures uniformly support named arguments#23592
Make Iceberg's procedures uniformly support named arguments#23592hantangwangd merged 2 commits intoprestodb:masterfrom
Conversation
steveburnett
left a comment
There was a problem hiding this comment.
Thanks for the doc! A formatting nit and a suggested rephrasing to consider.
0062546 to
7bd5797
Compare
ZacBlanco
left a comment
There was a problem hiding this comment.
Thank you for these changes! I appreciate consistency 😄
| .set(key, value) | ||
| .commit(); | ||
| } | ||
| } |
There was a problem hiding this comment.
Is there a good reason to remove it? If I recall, the reason I added this was because iceberg's table properties are generic string-string key-value pairs. Presto doesn't allow setting any arbitrary properties through regular SQL syntax though. So this adds some useful functionality for users who might have some arbitrary table-level metadata to store.
There was a problem hiding this comment.
Besides, this PR removes a procedure set_table_property which is completely unused.
@hantangwangd It was unused as it's missing binding in IcebergCommonModule, so the Procedure wasn't even enabled till now.
We can add the binding and enable it as it should be useful as Zac mentioned. What do you think?
There was a problem hiding this comment.
I just saw that this procedure was not used at all, not even registered as @imjalpreet mentioned. I do not have a strong feeling to remove it, since the PR #21495 has been blocked for quite some time, I would like to register and enable this procedure if you think it's necessary. Let me know your thoughts @ZacBlanco @imjalpreet.
There was a problem hiding this comment.
Now keep SetTablePropertyProcedure as it is, maybe it's better to handle it in a later dedicated PR.
There was a problem hiding this comment.
Sounds good, we can enable the procedure and add some tests in a follow-up PR.
presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/RegisterTableProcedure.java
Outdated
Show resolved
Hide resolved
7bd5797 to
b496ec0
Compare
| assertUpdate("CALL system.unregister_table(table_name => '" + tableName + "', schema => '" + TEST_SCHEMA + "')"); | ||
| assertFalse(getQueryRunner().tableExists(getSession(), tableName)); | ||
| } | ||
|
|
There was a problem hiding this comment.
Would it be better to rename either the this test class or Add a new Test class to incorporate unregister_table procedure related tests?
Also test classes for SetTablePropertyProcedure & RollbackToSnapshotProcedure procedures are missing, should we add few tests for that as well Or may be handle tests in future PR? WDYT?
There was a problem hiding this comment.
Would it be better to rename either the this test class or Add a new Test class to incorporate unregister_table procedure related tests?
Good suggestion, I have renamed the test class.
Also test classes for SetTablePropertyProcedure & RollbackToSnapshotProcedure procedures are missing, should we add few tests for that as well Or may be handle tests in future PR?
Under your reminder, I realized that there are still some different kinds of work to be done. I think it's better to leave the work of registering and documenting SetTablePropertyProcedure, adding test cases for both SetTablePropertyProcedure and RollbackToSnapshotProcedure to subsequent separated PRs. And in this PR, we focus on support named arguments uniformly for existing procedures, and unifying the naming conventions for their arguments. Do you think this makes sense?
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Pull updated branch, new local docs build, looks good. Thanks!
b496ec0 to
b54137e
Compare
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Pull updated branch, new local docs build, looks good. Thanks!
Description
This PR enables existing procedures which do not yet support named arguments to support named arguments, ensures consistency in the naming of arguments across procedures, and supplements the document with explanations for named arguments and sequential arguments.
Besides, this PR removes a procedure
set_table_propertywhich is completely unused.Motivation and Context
Make Iceberg's procedures uniformly support named arguments
Impact
After this change, Iceberg procedures
register_tableandunregister_tablesupport named arguments as wellTest Plan
register_tableandunregister_tableContributor checklist
Release Notes