[ 
https://issues.apache.org/jira/browse/FLINK-18549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17155161#comment-17155161
 ] 

Jun Zhang commented on FLINK-18549:
-----------------------------------

hi ,[~jark]:

In my test, the partition result file is normal , 
the filesystem sink format is ORC, so the rolling policy is controled by 
'sink.rolling-policy.rollover-interval','sink.rolling-policy.check-interval' 
and the checkpoint interval, my checkpoint interval is 10s,so it generate a orc 
file every 10 seconds .

My problem is that according to the above configuration, a empty  _SUCCESS file 
should be generated every 10 seconds, but it does not.

For the same code, if I change the parallelism to more than 1, or if I use 
local file instead of hdfs,for example 'file:///tmp/aaa', the result is also 
normal。I debug the source code, but I still didn't find the reason

> flink 1.11 can not commit partition automatically
> -------------------------------------------------
>
>                 Key: FLINK-18549
>                 URL: https://issues.apache.org/jira/browse/FLINK-18549
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Runtime
>    Affects Versions: 1.11.0
>            Reporter: Jun Zhang
>            Priority: Major
>             Fix For: 1.11.1
>
>
> I use the sql of flink 1.11, read from kafka and writing to hdfs, I found 
> that the partition cannot be submitted automatically. This is my complete 
> code。
> My checkpoint interval is 10s. I think it should be normal that there will be 
> _SUCCESS file under the partition of hdfs every 10s, but in fact there is no
>  
> {code:java}
>        StreamExecutionEnvironment bsEnv = 
> StreamExecutionEnvironment.getExecutionEnvironment();
>       bsEnv.enableCheckpointing(10000);
>       bsEnv.setParallelism(1);
>       StreamTableEnvironment tEnv = StreamTableEnvironment.create(bsEnv);
>       String sqlSource = "CREATE TABLE  source_kafka (\n" +
>                          "    appName  STRING,\n" +
>                          "    appVersion STRING,\n" +
>                          "    uploadTime STRING\n" +
>                          ") WITH (\n" +
>                          "  'connector.type' = 'kafka',       \n" +
>                          "  'connector.version' = '0.10',\n" +
>                          "  'connector.topic' = 'test_topic',\n" +
>                          "  'connector.properties.zookeeper.connect' = 
> 'localhost:2181',\n" +
>                          "  'connector.properties.bootstrap.servers' = 
> 'localhost:9092',\n" +
>                          "  'connector.properties.group.id' = 'testGroup',\n" 
> +
>                          "  'format.type'='json',\n" +
>                          "  'update-mode' = 'append' )";
>       tEnv.executeSql(sqlSource);
>       String sql = "CREATE TABLE fs_table (\n" +
>                    "    appName  STRING,\n" +
>                    "    appVersion STRING,\n" +
>                    "    uploadTime STRING,\n" +
>                    "  dt STRING," +
>                    "  h string" +
>                    ")  PARTITIONED BY (dt,h)  WITH (\n" +
>                    "  'connector'='filesystem',\n" +
>                      "  'path'='hdfs://localhost/tmp/',\n" +
>                      " 'sink.partition-commit.policy.kind' = 'success-file', 
> " +
>                      "  'format'='orc'\n" +
>                      ")";
>       tEnv.executeSql(sql);
>       String insertSql = "insert into  fs_table SELECT appName 
> ,appVersion,uploadTime, " +
>                          " DATE_FORMAT(LOCALTIMESTAMP, 'yyyy-MM-dd'), 
> DATE_FORMAT(LOCALTIMESTAMP, 'HH') FROM source_kafka";
>       tEnv.executeSql(insertSql);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to