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

[SPARK-37200][SQL] Support drop index for Data Source V2 #34469

Closed
wants to merge 6 commits into from

Conversation

huaxingao
Copy link
Contributor

What changes were proposed in this pull request?

add drop index syntax

DROP INDEX [IF EXISTS] index_name ON [TABLE] table_name

Why are the changes needed?

so user can drop index using sql

Does this PR introduce any user-facing change?

yes
new sql syntax DROP INDEX [IF EXISTS] index_name ON [TABLE] table_name

How was this patch tested?

new test

@github-actions github-actions bot added the SQL label Nov 2, 2021
@SparkQA
Copy link

SparkQA commented Nov 2, 2021

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

@SparkQA
Copy link

SparkQA commented Nov 2, 2021

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

@SparkQA
Copy link

SparkQA commented Nov 2, 2021

Test build #144850 has finished for PR 34469 at commit dc97485.

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

@SparkQA
Copy link

SparkQA commented Nov 2, 2021

Test build #144856 has finished for PR 34469 at commit 4da7b7b.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 2, 2021

Kubernetes integration test unable to build dist.

exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49326/

@SparkQA
Copy link

SparkQA commented Nov 2, 2021

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

@SparkQA
Copy link

SparkQA commented Nov 2, 2021

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

@huaxingao
Copy link
Contributor Author

cc @sunchao @viirya @dbtsai

@viirya
Copy link
Member

viirya commented Nov 2, 2021

Don't we need JIRA number?

@huaxingao huaxingao changed the title Support drop index [SPARK-37200][SQL] Support drop index Nov 2, 2021
@huaxingao
Copy link
Contributor Author

Added Jira number. @viirya

@SparkQA
Copy link

SparkQA commented Nov 2, 2021

Test build #144857 has finished for PR 34469 at commit 56299c1.

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

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

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

LGTM with two nits. Maybe the title should be "Support drop index for Data Source V2"?

@@ -162,9 +162,26 @@ class MySQLIntegrationSuite extends DockerJDBCIntegrationSuite with V2JDBCTest {
assert(jdbcTable.indexExists("i1") == true)
assert(jdbcTable.indexExists("i2") == true)

// This should pass without Exception
Copy link
Member

Choose a reason for hiding this comment

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

nit: Exception -> exception.

table.dropIndex(indexName)
} catch {
case _: NoSuchIndexException if ignoreIfNotExists =>
logWarning(s"Index $indexName not exists. Ignoring.")
Copy link
Member

Choose a reason for hiding this comment

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

nit: not exists -> does not exist

@huaxingao huaxingao changed the title [SPARK-37200][SQL] Support drop index [SPARK-37200][SQL] Support drop index for Data Source V2 Nov 2, 2021
test("DROP INDEX") {
parseCompare("DROP index i1 ON a.b.c",
DropIndex(UnresolvedTable(Seq("a", "b", "c"), "DROP INDEX", None), "i1", false))
}
Copy link
Member

Choose a reason for hiding this comment

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

Can you add another "IF EXISTS" case?

@SparkQA
Copy link

SparkQA commented Nov 3, 2021

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

@SparkQA
Copy link

SparkQA commented Nov 3, 2021

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

@SparkQA
Copy link

SparkQA commented Nov 3, 2021

Test build #144865 has finished for PR 34469 at commit 5229889.

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

@huaxingao huaxingao closed this in 9babf9a Nov 3, 2021
@huaxingao
Copy link
Contributor Author

Merged to master. Thanks for reviewing! @sunchao @viirya

@huaxingao huaxingao deleted the dropIndex branch November 3, 2021 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants