Skip to content

Add ConnectorDeleteTableHandle to ConnectorProtocol #24721

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

Merged
merged 2 commits into from
Mar 21, 2025

Conversation

ghelmling
Copy link
Contributor

@ghelmling ghelmling commented Mar 12, 2025

Description

In PR #24528 we added a new ConnectorDeleteTableHandle interface for use in ConnectorMetadata::beginDelete and finishDelete. This changes adds a type parameter for ConnectorDeleteTableHandle implementations to the ConnectorProtocolTemplate declaration, with corresponding hooks in ConnectorProtocol for presto_protocol (de)serialization.

Motivation and Context

Adding the implementing type as a parameter to ConnectorProtocolTemplate is required to correctly serialize ConnectorDeleteTableHandle implementations to native workers.

Impact

Any current connectors defining ConnectorProtocolTemplate specializations will need to add a type parameter for the ConnectorDeleteTableHandle implementing type. If the connector does not currently handle ConnectorDeleteTableHandle, it can use the NotImplemented type.

Test Plan

No new tests added, as testing the ConnectorDeleteTableHandle serialization would require a corresponding implementation to test.

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • 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

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

Prestissimo Changes
* Added a type parameter for `ConnectorDeleteTableHandle` implementations to `ConnectorProtocolTemplate`, along with support for (de)serialization of connector-specific types.  Existing native connector implementations defining `ConnectorProtocolTemplate` specializations will need to update their definitions to supply their specific type or use `NotImplemented`.


Hive Connector Changes
* Updated native `HiveConnectorProtocol` to supply `NotImplemented` for `ConnectorDeleteTableHandle` type.


Iceberg Connector Changes
* Updated native `IcebergConnectorProtocol` to supply `NotImplemented` for `ConnectorDeleteTableHandle` type.

Differential Revision: D70209547

@ghelmling ghelmling requested a review from a team as a code owner March 12, 2025 23:50
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D70209547

@zation99
Copy link
Contributor

After I run make presto_protocol, there are more changes to the protocol related auto-generated files. The cpp build also failed.

@ghelmling
Copy link
Contributor Author

After I run make presto_protocol, there are more changes to the protocol related auto-generated files. The cpp build also failed.

What is the diff you are seeing after "make presto_protocol"? I ran that as part of this change, but it's possible something else got in after a rebase. Can you share the diff after your build?

CPP build is passing on the CI signals for the PR. What failure do you see there?

Summary: Pull Request resolved: prestodb#24721

Differential Revision: D70209547
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D70209547

@@ -27,6 +27,7 @@ using IcebergConnectorProtocol = ConnectorProtocolTemplate<
IcebergSplit,
NotImplemented,
hive::HiveTransactionHandle,
NotImplemented,
Copy link
Contributor

Choose a reason for hiding this comment

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

There are still build failures related to Iceberg:
In file included from /Users/jiaqizhang/Repos/presto/presto-native-execution/presto_cpp/presto_protocol/presto_protocol.cpp:19:
/Users/jiaqizhang/Repos/presto/presto-native-execution/./presto_cpp/presto_protocol/connector/iceberg/presto_protocol_iceberg.cpp:1074:9: error: no member named 'affinitySchedulingSectionSize' in 'facebook::presto::protocol::iceberg::IcebergSplit'
1074 | p.affinitySchedulingSectionSize,
| ~ ^
/Users/jiaqizhang/Repos/presto/presto-native-execution/./presto_cpp/presto_protocol/connector/iceberg/presto_protocol_iceberg.cpp:1153:9: error: no member named 'affinitySchedulingSectionSize' in 'facebook::presto::protocol::iceberg::IcebergSplit'
1153 | p.affinitySchedulingSectionSize,
| ~ ^
2 errors generated.

Copy link
Contributor

Choose a reason for hiding this comment

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

why wouldn't this fail in the CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those are not from my changes. It looks like other changes went in without rebuilding presto_protocol.

@@ -3251,6 +3251,91 @@ void from_json(const json& j, CreateHandle& p) {
"schemaTableName");
}
} // namespace facebook::presto::protocol
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this isn't specific to your change, but why is the license generated a zillion times in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are coming from the special/*.(cpp|hpp).inc files which are copied in to the protocol files. We could drop the license headers from those or try to make the script smart enough to strip them out (java-to-struct-json.py I think).

@@ -27,6 +27,7 @@ using IcebergConnectorProtocol = ConnectorProtocolTemplate<
IcebergSplit,
NotImplemented,
hive::HiveTransactionHandle,
NotImplemented,
Copy link
Contributor

Choose a reason for hiding this comment

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

why wouldn't this fail in the CI?

zation99
zation99 previously approved these changes Mar 21, 2025
@ghelmling ghelmling requested a review from a team as a code owner March 21, 2025 05:50
@ghelmling ghelmling requested a review from jaystarshot March 21, 2025 05:50
Copy link
Contributor

@amitkdutta amitkdutta left a comment

Choose a reason for hiding this comment

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

Thanks @ghelmling for making the protocol up to date and fix the build with new coordiantor.

Copy link
Contributor

@shangm2 shangm2 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@NikhilCollooru NikhilCollooru left a comment

Choose a reason for hiding this comment

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

lgtm

@ghelmling ghelmling merged commit 7cdf95b into prestodb:master Mar 21, 2025
98 checks passed
ghelmling added a commit that referenced this pull request Mar 21, 2025
Summary: Pull Request resolved: #24721

Differential Revision: D70209547
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D70209547

@prestodb-ci prestodb-ci mentioned this pull request Mar 28, 2025
30 tasks
pradeepvaka pushed a commit to pradeepvaka/presto that referenced this pull request Apr 11, 2025
Summary: Pull Request resolved: prestodb#24721

Differential Revision: D70209547
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants