Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Feb 19, 2021

What changes were proposed in this pull request?

In the PR, I propose to rename logical nodes of v2 commands in the form: <verb> + <object> like:

  • AlterTableAddPartition -> AddPartition
  • AlterTableSetLocation -> SetTableLocation

Why are the changes needed?

  1. For simplicity and readability of logical plans
  2. For consistency with other logical nodes. For example, the logical node RenameTable for ALTER TABLE .. RENAME TO was added before AlterTableRenamePartition.

Does this PR introduce any user-facing change?

Should not since this is non-public APIs.

How was this patch tested?

  1. Check scala style: ./dev/scalastyle
  2. Affected test suites:
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *AlterTableRenamePartitionSuite"

* }}}
*/
case class AlterTableAddPartition(
case class AddPartition(
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe AddPartitions because the command can add multiple partitions.

@MaxGekk MaxGekk changed the title [SPARK-34475][SQL] Rename logical nodes of v2 commands [SPARK-34475][SQL] Rename logical nodes of v2 ALTER commands Feb 19, 2021
Copy link
Contributor

@imback82 imback82 left a comment

Choose a reason for hiding this comment

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

LGTM except for pending comments including AddPartitions.

@SparkQA
Copy link

SparkQA commented Feb 19, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39858/

* The logical plan of the ALTER TABLE ... RENAME TO PARTITION command.
*/
case class AlterTableRenamePartition(
case class RenamePartition(
Copy link
Member Author

Choose a reason for hiding this comment

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

Even now, we allow to rename only one partition but Hive supports renaming of multiple partitions in one command. Maybe Spark will support this too in the future. Should we name it as RenamePartitions?

Copy link
Contributor

Choose a reason for hiding this comment

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

yea, to be consistent with ADD and DROP

* The logical plan of the ALTER TABLE ... SET LOCATION command.
*/
case class AlterTableSetLocation(
case class SetTableLocation(
Copy link
Member Author

Choose a reason for hiding this comment

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

The command incapsulates 2 commands actually: set table location and set partition location. Should we split it to SetTableLocation and SetPartitionLocation (separately in another PR).

Copy link
Contributor

Choose a reason for hiding this comment

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

SGTM

@SparkQA
Copy link

SparkQA commented Feb 19, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39858/

@SparkQA
Copy link

SparkQA commented Feb 20, 2021

Test build #135277 has finished for PR 31596 at commit 5109748.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Feb 20, 2021

Test build #135312 has finished for PR 31596 at commit 6da1d08.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class DropPartitions(

@dongjoon-hyun
Copy link
Member

cc @cloud-fan

@MaxGekk
Copy link
Member Author

MaxGekk commented Feb 22, 2021

@HyukjinKwon @cloud-fan @dongjoon-hyun Can this be merged to branch-3.1? Most (or all) of the nodes were added after 3.0, and they haven't released yet.

@SparkQA
Copy link

SparkQA commented Feb 22, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39914/

@SparkQA
Copy link

SparkQA commented Feb 22, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39914/

@cloud-fan
Copy link
Contributor

RC3 is cut and I don't think we should do this refactor in 3.1.2 (assuming RC3 passes).

@SparkQA
Copy link

SparkQA commented Feb 22, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39919/

@SparkQA
Copy link

SparkQA commented Feb 22, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39919/

@SparkQA
Copy link

SparkQA commented Feb 22, 2021

Test build #135334 has finished for PR 31596 at commit 09e7268.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class RenamePartitions(

@SparkQA
Copy link

SparkQA commented Feb 22, 2021

Test build #135339 has finished for PR 31596 at commit f6ab9ab.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

RC3 is cut and I don't think we should do this refactor in 3.1.2 (assuming RC3 passes).

@cloud-fan, hm are there any API change here?

@cloud-fan
Copy link
Contributor

no, logical plan is not a public API.

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 8f994cb Feb 23, 2021
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.

6 participants