You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/21 09:15:37 UTC

[GitHub] [flink] lsyldliu opened a new pull request, #19545: [FLINK-27241][table] Support DROP PARTITION statement for partitioned table

lsyldliu opened a new pull request, #19545:
URL: https://github.com/apache/flink/pull/19545

   ## What is the purpose of the change
   
   Support DROP PARTITION statement for partitioned table
   
   
   ## Brief change log
   
     - *Support DROP PARTITION statement for partitioned table*
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added unit test in SqlToOperationConverterTest*
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (docs)
   


-- 
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: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] luoyuxia commented on pull request #19545: [FLINK-27241][table] Support DROP PARTITION statement for partitioned table

Posted by "luoyuxia (via GitHub)" <gi...@apache.org>.
luoyuxia commented on PR #19545:
URL: https://github.com/apache/flink/pull/19545#issuecomment-1578128777

   I'll continue your work in #22720


-- 
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: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] lsyldliu closed pull request #19545: [FLINK-27241][table] Support DROP PARTITION statement for partitioned table

Posted by "lsyldliu (via GitHub)" <gi...@apache.org>.
lsyldliu closed pull request #19545: [FLINK-27241][table] Support DROP PARTITION statement for partitioned table
URL: https://github.com/apache/flink/pull/19545


-- 
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: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] luoyuxia commented on a diff in pull request #19545: [FLINK-27241][table] Support DROP PARTITION statement for partitioned table

Posted by GitBox <gi...@apache.org>.
luoyuxia commented on code in PR #19545:
URL: https://github.com/apache/flink/pull/19545#discussion_r857373139


##########
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -574,13 +575,18 @@ SqlAlterTable SqlAlterTable() :
                         startPos.plus(getPos()));
         }
     |
-        <DROP> <CONSTRAINT>
-        constraintName = SimpleIdentifier() {
-            return new SqlAlterTableDropConstraint(
-                tableIdentifier,
-                constraintName,
-                startPos.plus(getPos()));
-        }
+        <DROP>
+        (
+            <CONSTRAINT> constraintName = SimpleIdentifier() {
+                return new SqlAlterTableDropConstraint(
+                            tableIdentifier,
+                            constraintName,
+                            startPos.plus(getPos()));
+            }
+        |
+            [ <IF> <EXISTS> { ifExists = true; } ]

Review Comment:
   Will it be more readable like 
   `
   partSpecs = PartSpecs() {
   return SqlDropPartitions( tableIdentifier, partSpecs, ifExists. );
   }
   `



##########
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -574,13 +575,18 @@ SqlAlterTable SqlAlterTable() :
                         startPos.plus(getPos()));
         }
     |
-        <DROP> <CONSTRAINT>
-        constraintName = SimpleIdentifier() {
-            return new SqlAlterTableDropConstraint(
-                tableIdentifier,
-                constraintName,
-                startPos.plus(getPos()));
-        }
+        <DROP>
+        (
+            <CONSTRAINT> constraintName = SimpleIdentifier() {
+                return new SqlAlterTableDropConstraint(
+                            tableIdentifier,
+                            constraintName,
+                            startPos.plus(getPos()));
+            }
+        |
+            [ <IF> <EXISTS> { ifExists = true; } ]

Review Comment:
   Will it be more readable like 
   `
   partSpecs = PartSpecs() {
   return SqlDropPartitions( tableIdentifier, partSpecs, ifExists. );
   }
   `
   ?



-- 
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: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] flinkbot commented on pull request #19545: [FLINK-27241][table] Support DROP PARTITION statement for partitioned table

Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #19545:
URL: https://github.com/apache/flink/pull/19545#issuecomment-1104939079

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dffe7d74afb34c66d459c62ebca03c9d4e6332a6",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "dffe7d74afb34c66d459c62ebca03c9d4e6332a6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dffe7d74afb34c66d459c62ebca03c9d4e6332a6 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] luoyuxia commented on a diff in pull request #19545: [FLINK-27241][table] Support DROP PARTITION statement for partitioned table

Posted by GitBox <gi...@apache.org>.
luoyuxia commented on code in PR #19545:
URL: https://github.com/apache/flink/pull/19545#discussion_r857373139


##########
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -574,13 +575,18 @@ SqlAlterTable SqlAlterTable() :
                         startPos.plus(getPos()));
         }
     |
-        <DROP> <CONSTRAINT>
-        constraintName = SimpleIdentifier() {
-            return new SqlAlterTableDropConstraint(
-                tableIdentifier,
-                constraintName,
-                startPos.plus(getPos()));
-        }
+        <DROP>
+        (
+            <CONSTRAINT> constraintName = SimpleIdentifier() {
+                return new SqlAlterTableDropConstraint(
+                            tableIdentifier,
+                            constraintName,
+                            startPos.plus(getPos()));
+            }
+        |
+            [ <IF> <EXISTS> { ifExists = true; } ]

Review Comment:
   Should it be `<IF> <EXISTS> <PARTITION>`? what if a sql statement like `alter table drop table`? Seems it will also fall back to `SqlDropPartitions`.
   Maybe it's a little confused that any `drop` except for `CONSTRAINT` will fall back to `SqlDropPartitions`. It may bring some complexity when try to support other `drop`.



##########
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -595,6 +601,38 @@ SqlAlterTable SqlAlterTable() :
     )
 }
 
+/**
+* ALTER TABLE table_name DROP [IF EXISTS] PARTITION partition_spec[, PARTITION partition_spec, ...]

Review Comment:
   nit:
   ```suggestion
   * ALTER TABLE table_identifier DROP [IF EXISTS] PARTITION partition_spec[, PARTITION partition_spec, ...]
   ```



##########
flink-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/FlinkSqlParserImplTest.java:
##########
@@ -338,6 +338,26 @@ void testAlterTableCompact() {
                 .fails("(?s).*Encountered \"\\)\" at line 1, column 26.\n.*");
     }
 
+    @Test
+    public void testDropPartition() {
+        sql("alter table tbl drop if exists partition (p=1)")

Review Comment:
   nit: add a test for alter table like `c1.d1.tbl`.



-- 
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: issues-unsubscribe@flink.apache.org

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