Skip to content

Conversation

@weixiuli
Copy link
Contributor

@weixiuli weixiuli commented Oct 28, 2019

What changes were proposed in this pull request?

Spark only can drop partitions by exact values. For instance, Spark doesn't support:

ALTER TABLE mytable DROP PARTITION(mydate < '2018-04-06')

The PR adds the support to this syntax.

The PR takes input from the effort in #19691 by @DazhuangSu , in #20999 by @mgaido91 ,
, there are some related PRs: #15987,#16036,#19691,#15704.
some related issues:
https://issues.apache.org/jira/browse/SPARK-14922
https://issues.apache.org/jira/browse/SPARK-17732
https://issues.apache.org/jira/browse/SPARK-23866

How was this patch tested?

Add unittests.

@mgaido91
Copy link
Contributor

please fix all failures

@weixiuli weixiuli force-pushed the issues/SPARK-14922 branch 2 times, most recently from a4e67c3 to ce453ed Compare October 29, 2019 03:18
@weixiuli
Copy link
Contributor Author

Ping @cloud-fan @mgaido91 @maropu @DazhuangSu Kindly review, thanks.

@maropu
Copy link
Member

maropu commented Oct 29, 2019

ok to test

@SparkQA
Copy link

SparkQA commented Oct 29, 2019

Test build #112830 has finished for PR 26280 at commit ce453ed.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • public class ExpressionBuilder
  • public final class Utilities

@weixiuli
Copy link
Contributor Author

please retry test

@weixiuli
Copy link
Contributor Author

jenkins, retest this, please

@maropu
Copy link
Member

maropu commented Oct 29, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Oct 29, 2019

Test build #112845 has finished for PR 26280 at commit ce453ed.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • public class ExpressionBuilder
  • public final class Utilities

@weixiuli
Copy link
Contributor Author

retest this please

@wangyum
Copy link
Member

wangyum commented Oct 30, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Oct 30, 2019

Test build #112919 has finished for PR 26280 at commit ce453ed.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • public class ExpressionBuilder
  • public final class Utilities

@SparkQA
Copy link

SparkQA commented Oct 31, 2019

Test build #113000 has finished for PR 26280 at commit a0c42fd.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • public class ExpressionBuilder
  • public final class Utilities

@weixiuli
Copy link
Contributor Author

retest this please

1 similar comment
@maropu
Copy link
Member

maropu commented Oct 31, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Oct 31, 2019

Test build #113022 has finished for PR 26280 at commit a0c42fd.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • public class ExpressionBuilder
  • public final class Utilities

@SparkQA
Copy link

SparkQA commented Nov 1, 2019

Test build #113084 has finished for PR 26280 at commit 1bd2cd3.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • public class ExpressionBuilder
  • public final class Utilities

@SparkQA
Copy link

SparkQA commented Nov 14, 2019

Test build #113747 has finished for PR 26280 at commit e27f13c.

  • This patch fails to generate documentation.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • case class ExpressionBuilder(val table: MetaStoreApiTable,

@weixiuli
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Nov 14, 2019

Test build #113757 has finished for PR 26280 at commit 21cd780.

  • This patch fails to generate documentation.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • case class ExpressionBuilder(val table: MetaStoreApiTable,

@SparkQA
Copy link

SparkQA commented Nov 14, 2019

Test build #113775 has finished for PR 26280 at commit 0d5bc03.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • case class ExpressionBuilder(val table: MetaStoreApiTable,

@SparkQA
Copy link

SparkQA commented Nov 15, 2019

Test build #113834 has finished for PR 26280 at commit 11b4cb0.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • case class ExpressionBuilder(val table: MetaStoreApiTable,

@SparkQA
Copy link

SparkQA commented Nov 15, 2019

Test build #113852 has finished for PR 26280 at commit 9d3ede5.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • case class ExpressionBuilder(val table: MetaStoreApiTable,

@weixiuli
Copy link
Contributor Author

weixiuli commented Nov 18, 2019

retest this please.
@cloud-fan @mgaido91 @maropu @DazhuangSu Kindly review, thanks.

…s in ALTER TABLE DROP PARTITION and batch dropping PARTITIONS

    - Support partition filters in ALTER TABLE DROP PARTITION.
    - Support batch dropping PARTITIONS by 'ExpressionBuilder'.
@SparkQA
Copy link

SparkQA commented Nov 19, 2019

Test build #114062 has finished for PR 26280 at commit c2639d0.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class PartitioningAttribute(
  • case class ExpressionBuilder(val table: MetaStoreApiTable,

@weixiuli
Copy link
Contributor Author

@cloud-fan Could you review this PR , thanks.

;

dropPartitionVal
: identifier (comparisonOperator constant)?
Copy link
Contributor

Choose a reason for hiding this comment

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

One suggestion, can we replace constant with expression? In our PROD environment, there are some requirements like 'ALTER TABLE xxx DROP PARTITION (col < CURRENT_DATE)'.

@wangshisan
Copy link
Contributor

This is also a requirement in our PROD environment, could anyone help review?

@github-actions
Copy link

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

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