sunchao commented on a change in pull request #34469:
URL: https://github.com/apache/spark/pull/34469#discussion_r741536151
##########
File path:
external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/MySQLIntegrationSuite.scala
##########
@@ -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
Review comment:
nit: `Exception` -> `exception`.
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DropIndexExec.scala
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.execution.datasources.v2
+
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.catalyst.analysis.NoSuchIndexException
+import org.apache.spark.sql.catalyst.expressions.Attribute
+import org.apache.spark.sql.connector.catalog.index.SupportsIndex
+
+/**
+ * Physical plan node for dropping an index.
+ */
+case class DropIndexExec(
+ table: SupportsIndex,
+ indexName: String,
+ ignoreIfNotExists: Boolean) extends LeafV2CommandExec {
+ override protected def run(): Seq[InternalRow] = {
+ try {
+ table.dropIndex(indexName)
+ } catch {
+ case _: NoSuchIndexException if ignoreIfNotExists =>
+ logWarning(s"Index $indexName not exists. Ignoring.")
Review comment:
nit: `not exists` -> `does not exist`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]