danny0405 commented on code in PR #7056:
URL: https://github.com/apache/hudi/pull/7056#discussion_r1006335372


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/catalog/HiveSchemaUtils.java:
##########
@@ -177,10 +180,19 @@ private static DataType 
toFlinkPrimitiveType(PrimitiveTypeInfo hiveType) {
 
   /**
    * Create Hive field schemas from Flink table schema including the hoodie 
metadata fields.
+   *
+   * @param table
    */
-  public static List<FieldSchema> toHiveFieldSchema(TableSchema schema) {
+  public static List<FieldSchema> toHiveFieldSchema(CatalogBaseTable table) {
+    TableSchema schema = table.getSchema();
+    Configuration configuration = Configuration.fromMap(table.getOptions());
+    Boolean changelogEnable = 
configuration.getBoolean(FlinkOptions.CHANGELOG_ENABLED);
+    Collection<String> hoodieMetaColumns = HoodieRecord.HOODIE_META_COLUMNS;
+    if (changelogEnable) {
+      hoodieMetaColumns = HoodieRecord.HOODIE_META_COLUMNS_WITH_OPERATION;

Review Comment:
   The `_hoodie_operation` field is useless for hive table, we should not sync 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to