Skip to content
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

Move Delete TableWriter TableFinish node to SPI #24088

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

feilong-liu
Copy link
Contributor

@feilong-liu feilong-liu commented Nov 19, 2024

Description

We are adding a new connector optimizer, however the connector optimizer can only access a limited set of plan nodes which are in the SPI directory. In this PR, I move the DeleteNode, TableWriter and TableFinish node to SPI so that they can be used in collector optimizer.

Most part of the change is refactoring the import path for these nodes. Meaningful change is to get rid of functions not available in SPI, mainly Guava libraries, and replace them with java builtin collection methods.

Motivation and Context

To make DeleteNode, TableWriter and TableFinish nodes available in connector optimizer

Impact

Move Delete TableWriter TableFinish node to SPI

Test Plan

Existing unit tests

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

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

== RELEASE NOTES ==

General Changes
* Add Delete TableWriter TableFinish node to SPI :pr:`24088`

@feilong-liu feilong-liu marked this pull request as draft November 19, 2024 19:31
@feilong-liu feilong-liu force-pushed the node_spi branch 8 times, most recently from 387fcd4 to 9d8a5f2 Compare November 19, 2024 22:15
@@ -384,4 +389,59 @@ public static TableFinishNode createTemporaryTableWriteWithExchanges(
enableStatsCollectionForTemporaryTable ? Optional.of(aggregations.getFinalAggregation()) : Optional.empty(),
enableStatsCollectionForTemporaryTable ? Optional.of(statisticsResult.getDescriptor()) : Optional.empty());
}

public static StatisticAggregations.Parts splitIntoPartialAndFinal(StatisticAggregations statisticAggregations, VariableAllocator variableAllocator, FunctionAndTypeManager functionAndTypeManager)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved from StatisticAggregations, as it's moved to SPI which has no access to FunctionAndTypeManager

import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;

public class StatisticAggregations
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to SPI

@feilong-liu feilong-liu marked this pull request as ready for review November 20, 2024 00:44
@feilong-liu feilong-liu requested a review from a team as a code owner November 20, 2024 00:44
Copy link
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

For Native engine changes.

@steveburnett
Copy link
Contributor

Thanks for the release note entry! Please revise it to follow the Order of changes in the Release Note Guidelines to begin the line with Fix, Improve, and so on.

@feilong-liu feilong-liu merged commit 0ed73ea into prestodb:master Nov 21, 2024
61 checks passed
@feilong-liu feilong-liu deleted the node_spi branch November 21, 2024 23:04
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.

4 participants