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 2020/05/18 02:16:03 UTC

[GitHub] [flink] JingsongLi opened a new pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

JingsongLi opened a new pull request #12206:
URL: https://github.com/apache/flink/pull/12206


   
   ## What is the purpose of the change
   
   Integrate hive to streaming file sink.
   
   ## Brief change log
   
   - Integrate parquet and orc streaming writer to hive.
   - Integrate to StreamingFileWriter and StreamingFileCommitter.
   
   ## Verifying this change
   
   - HiveTableSinkTest.testPartStreamingWrite
   - HiveTableSinkTest.testNonPartStreamingWrite
   
   ## 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/Mesos, 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? JavaDocs


----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot commented on pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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


   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 521334c523a5004883f94e1fb996cdd18081500c (Mon May 18 02:17:50 UTC 2020)
   
   **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.

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



[GitHub] [flink] JingsongLi commented on a change in pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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



##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShim.java
##########
@@ -205,4 +208,10 @@ SimpleGenericUDAFParameterInfo createUDAFParameterInfo(ObjectInspector[] params,
 	 */
 	void createTableWithConstraints(IMetaStoreClient client, Table table, Configuration conf,
 			UniqueConstraint pk, List<Byte> pkTraits, List<String> notNullCols, List<Byte> nnTraits);
+
+	/**
+	 * Create orc {@link BulkWriter.Factory} for different hive versions.
+	 */
+	BulkWriter.Factory<RowData> createOrcBulkWriterFactory(

Review comment:
       I created a orc shim improvement: https://issues.apache.org/jira/browse/FLINK-17785




----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "521334c523a5004883f94e1fb996cdd18081500c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "521334c523a5004883f94e1fb996cdd18081500c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ea5f52f890c9cb5728fd7772f59bea4b38f07ca",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "2ea5f52f890c9cb5728fd7772f59bea4b38f07ca",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 521334c523a5004883f94e1fb996cdd18081500c UNKNOWN
   * 2ea5f52f890c9cb5728fd7772f59bea4b38f07ca 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.

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



[GitHub] [flink] flinkbot commented on pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "521334c523a5004883f94e1fb996cdd18081500c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "521334c523a5004883f94e1fb996cdd18081500c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 521334c523a5004883f94e1fb996cdd18081500c 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.

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



[GitHub] [flink] lirui-apache commented on a change in pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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



##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveRowDataPartitionComputer.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.catalog.hive.client.HiveShim;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.util.DataFormatConverters;
+import org.apache.flink.table.filesystem.RowDataPartitionComputer;
+import org.apache.flink.table.functions.hive.conversion.HiveInspectors;
+import org.apache.flink.table.functions.hive.conversion.HiveObjectConversion;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.utils.TypeConversions;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+
+/**
+ * A {@link RowDataPartitionComputer} that converts Flink objects to Hive objects before computing the partition value strings.
+ */
+public class HiveRowDataPartitionComputer extends RowDataPartitionComputer {

Review comment:
       Perhaps we should rename the old `HivePartitionComputer` to `HiveRowPartitionComputer`?

##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/write/HiveOutputFormatFactory.java
##########
@@ -0,0 +1,81 @@
+/*
+ * 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.write;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.runtime.fs.hdfs.HadoopFileSystem;
+import org.apache.flink.table.filesystem.OutputFormatFactory;
+import org.apache.flink.types.Row;
+
+import org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter;
+import org.apache.hadoop.io.Writable;
+
+import java.io.IOException;
+import java.util.function.Function;
+
+/**
+ * Hive {@link OutputFormatFactory}, use {@link RecordWriter} to write record.
+ */
+public class HiveOutputFormatFactory implements OutputFormatFactory<Row> {

Review comment:
       I think we already have a `HiveOutputFormatFactory`, what's the difference between them?

##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveTableSink.java
##########
@@ -143,21 +206,51 @@ public HiveTableSink(JobConf jobConf, ObjectPath tablePath, CatalogTable table)
 		}
 	}
 
-	@Override
-	public TableSink<Row> configure(String[] fieldNames, TypeInformation<?>[] fieldTypes) {
-		return new HiveTableSink(jobConf, tablePath, catalogTable);
+	private BulkWriter.Factory<RowData> createBulkWriterFactory(String[] partitionColumns,
+			StorageDescriptor sd) {
+		String serLib = sd.getSerdeInfo().getSerializationLib().toLowerCase();
+		int formatFieldCount = tableSchema.getFieldCount() - partitionColumns.length;
+		String[] formatNames = new String[formatFieldCount];
+		LogicalType[] formatTypes = new LogicalType[formatFieldCount];
+		for (int i = 0; i < formatFieldCount; i++) {
+			formatNames[i] = tableSchema.getFieldName(i).get();
+			formatTypes[i] = tableSchema.getFieldDataType(i).get().getLogicalType();
+		}
+		RowType formatType = RowType.of(formatTypes, formatNames);
+		Configuration formatConf = new Configuration(jobConf);
+		sd.getSerdeInfo().getParameters().forEach(formatConf::set);
+		BulkWriter.Factory<RowData> bulkFactory;
+		if (serLib.contains("parquet")) {

Review comment:
       We have already get the output format class. I think it's more reliable to check the class to decide whether the table is stored as orc or parquet.

##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShim.java
##########
@@ -205,4 +208,10 @@ SimpleGenericUDAFParameterInfo createUDAFParameterInfo(ObjectInspector[] params,
 	 */
 	void createTableWithConstraints(IMetaStoreClient client, Table table, Configuration conf,
 			UniqueConstraint pk, List<Byte> pkTraits, List<String> notNullCols, List<Byte> nnTraits);
+
+	/**
+	 * Create orc {@link BulkWriter.Factory} for different hive versions.
+	 */
+	BulkWriter.Factory<RowData> createOrcBulkWriterFactory(

Review comment:
       Shouldn't this method be placed in `OrcShim`? It's strange that HiveShim needs to understand how flink-orc 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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "521334c523a5004883f94e1fb996cdd18081500c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "521334c523a5004883f94e1fb996cdd18081500c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ea5f52f890c9cb5728fd7772f59bea4b38f07ca",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1664",
       "triggerID" : "2ea5f52f890c9cb5728fd7772f59bea4b38f07ca",
       "triggerType" : "PUSH"
     }, {
       "hash" : "299012acbbf33c20a524bfa366bb0a1d07551ec1",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "299012acbbf33c20a524bfa366bb0a1d07551ec1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 521334c523a5004883f94e1fb996cdd18081500c UNKNOWN
   * 2ea5f52f890c9cb5728fd7772f59bea4b38f07ca Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1664) 
   * 299012acbbf33c20a524bfa366bb0a1d07551ec1 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.

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



[GitHub] [flink] JingsongLi commented on a change in pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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



##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/write/HiveOutputFormatFactory.java
##########
@@ -0,0 +1,81 @@
+/*
+ * 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.write;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.runtime.fs.hdfs.HadoopFileSystem;
+import org.apache.flink.table.filesystem.OutputFormatFactory;
+import org.apache.flink.types.Row;
+
+import org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter;
+import org.apache.hadoop.io.Writable;
+
+import java.io.IOException;
+import java.util.function.Function;
+
+/**
+ * Hive {@link OutputFormatFactory}, use {@link RecordWriter} to write record.
+ */
+public class HiveOutputFormatFactory implements OutputFormatFactory<Row> {

Review comment:
       I will delete old one to extract `RecordWriterFactory`.




----------------------------------------------------------------
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.

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



[GitHub] [flink] JingsongLi commented on a change in pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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



##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShim.java
##########
@@ -205,4 +208,10 @@ SimpleGenericUDAFParameterInfo createUDAFParameterInfo(ObjectInspector[] params,
 	 */
 	void createTableWithConstraints(IMetaStoreClient client, Table table, Configuration conf,
 			UniqueConstraint pk, List<Byte> pkTraits, List<String> notNullCols, List<Byte> nnTraits);
+
+	/**
+	 * Create orc {@link BulkWriter.Factory} for different hive versions.
+	 */
+	BulkWriter.Factory<RowData> createOrcBulkWriterFactory(

Review comment:
       I think this is hive shim, because orc factory is related to hive version.
   If not this, will be a ugly `if else`.




----------------------------------------------------------------
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.

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



[GitHub] [flink] JingsongLi commented on pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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


   Thanks @lirui-apache for the review, merging...


----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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


   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 299012acbbf33c20a524bfa366bb0a1d07551ec1 (Fri Oct 16 10:35:50 UTC 2020)
   
   **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.

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



[GitHub] [flink] JingsongLi merged pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

Posted by GitBox <gi...@apache.org>.
JingsongLi merged pull request #12206:
URL: https://github.com/apache/flink/pull/12206


   


----------------------------------------------------------------
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.

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



[GitHub] [flink] JingsongLi commented on a change in pull request #12206: [FLINK-14255][hive] Integrate hive to streaming file sink with parquet and orc

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



##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveTableSink.java
##########
@@ -143,21 +206,51 @@ public HiveTableSink(JobConf jobConf, ObjectPath tablePath, CatalogTable table)
 		}
 	}
 
-	@Override
-	public TableSink<Row> configure(String[] fieldNames, TypeInformation<?>[] fieldTypes) {
-		return new HiveTableSink(jobConf, tablePath, catalogTable);
+	private BulkWriter.Factory<RowData> createBulkWriterFactory(String[] partitionColumns,
+			StorageDescriptor sd) {
+		String serLib = sd.getSerdeInfo().getSerializationLib().toLowerCase();
+		int formatFieldCount = tableSchema.getFieldCount() - partitionColumns.length;
+		String[] formatNames = new String[formatFieldCount];
+		LogicalType[] formatTypes = new LogicalType[formatFieldCount];
+		for (int i = 0; i < formatFieldCount; i++) {
+			formatNames[i] = tableSchema.getFieldName(i).get();
+			formatTypes[i] = tableSchema.getFieldDataType(i).get().getLogicalType();
+		}
+		RowType formatType = RowType.of(formatTypes, formatNames);
+		Configuration formatConf = new Configuration(jobConf);
+		sd.getSerdeInfo().getParameters().forEach(formatConf::set);
+		BulkWriter.Factory<RowData> bulkFactory;
+		if (serLib.contains("parquet")) {

Review comment:
       I created a JIRA for this refactor: https://issues.apache.org/jira/browse/FLINK-17784




----------------------------------------------------------------
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.

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