You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by vanzin <gi...@git.apache.org> on 2016/06/22 00:34:32 UTC

[GitHub] spark pull request #13831: [SPARK-16119][sql] Support PURGE option to drop t...

GitHub user vanzin opened a pull request:

    https://github.com/apache/spark/pull/13831

    [SPARK-16119][sql] Support PURGE option to drop table / partition.

    This option is used by Hive to directly delete the files instead of
    moving them to the trash. This is needed in certain configurations
    where moving the files does not work. For non-Hive tables and partitions,
    Spark already behaves as if the PURGE option was set, so there's no
    need to do anything.
    
    Hive support for PURGE was added in 0.14 (for tables) and 1.2 (for
    partitions), so the code reflects that: trying to use the option with
    older versions of Hive will cause an exception to be thrown.
    
    The change is a little noisier than I would like, because of the code
    to propagate the new flag through all the interfaces and implementations;
    the main changes are in the parser and in HiveShim, aside from the tests
    (DDLCommandSuite, VersionsSuite).
    
    Tested by running sql and catalyst unit tests, plus VersionsSuite which
    has been updated to test the version-specific behavior. I also ran an
    internal test suite that uses PURGE and would not pass previously.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/vanzin/spark SPARK-16119

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/13831.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13831
    
----
commit a53b7fdfd64b6617ee861821908684a5afe98eec
Author: Marcelo Vanzin <va...@cloudera.com>
Date:   2016-06-21T23:01:49Z

    [SPARK-16119][sql] Support PURGE option to drop table / partition.
    
    This option is used by Hive to directly delete the files instead of
    moving them to the trash. This is needed in certain configurations
    where moving the files does not work. For non-Hive tables and partitions,
    Spark already behaves as if the PURGE option was set, so there's no
    need to do anything.
    
    Hive support for PURGE was added in 0.14 (for tables) and 1.2 (for
    partitions), so the code reflects that: trying to use the option with
    older versions of Hive will cause an exception to be thrown.
    
    The change is a little noisier than I would like, because of the code
    to propagate the new flag through all the interfaces and implementations;
    the main changes are in the parser and in HiveShim, aside from the tests
    (DDLCommandSuite, VersionsSuite).
    
    Tested by running sql and catalyst unit tests, plus VersionsSuite which
    has been updated to test the version-specific behavior. I also ran an
    internal test suite that uses PURGE and would not pass previously.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13831: [SPARK-16119][sql] Support PURGE option to drop t...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13831#discussion_r70115433
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala ---
    @@ -179,7 +179,8 @@ case class DescribeDatabaseCommand(
     case class DropTableCommand(
         tableName: TableIdentifier,
         ifExists: Boolean,
    -    isView: Boolean) extends RunnableCommand {
    +    isView: Boolean,
    +    purge: Boolean) extends RunnableCommand {
     
    --- End diff --
    
    I'm not personally against the assert but I can't find anywhere else where the code is asserting something the parser already checks. So I'll pass on this unless someone that plays with this code more says it's ok.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13831: [SPARK-16119][sql] Support PURGE option to drop t...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13831#discussion_r70322649
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala ---
    @@ -643,6 +694,21 @@ private[client] class Shim_v0_14 extends Shim_v0_13 {
           numDP: JInteger, holdDDLTime: JBoolean, listBucketingEnabled: JBoolean, JBoolean.FALSE)
       }
     
    +  override def dropTable(
    +      hive: Hive,
    +      dbName: String,
    +      tableName: String,
    +      deleteData: Boolean,
    +      ignoreIfNotExists: Boolean,
    +      purge: Boolean): Unit = {
    +    try {
    +      dropTableMethod.invoke(hive, dbName, tableName, deleteData: JBoolean,
    +        ignoreIfNotExists: JBoolean, purge: JBoolean)
    +    } catch {
    +      case e: InvocationTargetException => throw e.getCause()
    --- End diff --
    
    just curious, why include this extra handling here?  its not used on any of the other reflective calls.  I'm guessing it just makes the exception a little cleaner, so really could be everywhere?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #61859 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61859/consoleFull)** for PR 13831 at commit [`cd0f2bb`](https://github.com/apache/spark/commit/cd0f2bbca068c201ad6630a33a3ab346cd56fbfb).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60987/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    it would be nice to test using purge actually does a purge, ie nothing is in the trash afterwards.  I don't see any easy way to do that, though -- maybe using [`TrashPolicy.getCurrentTrashDir()`](https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/fs/TrashPolicy.html#getCurrentTrashDir())?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    @andrewor14 @yhuai not sure who should review this?
    
    Also, using a parameter with a default value might avoid some of the noise, but I didn't see that approach used anywhere else in these APIs, so didn't go that route.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #61991 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61991/consoleFull)** for PR 13831 at commit [`c108930`](https://github.com/apache/spark/commit/c108930397e73c60df260893168623888a064756).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    minor comments andrequest for some extra tests, but overall looks good


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61406/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61004/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #61004 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61004/consoleFull)** for PR 13831 at commit [`b084081`](https://github.com/apache/spark/commit/b0840819c6c8cfcf45aa31b54d164802536ae4df).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #61859 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61859/consoleFull)** for PR 13831 at commit [`cd0f2bb`](https://github.com/apache/spark/commit/cd0f2bbca068c201ad6630a33a3ab346cd56fbfb).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61859/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/62104/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    you could avoid changing all the callsites by adding a default of `purge = false`, but I'm guessing that is discouraged in the sql code (since eg. there is not default for `ignoreIfNotExists`).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #61991 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61991/consoleFull)** for PR 13831 at commit [`c108930`](https://github.com/apache/spark/commit/c108930397e73c60df260893168623888a064756).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13831: [SPARK-16119][sql] Support PURGE option to drop t...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13831#discussion_r70322921
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala ---
    @@ -643,6 +694,21 @@ private[client] class Shim_v0_14 extends Shim_v0_13 {
           numDP: JInteger, holdDDLTime: JBoolean, listBucketingEnabled: JBoolean, JBoolean.FALSE)
       }
     
    +  override def dropTable(
    +      hive: Hive,
    +      dbName: String,
    +      tableName: String,
    +      deleteData: Boolean,
    +      ignoreIfNotExists: Boolean,
    +      purge: Boolean): Unit = {
    +    try {
    +      dropTableMethod.invoke(hive, dbName, tableName, deleteData: JBoolean,
    +        ignoreIfNotExists: JBoolean, purge: JBoolean)
    +    } catch {
    +      case e: InvocationTargetException => throw e.getCause()
    --- End diff --
    
    https://github.com/apache/spark/pull/13831/commits/b0840819c6c8cfcf45aa31b54d164802536ae4df
    
    (See test failures before that commit.)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #62104 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62104/consoleFull)** for PR 13831 at commit [`f5fcc84`](https://github.com/apache/spark/commit/f5fcc84e346d7c65787f3fc65c57bfd6603a8903).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Merging to master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #61004 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61004/consoleFull)** for PR 13831 at commit [`b084081`](https://github.com/apache/spark/commit/b0840819c6c8cfcf45aa31b54d164802536ae4df).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #60987 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60987/consoleFull)** for PR 13831 at commit [`a53b7fd`](https://github.com/apache/spark/commit/a53b7fdfd64b6617ee861821908684a5afe98eec).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #60987 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60987/consoleFull)** for PR 13831 at commit [`a53b7fd`](https://github.com/apache/spark/commit/a53b7fdfd64b6617ee861821908684a5afe98eec).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13831: [SPARK-16119][sql] Support PURGE option to drop t...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/13831


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    >> it would be nice to test using purge actually does a purge
    
    > None of the tests run on actual HDFS cluster, so I doubt that would be possible without a lot more work...
    
    hmm, yeah I was hoping you could fake this with a localfilesystem, but I futzed with it for a little bit and couldn't get it to work.  ok then.
    
    lgtm


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #62104 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62104/consoleFull)** for PR 13831 at commit [`f5fcc84`](https://github.com/apache/spark/commit/f5fcc84e346d7c65787f3fc65c57bfd6603a8903).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61991/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13831: [SPARK-16119][sql] Support PURGE option to drop t...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13831#discussion_r70062869
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLCommandSuite.scala ---
    @@ -776,21 +778,29 @@ class DDLCommandSuite extends PlanTest {
         val parsed2 = parser.parsePlan(s"DROP TABLE IF EXISTS $tableName1")
         val parsed3 = parser.parsePlan(s"DROP TABLE $tableName2")
         val parsed4 = parser.parsePlan(s"DROP TABLE IF EXISTS $tableName2")
    -    assertUnsupported(s"DROP TABLE IF EXISTS $tableName2 PURGE")
    +    val parsed5 = parser.parsePlan(s"DROP TABLE $tableName2 PURGE")
    --- End diff --
    
    for completeness, probably worth also checking IF EXISTS ... PURGE combo


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    > it would be nice to test using purge actually does a purge
    
    None of the tests run on actual HDFS cluster, so I doubt that would be possible without a lot more work...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #61406 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61406/consoleFull)** for PR 13831 at commit [`3dca099`](https://github.com/apache/spark/commit/3dca099dab560d78e304a1ee0b081a4c8e55b645).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ElementwiseProduct @Since(\"1.4.0\") (@Since(\"1.4.0\") override val uid: String)`
      * `class Normalizer @Since(\"1.4.0\") (@Since(\"1.4.0\") override val uid: String)`
      * `class PolynomialExpansion @Since(\"1.4.0\") (@Since(\"1.4.0\") override val uid: String)`
      * `public class JavaPackage `
      * `case class ShowFunctionsCommand(`
      * `case class StreamingRelationExec(sourceName: String, output: Seq[Attribute]) extends LeafExecNode `


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13831: [SPARK-16119][sql] Support PURGE option to drop t...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13831#discussion_r70065994
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala ---
    @@ -249,7 +249,18 @@ class VersionsSuite extends SparkFunSuite with Logging {
         }
     
         test(s"$version: dropTable") {
    -      client.dropTable("default", tableName = "temporary", ignoreIfNotExists = false)
    +      // First try with the purge option set. This should fail if the version is < 0.14, in which
    +      // case we check the version and try without it.
    +      try {
    +        client.dropTable("default", tableName = "temporary", ignoreIfNotExists = false,
    +          purge = true)
    +      } catch {
    +        case _: UnsupportedOperationException =>
    +          val oldVersions = versions.takeWhile(_ != "0.14")
    +          assert(oldVersions.contains(version))
    +          client.dropTable("default", tableName = "temporary", ignoreIfNotExists = false,
    +            purge = false)
    +      }
    --- End diff --
    
    this doesn't make sure the old versions actually throw an UnsupportedOperationException (eg., could just silently ignore purge).  change it to:
    
    ```scala
    var exception: UnsupportedOperationException = null
    try {
      client.dropTable("default", tableName = "temporary", ignoreIfNotExists = false,
        purge = true)
     } catch {
       case ex: UnsupportedOperationException =>  exception = ex
    }
    if (oldVersions.contains(version)) {
      assert(exception != null)
      client.dropTable("default", tableName = "temporary", ignoreIfNotExists = false,
        purge = false)
    } else {
      assert(exception == null)
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    **[Test build #61406 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61406/consoleFull)** for PR 13831 at commit [`3dca099`](https://github.com/apache/spark/commit/3dca099dab560d78e304a1ee0b081a4c8e55b645).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    I'd like to get this in soon, so pending tests, I'll leave this open until tomorrow and then push, unless I hear otherwise.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13831: [SPARK-16119][sql] Support PURGE option to drop t...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13831#discussion_r70066014
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala ---
    @@ -366,7 +377,20 @@ class VersionsSuite extends SparkFunSuite with Logging {
     
         test(s"$version: dropPartitions") {
           val spec = Map("key1" -> "1", "key2" -> "3")
    -      client.dropPartitions("default", "src_part", Seq(spec), ignoreIfNotExists = true)
    +
    +      // Similar to dropTable; try with purge set, and if it fails, make sure we're running
    +      // with a version that is older than the minimum (1.2 in this case).
    +      try {
    +        client.dropPartitions("default", "src_part", Seq(spec), ignoreIfNotExists = true,
    +          purge = true)
    +      } catch {
    +        case _: UnsupportedOperationException =>
    +          val oldVersions = versions.takeWhile(_ != "1.2")
    +          assert(oldVersions.contains(version))
    +          client.dropPartitions("default", "src_part", Seq(spec), ignoreIfNotExists = true,
    +            purge = false)
    --- End diff --
    
    same here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13831: [SPARK-16119][sql] Support PURGE option to drop t...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13831#discussion_r70079878
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala ---
    @@ -179,7 +179,8 @@ case class DescribeDatabaseCommand(
     case class DropTableCommand(
         tableName: TableIdentifier,
         ifExists: Boolean,
    -    isView: Boolean) extends RunnableCommand {
    +    isView: Boolean,
    +    purge: Boolean) extends RunnableCommand {
     
    --- End diff --
    
    minor but it would be nice to have an `assert(!isView || !purge, "Cannot purge a view")`.  presumably guaranteed by the parser anyway, but it would be nice to have it codified here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13831: [SPARK-16119][sql] Support PURGE option to drop table / ...

Posted by yhuai <gi...@git.apache.org>.
Github user yhuai commented on the issue:

    https://github.com/apache/spark/pull/13831
  
    @vanzin Thank you for the PR. I probably will not be able to review it until we get 2.0 out. Will take a look after the release.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org