Skip to content

Conversation

@natashasehgal
Copy link
Contributor

@natashasehgal natashasehgal commented Jun 24, 2025

Description

Refactor MetadataDeleteNode from com.facebook.presto.sql.planner.plan.MetadataDeleteNode to com.facebook.presto.spi.plan.MetadataDeleteNode,

Motivation and Context

Refactor so Metadata Optimization can be used in FB Metalake optimization

Impact

No impact

Test Plan

  • Unit tests

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.

== NO RELEASE NOTE ==

@natashasehgal natashasehgal requested a review from a team as a code owner June 24, 2025 19:59
@prestodb-ci prestodb-ci added the from:Meta PR from Meta label Jun 24, 2025
@facebook-github-bot
Copy link
Collaborator

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

natashasehgal added a commit to natashasehgal/presto that referenced this pull request Jun 24, 2025
Summary:



Rollback Plan:

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

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

natashasehgal added a commit to natashasehgal/presto that referenced this pull request Jun 24, 2025
Summary:



Rollback Plan:

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

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

@Immutable
public class MetadataDeleteNode
extends InternalPlanNode
extends PlanNode
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ghelmling InternalPlanNode access issue after switching package

@natashasehgal
Copy link
Contributor Author

natashasehgal commented Jun 25, 2025

@ghelmling MetadataDeleteOptimizer.findNode() implementation contains ExchangeNode, which is also in package com.facebook.presto.sql.planner.plan. Any thoughts on how to use ExchangeNode in FB's Metalake optimizer?

A refactor similar to MetadataDeleteNode for ExchangeNode would be quite large

Edit: Discussed offline, the optimization can be done slightly differently, instead of using ExchangeNode

@ghelmling
Copy link
Contributor

lgtm! Thanks for the change. You'll just need committer approval.

@facebook-github-bot
Copy link
Collaborator

@natashasehgal has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

natashasehgal added a commit to natashasehgal/presto that referenced this pull request Jun 26, 2025
Summary:
## Description
Refactor MetadeleteNode from com.facebook.presto.sql.planner.plan.MetadataDeleteNode to com.facebook.presto.spi.plan.MetadataDeleteNode, 

## Motivation and Context
Refactor so Metadata Optimization can be used in FB Metalake optimization

## Impact
No impact


Test Plan:
- [x] Unit tests

## Contributor checklist
- [x] Please make sure your submission complies with our [contributing guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md), in particular [code style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style) and [commit standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [x] PR description addresses the issue accurately and concisely.  If the change is non-trivial, a GitHub Issue is referenced.
- [x] Documented new properties (with its default value), SQL syntax, functions, or other functionality.
- [x] If release notes are required, they follow the [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [x] Adequate tests were added if applicable.
- [x] CI passed.

## Release Notes
Please follow [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines) and fill in the release notes below.

```
== NO RELEASE NOTE ==
```

Rollback Plan:

Differential Revision: D77249220

Pulled By: natashasehgal
@facebook-github-bot
Copy link
Collaborator

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

@facebook-github-bot
Copy link
Collaborator

@natashasehgal has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Member

@hantangwangd hantangwangd 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 refactoring, overall looks good to me, just one nit.

Besides, there seems to be a couple of typos in the commit message—it should be MetadataDeleteNode instead of MetadeleteNode.

natashasehgal added a commit to natashasehgal/presto that referenced this pull request Jun 27, 2025
Summary:
## Description
Refactor MetadeleteNode from com.facebook.presto.sql.planner.plan.MetadataDeleteNode to com.facebook.presto.spi.plan.MetadataDeleteNode, 

## Motivation and Context
Refactor so Metadata Optimization can be used in FB Metalake optimization

## Impact
No impact


Test Plan:
- [x] Unit tests

## Contributor checklist
- [x] Please make sure your submission complies with our [contributing guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md), in particular [code style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style) and [commit standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [x] PR description addresses the issue accurately and concisely.  If the change is non-trivial, a GitHub Issue is referenced.
- [x] Documented new properties (with its default value), SQL syntax, functions, or other functionality.
- [x] If release notes are required, they follow the [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [x] Adequate tests were added if applicable.
- [x] CI passed.

## Release Notes
Please follow [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines) and fill in the release notes below.

```
== NO RELEASE NOTE ==
```

Rollback Plan:

Differential Revision: D77249220

Pulled By: natashasehgal
@facebook-github-bot
Copy link
Collaborator

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

@natashasehgal natashasehgal changed the title Refactor MetadeleteNode to spi Plan Refactor MetadataDeleteNode to spi Plan Jun 27, 2025
Summary:
## Description
Refactor MetadeleteNode from com.facebook.presto.sql.planner.plan.MetadataDeleteNode to com.facebook.presto.spi.plan.MetadataDeleteNode, 

## Motivation and Context
Refactor so Metadata Optimization can be used in FB Metalake optimization

## Impact
No impact


Test Plan:
- [x] Unit tests

## Contributor checklist
- [x] Please make sure your submission complies with our [contributing guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md), in particular [code style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style) and [commit standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [x] PR description addresses the issue accurately and concisely.  If the change is non-trivial, a GitHub Issue is referenced.
- [x] Documented new properties (with its default value), SQL syntax, functions, or other functionality.
- [x] If release notes are required, they follow the [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [x] Adequate tests were added if applicable.
- [x] CI passed.

## Release Notes
Please follow [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines) and fill in the release notes below.

```
== NO RELEASE NOTE ==
```

Rollback Plan:

Differential Revision: D77249220

Pulled By: natashasehgal
@facebook-github-bot
Copy link
Collaborator

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

@facebook-github-bot
Copy link
Collaborator

@natashasehgal has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@natashasehgal
Copy link
Contributor Author

Thanks for the refactoring, overall looks good to me, just one nit.

Besides, there seems to be a couple of typos in the commit message—it should be MetadataDeleteNode instead of MetadeleteNode.

You're right updated these typos, and removed unnecessary function

@natashasehgal natashasehgal merged commit 72490a5 into prestodb:master Jun 27, 2025
107 of 108 checks passed
@natashasehgal natashasehgal deleted the export-D77249220 branch June 27, 2025 18:26
@facebook-github-bot
Copy link
Collaborator

@natashasehgal has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants