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 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 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-unsubscr...@flink.apache.org
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org