Skip to content

Comments

Make Iceberg's procedures uniformly support named arguments#23592

Merged
hantangwangd merged 2 commits intoprestodb:masterfrom
hantangwangd:standardize_iceberg_procedures
Sep 9, 2024
Merged

Make Iceberg's procedures uniformly support named arguments#23592
hantangwangd merged 2 commits intoprestodb:masterfrom
hantangwangd:standardize_iceberg_procedures

Conversation

@hantangwangd
Copy link
Member

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_property which is completely unused.

Motivation and Context

Make Iceberg's procedures uniformly support named arguments

Impact

After this change, Iceberg procedures register_table and unregister_table support named arguments as well

Test Plan

  • Newly added test cases to show the support of using named arguments in procedure register_table and unregister_table

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

== RELEASE NOTES ==

Iceberg Connector Changes
* Support using named arguments in procedure `register_table` and `unregister_table` :pr:`12345`

@tdcmeehan tdcmeehan self-assigned this Sep 5, 2024
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the doc! A formatting nit and a suggested rephrasing to consider.

@hantangwangd hantangwangd force-pushed the standardize_iceberg_procedures branch from 0062546 to 7bd5797 Compare September 5, 2024 17:55
Copy link
Contributor

@ZacBlanco ZacBlanco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for these changes! I appreciate consistency 😄

.set(key, value)
.commit();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now keep SetTablePropertyProcedure as it is, maybe it's better to handle it in a later dedicated PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, we can enable the procedure and add some tests in a follow-up PR.

@hantangwangd hantangwangd force-pushed the standardize_iceberg_procedures branch from 7bd5797 to b496ec0 Compare September 6, 2024 01:39
assertUpdate("CALL system.unregister_table(table_name => '" + tableName + "', schema => '" + TEST_SCHEMA + "')");
assertFalse(getQueryRunner().tableExists(getSession(), tableName));
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me 👍🏻

steveburnett
steveburnett previously approved these changes Sep 6, 2024
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (docs)

Pull updated branch, new local docs build, looks good. Thanks!

Copy link
Member

@imjalpreet imjalpreet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (docs)

Pull updated branch, new local docs build, looks good. Thanks!

@hantangwangd hantangwangd merged commit 1a2228d into prestodb:master Sep 9, 2024
@hantangwangd hantangwangd deleted the standardize_iceberg_procedures branch September 9, 2024 23:21
@jaystarshot jaystarshot mentioned this pull request Nov 1, 2024
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants