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 2021/09/12 09:13:46 UTC

[GitHub] [flink] JackWangCS opened a new pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

JackWangCS opened a new pull request #17245:
URL: https://github.com/apache/flink/pull/17245


   ## What is the purpose of the change
   
   This pull request add tests for cutom PartitionCommitPolicy.
   
   
   ## Brief change log
   No changes, only add new tests
   
   ## Verifying this change
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *New test case: HiveTableSinkITCase#testCustomPartitionCommitPolicyNotFound()*
     - *Extend existed test cases in HiveTableSink to cover custom PartitionCommitPolicy*
     - 
   ## 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)`: no
     - 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? no
     - If yes, how is the feature documented? not applicable
   


-- 
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 edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24551",
       "triggerID" : "928452124",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "928452124",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24551) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] flinkbot edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bc2102f6f4ddb7084ea717e3745cd9a97dcf4469 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342) 
   * a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] lirui-apache commented on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-919998104


   Thanks @JackWangCS for your contribution. My suggestion is to add a dedicated test for the custom commit policy, rather than updating existing test cases.
   cc @wuchong @luoyuxia , you may also want to have a look.


-- 
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 #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

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


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2 (Sun Sep 12 09:17:04 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </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] flinkbot edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24551",
       "triggerID" : "928452124",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "928452124",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "d5699dd1fd9fc300bc188e9d77969333d749f8c9",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24553",
       "triggerID" : "d5699dd1fd9fc300bc188e9d77969333d749f8c9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24551) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479) 
   * d5699dd1fd9fc300bc188e9d77969333d749f8c9 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24553) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] flinkbot edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] flinkbot commented on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] lirui-apache closed pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
lirui-apache closed pull request #17245:
URL: https://github.com/apache/flink/pull/17245


   


-- 
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 edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24551",
       "triggerID" : "928452124",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "928452124",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "d5699dd1fd9fc300bc188e9d77969333d749f8c9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d5699dd1fd9fc300bc188e9d77969333d749f8c9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24551) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479) 
   * d5699dd1fd9fc300bc188e9d77969333d749f8c9 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] JackWangCS commented on a change in pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
JackWangCS commented on a change in pull request #17245:
URL: https://github.com/apache/flink/pull/17245#discussion_r715516784



##########
File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveTableSinkITCase.java
##########
@@ -441,6 +470,93 @@ private void checkSuccessFiles(String path) {
         Assert.assertTrue(new File(new File(basePath, "e=11"), "_MY_SUCCESS").exists());
     }
 
+    private void testStreamingWriteWithCustomPartitionCommitPolicy(
+            String customPartitionCommitPolicyClassName) throws Exception {
+        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+        env.setParallelism(1);
+        env.enableCheckpointing(100);
+        // avoid the job to restart infinitely
+        env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, 1_000));
+
+        StreamTableEnvironment tEnv = HiveTestUtils.createTableEnvInStreamingMode(env);
+        tEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
+        tEnv.useCatalog(hiveCatalog.getName());
+        tEnv.getConfig().setSqlDialect(SqlDialect.HIVE);
+
+        try {
+            tEnv.executeSql("create database db1");
+            tEnv.useDatabase("db1");
+
+            // prepare source
+            List<Row> data =
+                    Arrays.asList(
+                            Row.of(1, "a", "b", "2020-05-03", "7"),
+                            Row.of(2, "p", "q", "2020-05-03", "8"),
+                            Row.of(3, "x", "y", "2020-05-03", "9"),
+                            Row.of(4, "x", "y", "2020-05-03", "10"),
+                            Row.of(5, "x", "y", "2020-05-03", "11"));
+            DataStream<Row> stream =
+                    env.addSource(
+                            new FiniteTestSource<>(data),
+                            new RowTypeInfo(
+                                    Types.INT,
+                                    Types.STRING,
+                                    Types.STRING,
+                                    Types.STRING,
+                                    Types.STRING));
+            tEnv.createTemporaryView("my_table", stream, $("a"), $("b"), $("c"), $("d"), $("e"));
+
+            // DDL
+            tEnv.executeSql(
+                    "create external table sink_table (a int,b string,c string"
+                            + ") "
+                            + "partitioned by (d string,e string) "
+                            + " stored as textfile"
+                            + " TBLPROPERTIES ("
+                            + "'"
+                            + PARTITION_TIME_EXTRACTOR_TIMESTAMP_PATTERN.key()

Review comment:
       I forgot to remove this properties, I will remove 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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] JackWangCS commented on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-928889427


   Hi @lirui-apache , thanks for review. Currently, the CI on azure is not stable now: https://dev.azure.com/JackWangCS/Flink/_build/results?buildId=45&view=results. I will re-run the CI pipeline once it works.


-- 
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] lirui-apache closed pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
lirui-apache closed pull request #17245:
URL: https://github.com/apache/flink/pull/17245


   


-- 
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 edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] JackWangCS commented on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-928452124






-- 
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 edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bc2102f6f4ddb7084ea717e3745cd9a97dcf4469 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] SteNicholas commented on a change in pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #17245:
URL: https://github.com/apache/flink/pull/17245#discussion_r710971933



##########
File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/CustomCommitPolicy.java
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.flink.connectors.hive;
+
+import org.apache.flink.table.filesystem.PartitionCommitPolicy;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/** A custom PartitionCommitPolicy for test. */
+public class CustomCommitPolicy implements PartitionCommitPolicy {

Review comment:
       ```suggestion
   public class TestCustomCommitPolicy implements PartitionCommitPolicy {
   ```

##########
File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveTableSinkITCase.java
##########
@@ -153,15 +161,15 @@ public void testBatchAppend() throws Exception {
 
     @Test
     public void testDefaultSerPartStreamingWrite() throws Exception {
-        testStreamingWrite(true, false, "textfile", this::checkSuccessFiles);
+        testStreamingWrite(true, false, "textfile", this::checkPartitionCommitSuccessfully);

Review comment:
       IMO, the original check for success files doesn' need to modify. You could add the new tests for the custom `PartitionCommitPolicy`.

##########
File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/CustomCommitPolicy.java
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.flink.connectors.hive;
+
+import org.apache.flink.table.filesystem.PartitionCommitPolicy;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/** A custom PartitionCommitPolicy for test. */
+public class CustomCommitPolicy implements PartitionCommitPolicy {
+
+    private static Set<String> committedPartitionPaths = new HashSet<>();

Review comment:
       Why is the `committedPartitionPaths` regarded as static?




-- 
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 edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954) 
   * bc2102f6f4ddb7084ea717e3745cd9a97dcf4469 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] flinkbot edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954) 
   * bc2102f6f4ddb7084ea717e3745cd9a97dcf4469 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] JackWangCS commented on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-928452124


   @flinkbot run azure
   


-- 
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] JackWangCS commented on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917597615


   Hi @lirui-apache , I just submited the PR, could you help to review this?
   Thanks.


-- 
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] lirui-apache commented on a change in pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #17245:
URL: https://github.com/apache/flink/pull/17245#discussion_r715418958



##########
File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveTableSinkITCase.java
##########
@@ -441,6 +470,93 @@ private void checkSuccessFiles(String path) {
         Assert.assertTrue(new File(new File(basePath, "e=11"), "_MY_SUCCESS").exists());
     }
 
+    private void testStreamingWriteWithCustomPartitionCommitPolicy(
+            String customPartitionCommitPolicyClassName) throws Exception {
+        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+        env.setParallelism(1);
+        env.enableCheckpointing(100);
+        // avoid the job to restart infinitely
+        env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, 1_000));
+
+        StreamTableEnvironment tEnv = HiveTestUtils.createTableEnvInStreamingMode(env);
+        tEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
+        tEnv.useCatalog(hiveCatalog.getName());
+        tEnv.getConfig().setSqlDialect(SqlDialect.HIVE);
+
+        try {
+            tEnv.executeSql("create database db1");
+            tEnv.useDatabase("db1");
+
+            // prepare source
+            List<Row> data =
+                    Arrays.asList(
+                            Row.of(1, "a", "b", "2020-05-03", "7"),
+                            Row.of(2, "p", "q", "2020-05-03", "8"),
+                            Row.of(3, "x", "y", "2020-05-03", "9"),
+                            Row.of(4, "x", "y", "2020-05-03", "10"),
+                            Row.of(5, "x", "y", "2020-05-03", "11"));
+            DataStream<Row> stream =
+                    env.addSource(
+                            new FiniteTestSource<>(data),
+                            new RowTypeInfo(
+                                    Types.INT,
+                                    Types.STRING,
+                                    Types.STRING,
+                                    Types.STRING,
+                                    Types.STRING));
+            tEnv.createTemporaryView("my_table", stream, $("a"), $("b"), $("c"), $("d"), $("e"));
+
+            // DDL
+            tEnv.executeSql(
+                    "create external table sink_table (a int,b string,c string"
+                            + ") "
+                            + "partitioned by (d string,e string) "
+                            + " stored as textfile"
+                            + " TBLPROPERTIES ("
+                            + "'"
+                            + PARTITION_TIME_EXTRACTOR_TIMESTAMP_PATTERN.key()

Review comment:
       We're using the default `process-time` commit trigger, why do we need to set a partition time extractor?

##########
File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveTableSinkITCase.java
##########
@@ -441,6 +470,93 @@ private void checkSuccessFiles(String path) {
         Assert.assertTrue(new File(new File(basePath, "e=11"), "_MY_SUCCESS").exists());
     }
 
+    private void testStreamingWriteWithCustomPartitionCommitPolicy(
+            String customPartitionCommitPolicyClassName) throws Exception {
+        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+        env.setParallelism(1);
+        env.enableCheckpointing(100);
+        // avoid the job to restart infinitely
+        env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, 1_000));
+
+        StreamTableEnvironment tEnv = HiveTestUtils.createTableEnvInStreamingMode(env);
+        tEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
+        tEnv.useCatalog(hiveCatalog.getName());
+        tEnv.getConfig().setSqlDialect(SqlDialect.HIVE);
+
+        try {
+            tEnv.executeSql("create database db1");
+            tEnv.useDatabase("db1");
+
+            // prepare source
+            List<Row> data =
+                    Arrays.asList(
+                            Row.of(1, "a", "b", "2020-05-03", "7"),
+                            Row.of(2, "p", "q", "2020-05-03", "8"),
+                            Row.of(3, "x", "y", "2020-05-03", "9"),
+                            Row.of(4, "x", "y", "2020-05-03", "10"),
+                            Row.of(5, "x", "y", "2020-05-03", "11"));
+            DataStream<Row> stream =
+                    env.addSource(
+                            new FiniteTestSource<>(data),
+                            new RowTypeInfo(
+                                    Types.INT,
+                                    Types.STRING,
+                                    Types.STRING,
+                                    Types.STRING,
+                                    Types.STRING));
+            tEnv.createTemporaryView("my_table", stream, $("a"), $("b"), $("c"), $("d"), $("e"));
+
+            // DDL
+            tEnv.executeSql(
+                    "create external table sink_table (a int,b string,c string"
+                            + ") "
+                            + "partitioned by (d string,e string) "
+                            + " stored as textfile"
+                            + " TBLPROPERTIES ("
+                            + "'"
+                            + PARTITION_TIME_EXTRACTOR_TIMESTAMP_PATTERN.key()
+                            + "'='$d $e:00:00',"
+                            + "'"
+                            + SINK_PARTITION_COMMIT_DELAY.key()
+                            + "'='1h',"
+                            + "'"
+                            + SINK_PARTITION_COMMIT_POLICY_KIND.key()
+                            + "'='metastore,custom',"
+                            + "'"
+                            + SINK_PARTITION_COMMIT_POLICY_CLASS.key()
+                            + "'='"
+                            + customPartitionCommitPolicyClassName
+                            + "'"
+                            + ")");
+
+            // hive dialect only works with hive tables at the moment, switch to default dialect
+            tEnv.getConfig().setSqlDialect(SqlDialect.DEFAULT);
+            tEnv.sqlQuery("select * from my_table").executeInsert("sink_table").await();
+
+            // check committed partitions for CustomizedCommitPolicy
+            Set<String> committedPaths =
+                    TestCustomCommitPolicy.getCommittedPartitionPathsAndReset();
+            String base =
+                    URI.create(
+                                    hiveCatalog
+                                            .getHiveTable(ObjectPath.fromString("db1.sink_table"))
+                                            .getSd()
+                                            .getLocation())
+                            .getPath();
+            List<String> partitionKVs = Lists.newArrayList("e=7", "e=8", "e=9", "e=10", "e=11");
+            partitionKVs.forEach(
+                    partitionKV -> {
+                        String partitionPath =
+                                new Path(new Path(base, "d=2020-05-03"), partitionKV).toString();
+                        Assert.assertTrue(
+                                String.join("", committedPaths),

Review comment:
       I don't think the error message is helpful, or even readable.

##########
File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveTableSinkITCase.java
##########
@@ -441,6 +470,93 @@ private void checkSuccessFiles(String path) {
         Assert.assertTrue(new File(new File(basePath, "e=11"), "_MY_SUCCESS").exists());
     }
 
+    private void testStreamingWriteWithCustomPartitionCommitPolicy(
+            String customPartitionCommitPolicyClassName) throws Exception {
+        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+        env.setParallelism(1);
+        env.enableCheckpointing(100);
+        // avoid the job to restart infinitely
+        env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, 1_000));
+
+        StreamTableEnvironment tEnv = HiveTestUtils.createTableEnvInStreamingMode(env);
+        tEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
+        tEnv.useCatalog(hiveCatalog.getName());
+        tEnv.getConfig().setSqlDialect(SqlDialect.HIVE);
+
+        try {
+            tEnv.executeSql("create database db1");
+            tEnv.useDatabase("db1");
+
+            // prepare source
+            List<Row> data =
+                    Arrays.asList(
+                            Row.of(1, "a", "b", "2020-05-03", "7"),
+                            Row.of(2, "p", "q", "2020-05-03", "8"),
+                            Row.of(3, "x", "y", "2020-05-03", "9"),
+                            Row.of(4, "x", "y", "2020-05-03", "10"),
+                            Row.of(5, "x", "y", "2020-05-03", "11"));
+            DataStream<Row> stream =
+                    env.addSource(
+                            new FiniteTestSource<>(data),
+                            new RowTypeInfo(
+                                    Types.INT,
+                                    Types.STRING,
+                                    Types.STRING,
+                                    Types.STRING,
+                                    Types.STRING));
+            tEnv.createTemporaryView("my_table", stream, $("a"), $("b"), $("c"), $("d"), $("e"));
+
+            // DDL
+            tEnv.executeSql(
+                    "create external table sink_table (a int,b string,c string"
+                            + ") "
+                            + "partitioned by (d string,e string) "
+                            + " stored as textfile"
+                            + " TBLPROPERTIES ("
+                            + "'"
+                            + PARTITION_TIME_EXTRACTOR_TIMESTAMP_PATTERN.key()
+                            + "'='$d $e:00:00',"
+                            + "'"
+                            + SINK_PARTITION_COMMIT_DELAY.key()
+                            + "'='1h',"
+                            + "'"
+                            + SINK_PARTITION_COMMIT_POLICY_KIND.key()
+                            + "'='metastore,custom',"
+                            + "'"
+                            + SINK_PARTITION_COMMIT_POLICY_CLASS.key()
+                            + "'='"
+                            + customPartitionCommitPolicyClassName
+                            + "'"
+                            + ")");
+
+            // hive dialect only works with hive tables at the moment, switch to default dialect
+            tEnv.getConfig().setSqlDialect(SqlDialect.DEFAULT);
+            tEnv.sqlQuery("select * from my_table").executeInsert("sink_table").await();
+
+            // check committed partitions for CustomizedCommitPolicy
+            Set<String> committedPaths =
+                    TestCustomCommitPolicy.getCommittedPartitionPathsAndReset();
+            String base =
+                    URI.create(
+                                    hiveCatalog
+                                            .getHiveTable(ObjectPath.fromString("db1.sink_table"))
+                                            .getSd()
+                                            .getLocation())
+                            .getPath();
+            List<String> partitionKVs = Lists.newArrayList("e=7", "e=8", "e=9", "e=10", "e=11");
+            partitionKVs.forEach(
+                    partitionKV -> {
+                        String partitionPath =
+                                new Path(new Path(base, "d=2020-05-03"), partitionKV).toString();
+                        Assert.assertTrue(
+                                String.join("", committedPaths),
+                                committedPaths.contains(partitionPath));
+                    });
+        } finally {
+            tEnv.executeSql("drop database db1 cascade");

Review comment:
       ```suggestion
               tEnv.executeSql("drop database if exists db1 cascade");
   ```




-- 
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] JackWangCS commented on a change in pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
JackWangCS commented on a change in pull request #17245:
URL: https://github.com/apache/flink/pull/17245#discussion_r713104035



##########
File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/CustomCommitPolicy.java
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.flink.connectors.hive;
+
+import org.apache.flink.table.filesystem.PartitionCommitPolicy;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/** A custom PartitionCommitPolicy for test. */
+public class CustomCommitPolicy implements PartitionCommitPolicy {
+
+    private static Set<String> committedPartitionPaths = new HashSet<>();

Review comment:
       The `TestCustomCommitPolicy` instance will created by a reflection, `committedPartitionPaths` needs to be static so that I can access the commited paths.




-- 
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] lirui-apache commented on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-927218964


   Thanks @JackWangCS for updating, LGTM. Please take a look at the CI failure. Alternatively, if your own azure pipeline has passed, please post the link here. Either way, we need a successful build to merge the PR.


-- 
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 edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24551",
       "triggerID" : "928452124",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24551) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] JackWangCS commented on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-923509372


   Hi @lirui-apache , @SteNicholas , thanks for your review. I made some changes based on your comments.
   Could you help to review it again?
   


-- 
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 edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794






-- 
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 edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24551",
       "triggerID" : "928452124",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "928452124",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "d5699dd1fd9fc300bc188e9d77969333d749f8c9",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24553",
       "triggerID" : "d5699dd1fd9fc300bc188e9d77969333d749f8c9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d5699dd1fd9fc300bc188e9d77969333d749f8c9 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24553) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] flinkbot edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bc2102f6f4ddb7084ea717e3745cd9a97dcf4469 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342) 
   * a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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] flinkbot edited a comment on pull request #17245: [FLINK-23316][Table SQL/Ecosystem] Add tests for custom PartitionCommitPolicy

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17245:
URL: https://github.com/apache/flink/pull/17245#issuecomment-917600794


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23954",
       "triggerID" : "dbba03443d2eeccf6fdbeb0cf14516b1afb1afd2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24342",
       "triggerID" : "bc2102f6f4ddb7084ea717e3745cd9a97dcf4469",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479",
       "triggerID" : "a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a0309bd0dc7b478d7f761ee5cbbc4d214e576c2a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=24479) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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