You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/12/17 06:59:56 UTC

[GitHub] [incubator-kyuubi] wForget opened a new pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

wForget opened a new pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583


   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
     2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   Like the `hive.exec.drop.ignorenonexistent` configuration in hive, do not report an error if DROP DATABASE/TABLE/VIEW/Function/Partition specifies a non-existent database/table/view/function/partition. For details: #1577.
   
   ### _How was this patch tested?_
   - [X] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#issuecomment-997568655


   thanks, merging to master


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] wForget commented on a change in pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
wForget commented on a change in pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#discussion_r771183099



##########
File path: dev/kyuubi-extension-spark-3-1/src/main/scala/org/apache/kyuubi/sql/DropIgnoreNonexistent.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.kyuubi.sql
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.{DropTable, LogicalPlan}
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.execution.command.{AlterTableDropPartitionCommand, DropDatabaseCommand, DropFunctionCommand, DropTableCommand}
+
+import org.apache.kyuubi.sql.KyuubiSQLConf._
+
+case class DropIgnoreNonexistent(session: SparkSession) extends Rule[LogicalPlan] {
+
+  override def apply(plan: LogicalPlan): LogicalPlan = {
+    if (conf.getConf(DROP_IGNORE_NONEXISTENT)) {
+      plan match {
+        case i @ AlterTableDropPartitionCommand(tableName, specs, ifExists, purge, retainData)
+          if !ifExists =>

Review comment:
       > `two more indention`
   
   There seems to be no problem with the indentation here.




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] wForget commented on a change in pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
wForget commented on a change in pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#discussion_r771214722



##########
File path: dev/kyuubi-extension-spark-3-1/src/main/scala/org/apache/kyuubi/sql/DropIgnoreNonexistent.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.kyuubi.sql
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.{DropTable, LogicalPlan}
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.execution.command.{AlterTableDropPartitionCommand, DropDatabaseCommand, DropFunctionCommand, DropTableCommand}
+
+import org.apache.kyuubi.sql.KyuubiSQLConf._
+
+case class DropIgnoreNonexistent(session: SparkSession) extends Rule[LogicalPlan] {
+
+  override def apply(plan: LogicalPlan): LogicalPlan = {
+    if (conf.getConf(DROP_IGNORE_NONEXISTENT)) {
+      plan match {
+        case i @ AlterTableDropPartitionCommand(tableName, specs, ifExists, purge, retainData)
+          if !ifExists =>

Review comment:
       > There seems to be no problem with the indentation here.
   
   Sorry, please ignore it




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#issuecomment-997518352


   > do I need to modify it manually? I didn't find the test case that generated it.
   
   @wForget yes, it's a manual work : (


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#issuecomment-997546329


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1583](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6338266) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/b2e679d5c7daa2f93bbe1bf8051b52799d7687ff?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b2e679d) will **increase** coverage by `0.00%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##             master    #1583    +/-   ##
   ==========================================
     Coverage     59.03%   59.03%            
   + Complexity      248      196    -52     
   ==========================================
     Files           261      256     -5     
     Lines         12964    12708   -256     
     Branches       1620     1601    -19     
   ==========================================
   - Hits           7653     7502   -151     
   + Misses         4668     4570    -98     
   + Partials        643      636     -7     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...in/scala/org/apache/kyuubi/sql/KyuubiSQLConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstY29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9LeXV1YmlTUUxDb25mLnNjYWxh) | `100.00% <100.00%> (ø)` | |
   | [...cala/org/apache/kyuubi/metrics/MetricsSystem.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzU3lzdGVtLnNjYWxh) | `75.00% <0.00%> (-5.00%)` | :arrow_down: |
   | [...a/org/apache/kyuubi/metrics/MetricsConstants.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzQ29uc3RhbnRzLnNjYWxh) | `100.00% <0.00%> (ø)` | |
   | [...che/kyuubi/engine/flink/context/EngineContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvRW5naW5lQ29udGV4dC5qYXZh) | | |
   | [...bi/engine/flink/config/entries/ExecutionEntry.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9lbnRyaWVzL0V4ZWN1dGlvbkVudHJ5LmphdmE=) | | |
   | [...he/kyuubi/engine/flink/context/SessionContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvU2Vzc2lvbkNvbnRleHQuamF2YQ==) | | |
   | [.../kyuubi/engine/flink/config/EngineEnvironment.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9FbmdpbmVFbnZpcm9ubWVudC5qYXZh) | | |
   | [.../kyuubi/engine/flink/context/ExecutionContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvRXhlY3V0aW9uQ29udGV4dC5qYXZh) | | |
   | [...yuubi/engine/flink/config/entries/ConfigEntry.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9lbnRyaWVzL0NvbmZpZ0VudHJ5LmphdmE=) | | |
   | [...pache/kyuubi/server/BackendServiceTimeMetric.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvQmFja2VuZFNlcnZpY2VUaW1lTWV0cmljLnNjYWxh) | `78.37% <0.00%> (ø)` | |
   | ... and [1 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b2e679d...6338266](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#issuecomment-997546329


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1583](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aad43cd) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/b2e679d5c7daa2f93bbe1bf8051b52799d7687ff?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b2e679d) will **decrease** coverage by `0.00%`.
   > The diff coverage is `95.00%`.
   
   > :exclamation: Current head aad43cd differs from pull request most recent head 6338266. Consider uploading reports for the commit 6338266 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1583      +/-   ##
   ============================================
   - Coverage     59.03%   59.02%   -0.01%     
   + Complexity      248      209      -39     
   ============================================
     Files           261      256       -5     
     Lines         12964    12683     -281     
     Branches       1620     1606      -14     
   ============================================
   - Hits           7653     7486     -167     
   + Misses         4668     4561     -107     
   + Partials        643      636       -7     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../org/apache/kyuubi/sql/DropIgnoreNonexistent.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstMy0xL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9Ecm9wSWdub3JlTm9uZXhpc3RlbnQuc2NhbGE=) | `93.33% <93.33%> (ø)` | |
   | [...in/scala/org/apache/kyuubi/sql/KyuubiSQLConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstY29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9LeXV1YmlTUUxDb25mLnNjYWxh) | `100.00% <100.00%> (ø)` | |
   | [.../kyuubi/engine/flink/context/ExecutionContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvRXhlY3V0aW9uQ29udGV4dC5qYXZh) | | |
   | [.../kyuubi/engine/flink/config/EngineEnvironment.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9FbmdpbmVFbnZpcm9ubWVudC5qYXZh) | | |
   | [...yuubi/engine/flink/config/entries/ConfigEntry.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9lbnRyaWVzL0NvbmZpZ0VudHJ5LmphdmE=) | | |
   | [...he/kyuubi/engine/flink/context/SessionContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvU2Vzc2lvbkNvbnRleHQuamF2YQ==) | | |
   | [...bi/engine/flink/config/entries/ExecutionEntry.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9lbnRyaWVzL0V4ZWN1dGlvbkVudHJ5LmphdmE=) | | |
   | [...che/kyuubi/engine/flink/context/EngineContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvRW5naW5lQ29udGV4dC5qYXZh) | | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b2e679d...6338266](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] wForget commented on a change in pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
wForget commented on a change in pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#discussion_r772044184



##########
File path: dev/kyuubi-extension-spark-3-1/src/main/scala/org/apache/kyuubi/sql/DropIgnoreNonexistent.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.kyuubi.sql
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.{DropTable, LogicalPlan}
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.execution.command.{AlterTableDropPartitionCommand, DropDatabaseCommand, DropFunctionCommand, DropTableCommand}
+
+import org.apache.kyuubi.sql.KyuubiSQLConf._
+
+case class DropIgnoreNonexistent(session: SparkSession) extends Rule[LogicalPlan] {
+
+  override def apply(plan: LogicalPlan): LogicalPlan = {
+    if (conf.getConf(DROP_IGNORE_NONEXISTENT)) {
+      plan match {
+        case i @ AlterTableDropPartitionCommand(tableName, specs, ifExists, purge, retainData)
+          if !ifExists =>
+          i.copy(tableName, specs, true, purge, retainData)
+        case i @ DropTable(child, ifExists, purge) if !ifExists =>

Review comment:
       Thanks @ulysses-you , it sounds good to me, I will try it.




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#discussion_r771152756



##########
File path: dev/kyuubi-extension-spark-3-1/src/main/scala/org/apache/kyuubi/sql/DropIgnoreNonexistent.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.kyuubi.sql
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.{DropTable, LogicalPlan}
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.execution.command.{AlterTableDropPartitionCommand, DropDatabaseCommand, DropFunctionCommand, DropTableCommand}
+
+import org.apache.kyuubi.sql.KyuubiSQLConf._
+
+case class DropIgnoreNonexistent(session: SparkSession) extends Rule[LogicalPlan] {
+
+  override def apply(plan: LogicalPlan): LogicalPlan = {
+    if (conf.getConf(DROP_IGNORE_NONEXISTENT)) {
+      plan match {
+        case i @ AlterTableDropPartitionCommand(tableName, specs, ifExists, purge, retainData)
+          if !ifExists =>

Review comment:
       `two more indention`

##########
File path: dev/kyuubi-extension-spark-3-1/src/main/scala/org/apache/kyuubi/sql/DropIgnoreNonexistent.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.kyuubi.sql
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.{DropTable, LogicalPlan}
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.execution.command.{AlterTableDropPartitionCommand, DropDatabaseCommand, DropFunctionCommand, DropTableCommand}
+
+import org.apache.kyuubi.sql.KyuubiSQLConf._
+
+case class DropIgnoreNonexistent(session: SparkSession) extends Rule[LogicalPlan] {
+
+  override def apply(plan: LogicalPlan): LogicalPlan = {
+    if (conf.getConf(DROP_IGNORE_NONEXISTENT)) {
+      plan match {
+        case i @ AlterTableDropPartitionCommand(tableName, specs, ifExists, purge, retainData)
+          if !ifExists =>
+          i.copy(tableName, specs, true, purge, retainData)

Review comment:
       `i.copy(ifExists = true)`
   

##########
File path: dev/kyuubi-extension-spark-3-1/src/main/scala/org/apache/kyuubi/sql/DropIgnoreNonexistent.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.kyuubi.sql
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.{DropTable, LogicalPlan}
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.execution.command.{AlterTableDropPartitionCommand, DropDatabaseCommand, DropFunctionCommand, DropTableCommand}
+
+import org.apache.kyuubi.sql.KyuubiSQLConf._
+
+case class DropIgnoreNonexistent(session: SparkSession) extends Rule[LogicalPlan] {
+
+  override def apply(plan: LogicalPlan): LogicalPlan = {
+    if (conf.getConf(DROP_IGNORE_NONEXISTENT)) {
+      plan match {
+        case i @ AlterTableDropPartitionCommand(tableName, specs, ifExists, purge, retainData)
+          if !ifExists =>
+          i.copy(tableName, specs, true, purge, retainData)
+        case i @ DropTable(child, ifExists, purge) if !ifExists =>

Review comment:
       Why we need catch `DropTable` ?

##########
File path: dev/kyuubi-extension-spark-common/src/main/scala/org/apache/kyuubi/sql/KyuubiSQLConf.scala
##########
@@ -114,4 +114,12 @@ object KyuubiSQLConf {
       .version("1.4.0")
       .intConf
       .createOptional
+
+  val DROP_IGNORE_NONEXISTENT =
+    buildConf("spark.sql.analyzer.drop.ignorenonexistent")

Review comment:
       `spark.sql.optimizer.dropIgnoreNonExistent `




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] wForget commented on a change in pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
wForget commented on a change in pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#discussion_r771191858



##########
File path: dev/kyuubi-extension-spark-3-1/src/main/scala/org/apache/kyuubi/sql/DropIgnoreNonexistent.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.kyuubi.sql
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.{DropTable, LogicalPlan}
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.execution.command.{AlterTableDropPartitionCommand, DropDatabaseCommand, DropFunctionCommand, DropTableCommand}
+
+import org.apache.kyuubi.sql.KyuubiSQLConf._
+
+case class DropIgnoreNonexistent(session: SparkSession) extends Rule[LogicalPlan] {
+
+  override def apply(plan: LogicalPlan): LogicalPlan = {
+    if (conf.getConf(DROP_IGNORE_NONEXISTENT)) {
+      plan match {
+        case i @ AlterTableDropPartitionCommand(tableName, specs, ifExists, purge, retainData)
+          if !ifExists =>
+          i.copy(tableName, specs, true, purge, retainData)
+        case i @ DropTable(child, ifExists, purge) if !ifExists =>

Review comment:
       > Why we need catch `DropTable` ?
   
   When the table does not exist, it does not seem to be resolved as a DropTableCommand.




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#issuecomment-997546329


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1583](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (adadf42) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/b2e679d5c7daa2f93bbe1bf8051b52799d7687ff?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b2e679d) will **decrease** coverage by `0.00%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head adadf42 differs from pull request most recent head 6338266. Consider uploading reports for the commit 6338266 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1583      +/-   ##
   ============================================
   - Coverage     59.03%   59.02%   -0.01%     
   + Complexity      248      196      -52     
   ============================================
     Files           261      256       -5     
     Lines         12964    12708     -256     
     Branches       1620     1601      -19     
   ============================================
   - Hits           7653     7501     -152     
   + Misses         4668     4570      -98     
   + Partials        643      637       -6     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...in/scala/org/apache/kyuubi/sql/KyuubiSQLConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstY29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9LeXV1YmlTUUxDb25mLnNjYWxh) | `100.00% <100.00%> (ø)` | |
   | [...cala/org/apache/kyuubi/metrics/MetricsSystem.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzU3lzdGVtLnNjYWxh) | `75.00% <0.00%> (-5.00%)` | :arrow_down: |
   | [...ache/kyuubi/operation/KyuubiOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uTWFuYWdlci5zY2FsYQ==) | `82.50% <0.00%> (-2.50%)` | :arrow_down: |
   | [...a/org/apache/kyuubi/metrics/MetricsConstants.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzQ29uc3RhbnRzLnNjYWxh) | `100.00% <0.00%> (ø)` | |
   | [...bi/engine/flink/config/entries/ExecutionEntry.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9lbnRyaWVzL0V4ZWN1dGlvbkVudHJ5LmphdmE=) | | |
   | [...che/kyuubi/engine/flink/context/EngineContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvRW5naW5lQ29udGV4dC5qYXZh) | | |
   | [.../kyuubi/engine/flink/context/ExecutionContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvRXhlY3V0aW9uQ29udGV4dC5qYXZh) | | |
   | [.../kyuubi/engine/flink/config/EngineEnvironment.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9FbmdpbmVFbnZpcm9ubWVudC5qYXZh) | | |
   | [...yuubi/engine/flink/config/entries/ConfigEntry.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9lbnRyaWVzL0NvbmZpZ0VudHJ5LmphdmE=) | | |
   | [...he/kyuubi/engine/flink/context/SessionContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvU2Vzc2lvbkNvbnRleHQuamF2YQ==) | | |
   | ... and [2 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b2e679d...6338266](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#issuecomment-997546329


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1583](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aad43cd) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/b2e679d5c7daa2f93bbe1bf8051b52799d7687ff?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b2e679d) will **decrease** coverage by `0.00%`.
   > The diff coverage is `95.00%`.
   
   > :exclamation: Current head aad43cd differs from pull request most recent head adadf42. Consider uploading reports for the commit adadf42 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1583      +/-   ##
   ============================================
   - Coverage     59.03%   59.02%   -0.01%     
   + Complexity      248      209      -39     
   ============================================
     Files           261      256       -5     
     Lines         12964    12683     -281     
     Branches       1620     1606      -14     
   ============================================
   - Hits           7653     7486     -167     
   + Misses         4668     4561     -107     
   + Partials        643      636       -7     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../org/apache/kyuubi/sql/DropIgnoreNonexistent.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstMy0xL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9Ecm9wSWdub3JlTm9uZXhpc3RlbnQuc2NhbGE=) | `93.33% <93.33%> (ø)` | |
   | [...in/scala/org/apache/kyuubi/sql/KyuubiSQLConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstY29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9LeXV1YmlTUUxDb25mLnNjYWxh) | `100.00% <100.00%> (ø)` | |
   | [...bi/engine/flink/config/entries/ExecutionEntry.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9lbnRyaWVzL0V4ZWN1dGlvbkVudHJ5LmphdmE=) | | |
   | [.../kyuubi/engine/flink/context/ExecutionContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvRXhlY3V0aW9uQ29udGV4dC5qYXZh) | | |
   | [...che/kyuubi/engine/flink/context/EngineContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvRW5naW5lQ29udGV4dC5qYXZh) | | |
   | [...yuubi/engine/flink/config/entries/ConfigEntry.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9lbnRyaWVzL0NvbmZpZ0VudHJ5LmphdmE=) | | |
   | [.../kyuubi/engine/flink/config/EngineEnvironment.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbmZpZy9FbmdpbmVFbnZpcm9ubWVudC5qYXZh) | | |
   | [...he/kyuubi/engine/flink/context/SessionContext.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL2NvbnRleHQvU2Vzc2lvbkNvbnRleHQuamF2YQ==) | | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b2e679d...adadf42](https://codecov.io/gh/apache/incubator-kyuubi/pull/1583?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#discussion_r772037176



##########
File path: dev/kyuubi-extension-spark-3-1/src/main/scala/org/apache/kyuubi/sql/DropIgnoreNonexistent.scala
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.kyuubi.sql
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.{DropTable, LogicalPlan}
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.execution.command.{AlterTableDropPartitionCommand, DropDatabaseCommand, DropFunctionCommand, DropTableCommand}
+
+import org.apache.kyuubi.sql.KyuubiSQLConf._
+
+case class DropIgnoreNonexistent(session: SparkSession) extends Rule[LogicalPlan] {
+
+  override def apply(plan: LogicalPlan): LogicalPlan = {
+    if (conf.getConf(DROP_IGNORE_NONEXISTENT)) {
+      plan match {
+        case i @ AlterTableDropPartitionCommand(tableName, specs, ifExists, purge, retainData)
+          if !ifExists =>
+          i.copy(tableName, specs, true, purge, retainData)
+        case i @ DropTable(child, ifExists, purge) if !ifExists =>

Review comment:
       ah I see. It seems not compatiable between Spark 3.1 and 3.2.
   - For 3.1, `DropTable` ifExists -> `NoopDropTable `
   - For 3.2, `DropTable` ifExists -> `ResolveCommandsWithIfExists`
   
   So  it looks more better to me if we can add this rule using `injectPostHocResolutionRule` like `NoopDropTable` or `ResolveCommandsWithIfExists`. What do you think ?




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] wForget commented on pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
wForget commented on pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583#issuecomment-996532573


   > thank you @wForget , please update the new configuration in `docs/sql/rules.md`.
   
   Hi @ulysses-you , do I need to modify it manually? I didn't find the test case that generated it.


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you closed pull request #1583: [KYUUBI #1577] Add DropIgnoreNonexistent Rule.

Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #1583:
URL: https://github.com/apache/incubator-kyuubi/pull/1583


   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org