hudi: [SUPPORT] Failed upsert schema compatibility check
Tips before filing an issue
-
Have you gone through our FAQs?
-
Join the mailing list to engage in conversations and get faster support at dev-subscribe@hudi.apache.org.
-
If you have triaged this as a bug, then file an issue directly.
Describe the problem you faced An exception occurs when spark is used to write hudi org.apache.hudi.exception.HoodieUpsertException: Failed upsert schema compatibility check
submit command:spark-submit --name offline_ods_analy_3001_promote --master yarn --deploy-mode client --num-executors 4 --executor-cores 2 --executor-memory 3g --driver-memory 1g --conf spark.executor.memoryOsverhead=1g --conf spark.sql.parquet.datetimeRebaseModeInWrite=LEGACY --conf spark.sql.parquet.datetimeRebaseModeInRead=LEGACY --conf spark.sql.avro.datetimeRebaseModeInWrite=LEGACY --conf spark.sql.avro.datetimeRebaseModeInRead=LEGACY --conf ‘spark.serializer=org.apache.spark.serializer.KryoSerializer’ --conf ‘spark.sql.catalog.spark_catalog=org.apache.spark.sql.hudi.catalog.HoodieCatalog’ --conf ‘spark.sql.extensions=org.apache.spark.sql.hudi.HoodieSparkSessionExtension’ --conf ‘spark.sql.legacy.timeParserPolicy=LEGACY’ /tmp/yinjian/zmn_binlog_analysis2.py 3001 1 0 0 2024081617
ods.ods_mct_track_result schema: root |-- _hoodie_commit_time: string (nullable = true) |-- _hoodie_commit_seqno: string (nullable = true) |-- _hoodie_record_key: string (nullable = true) |-- _hoodie_partition_path: string (nullable = true) |-- _hoodie_file_name: string (nullable = true) |-- data_create_time: timestamp (nullable = true) |-- data_update_time: timestamp (nullable = true) |-- data_delete_flag: integer (nullable = true) |-- kafka_offset: long (nullable = true) |-- kafka_send_time: timestamp (nullable = true) |-- canal_create_time: timestamp (nullable = true) |-- result_id: string (nullable = true) |-- third_result_id: string (nullable = true) |-- result_type: integer (nullable = true) |-- result_date: timestamp (nullable = true) |-- keyword: string (nullable = true) |-- page_id: integer (nullable = true) |-- site_id: integer (nullable = true) |-- cell_id: integer (nullable = true) |-- plan_id: integer (nullable = true) |-- account_id: integer (nullable = true) |-- channel_one_id: integer (nullable = true) |-- channel_one_name: string (nullable = true) |-- channel_two_id: integer (nullable = true) |-- channel_two_name: string (nullable = true) |-- channel_thr_id: integer (nullable = true) |-- channel_thr_name: string (nullable = true) |-- province_id: integer (nullable = true) |-- province_name: string (nullable = true) |-- city_id: integer (nullable = true) |-- city_name: string (nullable = true) |-- search_word: string (nullable = true) |-- creative_id: integer (nullable = true) |-- consume_amount: integer (nullable = true) |-- consume_top_amount: integer (nullable = true) |-- consume_top_sort: integer (nullable = true) |-- show_count: integer (nullable = true) |-- show_top_count: integer (nullable = true) |-- show_top_win: decimal(10,4) (nullable = true) |-- click_count: integer (nullable = true) |-- click_top_count: integer (nullable = true) |-- clue_count: integer (nullable = true) |-- ask_click_count: integer (nullable = true) |-- ask_clue_count: integer (nullable = true) |-- phone_click_count: integer (nullable = true) |-- phone_succeed_count: integer (nullable = true) |-- phone_clue_count: integer (nullable = true) |-- form_click_count: integer (nullable = true) |-- form_succeed_count: integer (nullable = true) |-- form_clue_count: integer (nullable = true) |-- other_click_count: integer (nullable = true) |-- unique_index: string (nullable = true) |-- unique_index_encrypt: string (nullable = true) |-- exposal_person_count: integer (nullable = true) |-- detail_person_count: integer (nullable = true) |-- order_person_count: integer (nullable = true) |-- reserve_person_count: integer (nullable = true) |-- write_off_person_count: integer (nullable = true) |-- page_time: integer (nullable = true) |-- install: integer (nullable = true) |-- first_download: integer (nullable = true) |-- redownload: integer (nullable = true) |-- ext: string (nullable = true) |-- create_time: timestamp (nullable = true) |-- update_time: timestamp (nullable = true) |-- region: integer (nullable = true)
dataframe is already converted according to schame: cast(date_format(now(),“yyyy-MM-dd HH:mm:ss”) as timestamp) as data_create_time, cast(date_format(now(),“yyyy-MM-dd HH:mm:ss”) as timestamp) as data_update_time, case operation_type when “DELETE” then 2 else 1 end as data_delete_flag, cast(offset as bigint) as kafka_offset, kafka_send_time as kafka_send_time, canal_create_time as canal_create_time, get_json_object(new_data,‘$.result_id’) as result_id, get_json_object(new_data,‘$.third_result_id’) as third_result_id, cast(get_json_object(new_data,‘$.result_type’) as int) as result_type, cast(get_json_object(new_data,‘$.result_date’) as timestamp) as result_date, get_json_object(new_data,‘$.keyword’) as keyword, cast(get_json_object(new_data,‘$.page_id’) as int) as page_id, cast(get_json_object(new_data,‘$.site_id’) as int) as site_id, cast(get_json_object(new_data,‘$.cell_id’) as int) as cell_id, cast(get_json_object(new_data,‘$.plan_id’) as int) as plan_id, cast(get_json_object(new_data,‘$.account_id’) as int) as account_id, cast(get_json_object(new_data,‘$.channel_one_id’) as int) as channel_one_id, get_json_object(new_data,‘$.channel_one_name’) as channel_one_name, cast(get_json_object(new_data,‘$.channel_two_id’) as int) as channel_two_id, get_json_object(new_data,‘$.channel_two_name’) as channel_two_name, cast(get_json_object(new_data,‘$.channel_thr_id’) as int) as channel_thr_id, get_json_object(new_data,‘$.channel_thr_name’) as channel_thr_name, cast(get_json_object(new_data,‘$.province_id’) as int) as province_id, get_json_object(new_data,‘$.province_name’) as province_name, cast(get_json_object(new_data,‘$.city_id’) as int) as city_id, get_json_object(new_data,‘$.city_name’) as city_name, get_json_object(new_data,‘$.search_word’) as search_word, cast(get_json_object(new_data,‘$.creative_id’) as int) as creative_id, cast(get_json_object(new_data,‘$.consume_amount’) as int) as consume_amount, cast(get_json_object(new_data,‘$.consume_top_amount’) as int) as consume_top_amount, cast(get_json_object(new_data,‘$.consume_top_sort’) as int) as consume_top_sort, cast(get_json_object(new_data,‘$.show_count’) as int) as show_count, cast(get_json_object(new_data,‘$.show_top_count’) as int) as show_top_count, cast(get_json_object(new_data,‘$.show_top_win’) as decimal(10,4)) as show_top_win, cast(get_json_object(new_data,‘$.click_count’) as int) as click_count, cast(get_json_object(new_data,‘$.click_top_count’) as int) as click_top_count, cast(get_json_object(new_data,‘$.clue_count’) as int) as clue_count, cast(get_json_object(new_data,‘$.ask_click_count’) as int) as ask_click_count, cast(get_json_object(new_data,‘$.ask_clue_count’) as int) as ask_clue_count, cast(get_json_object(new_data,‘$.phone_click_count’) as int) as phone_click_count, cast(get_json_object(new_data,‘$.phone_succeed_count’) as int) as phone_succeed_count, cast(get_json_object(new_data,‘$.phone_clue_count’) as int) as phone_clue_count, cast(get_json_object(new_data,‘$.form_click_count’) as int) as form_click_count, cast(get_json_object(new_data,‘$.form_succeed_count’) as int) as form_succeed_count, cast(get_json_object(new_data,‘$.form_clue_count’) as int) as form_clue_count, cast(get_json_object(new_data,‘$.other_click_count’) as int) as other_click_count, get_json_object(new_data,‘$.unique_index’) as unique_index, get_json_object(new_data,‘$.unique_index_encrypt’) as unique_index_encrypt, cast(get_json_object(new_data,‘$.exposal_person_count’) as int) as exposal_person_count, cast(get_json_object(new_data,‘$.detail_person_count’) as int) as detail_person_count, cast(get_json_object(new_data,‘$.order_person_count’) as int) as order_person_count, cast(get_json_object(new_data,‘$.reserve_person_count’) as int) as reserve_person_count, cast(get_json_object(new_data,‘$.write_off_person_count’) as int) as write_off_person_count, cast(get_json_object(new_data,‘$.page_time’) as int) as page_time, cast(get_json_object(new_data,‘$.install’) as int) as install, cast(get_json_object(new_data,‘$.first_download’) as int) as first_download, cast(get_json_object(new_data,‘$.redownload’) as int) as redownload, get_json_object(new_data,‘$.ext’) as ext, cast(get_json_object(new_data,‘$.create_time’) as timestamp) as create_time, cast(get_json_object(new_data,‘$.update_time’) as timestamp) as update_time, cast(date_format(cast(get_json_object(new_data,‘$.result_date’) as timestamp),‘yyyyMMdd’) as int) as region
The difference was found by comparing the schema: writerSchema:{“name”:“show_top_win”,“type”:[“null”,{“type”:“fixed”,“name”:“fixed”,“namespace”:“ods_mct_track_result_record.show_top_win”,“size”:5,“logicalType”:“decimal”,“precision”:10,“scale”:4}],“default”:null} tableSchema:{“name”:“show_top_win”,“type”:[“null”,{“type”:“fixed”,“name”:“decimal_10_4”,“size”:5,“logicalType”:“decimal”,“precision”:10,“scale”:4}],“default”:null}
By looking for frequently asked questions, find a few parameters, set still has no effect: ‘hoodie.datasource.write.schema.evolution.enable’:‘true’, ‘hoodie.datasource.write.schema.evolution.allow.missing.fields’:‘true’, ‘hoodie.datasource.write.schema.evolution.allow.new.fields’:‘true’, ‘hoodie.avro.schema.validate’:‘true’, ‘hoodie.avro.schema.externalTransformation’:‘true’, ‘hoodie.avro.schema.allow.auto.evolution’:‘true’ To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Environment Description
-
Hudi version : 0.14.0
-
Spark version : 3.4.2
-
Hive version : 3.1.3
-
Hadoop version : 3.2.1
-
Storage (HDFS/S3/GCS…) : HDFS
-
Running on Docker? (yes/no) : NO
Additional context
Add any other context about the problem here.
Stacktrace
Add the stacktrace of the error.
py4j.protocol.Py4JJavaError: An error occurred while calling o237.save.
: org.apache.hudi.exception.HoodieUpsertException: Failed upsert schema compatibility check
at org.apache.hudi.table.HoodieTable.validateUpsertSchema(HoodieTable.java:852)
at org.apache.hudi.client.SparkRDDWriteClient.upsert(SparkRDDWriteClient.java:152)
at org.apache.hudi.DataSourceUtils.doWriteOperation(DataSourceUtils.java:224)
at org.apache.hudi.HoodieSparkSqlWriter$.writeInternal(HoodieSparkSqlWriter.scala:435)
at org.apache.hudi.HoodieSparkSqlWriter$.write(HoodieSparkSqlWriter.scala:133)
at org.apache.hudi.DefaultSource.createRelation(DefaultSource.scala:150)
at org.apache.spark.sql.execution.datasources.SaveIntoDataSourceCommand.run(SaveIntoDataSourceCommand.scala:47)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:75)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:73)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:84)
at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.$anonfun$applyOrElse$1(QueryExecution.scala:98)
at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$6(SQLExecution.scala:118)
at org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:195)
at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$1(SQLExecution.scala:103)
at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:827)
at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:65)
at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.applyOrElse(QueryExecution.scala:98)
at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.applyOrElse(QueryExecution.scala:94)
at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$1(TreeNode.scala:512)
at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:104)
at org.apache.spark.sql.catalyst.trees.TreeNode.transformDownWithPruning(TreeNode.scala:512)
at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.org$apache$spark$sql$catalyst$plans$logical$AnalysisHelper$$super$transformDownWithPruning(LogicalPlan.scala:31)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning(AnalysisHelper.scala:267)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning$(AnalysisHelper.scala:263)
at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:31)
at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:31)
at org.apache.spark.sql.catalyst.trees.TreeNode.transformDown(TreeNode.scala:488)
at org.apache.spark.sql.execution.QueryExecution.eagerlyExecuteCommands(QueryExecution.scala:94)
at org.apache.spark.sql.execution.QueryExecution.commandExecuted$lzycompute(QueryExecution.scala:81)
at org.apache.spark.sql.execution.QueryExecution.commandExecuted(QueryExecution.scala:79)
at org.apache.spark.sql.execution.QueryExecution.assertCommandExecuted(QueryExecution.scala:133)
at org.apache.spark.sql.DataFrameWriter.runCommand(DataFrameWriter.scala:856)
at org.apache.spark.sql.DataFrameWriter.saveToV1Source(DataFrameWriter.scala:387)
at org.apache.spark.sql.DataFrameWriter.saveInternal(DataFrameWriter.scala:360)
at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:374)
at py4j.Gateway.invoke(Gateway.java:282)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182)
at py4j.ClientServerConnection.run(ClientServerConnection.java:106)
at java.lang.Thread.run(Thread.java:750)
Caused by: org.apache.hudi.exception.HoodieException: Failed to read schema/check compatibility for base path /user/hive/warehouse/ods.db/ods_mct_track_result
at org.apache.hudi.table.HoodieTable.validateSchema(HoodieTable.java:840)
at org.apache.hudi.table.HoodieTable.validateUpsertSchema(HoodieTable.java:850)
… 46 more
Caused by: org.apache.hudi.exception.SchemaCompatibilityException: Failed schema compatibility check
writerSchema: {“type”:“record”,“name”:“ods_mct_track_result_record”,“fields”:[{“name”:“_hoodie_commit_time”,“type”:[“null”,“string”],“doc”:“”,“default”:null},{“name”:“_hoodie_commit_seqno”,“type”:[“null”,“string”],“doc”:“”,“default”:null},{“name”:“_hoodie_record_key”,“type”:[“null”,“string”],“doc”:“”,“default”:null},{“name”:“_hoodie_partition_path”,“type”:[“null”,“string”],“doc”:“”,“default”:null},{“name”:“_hoodie_file_name”,“type”:[“null”,“string”],“doc”:“”,“default”:null},{“name”:“data_create_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“data_update_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“data_delete_flag”,“type”:[“null”,“int”],“default”:null},{“name”:“kafka_offset”,“type”:[“null”,“long”],“default”:null},{“name”:“kafka_send_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“canal_create_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“result_id”,“type”:[“null”,“string”],“default”:null},{“name”:“third_result_id”,“type”:[“null”,“string”],“default”:null},{“name”:“result_type”,“type”:[“null”,“int”],“default”:null},{“name”:“result_date”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“keyword”,“type”:[“null”,“string”],“default”:null},{“name”:“page_id”,“type”:[“null”,“int”],“default”:null},{“name”:“site_id”,“type”:[“null”,“int”],“default”:null},{“name”:“cell_id”,“type”:[“null”,“int”],“default”:null},{“name”:“plan_id”,“type”:[“null”,“int”],“default”:null},{“name”:“account_id”,“type”:[“null”,“int”],“default”:null},{“name”:“channel_one_id”,“type”:[“null”,“int”],“default”:null},{“name”:“channel_one_name”,“type”:[“null”,“string”],“default”:null},{“name”:“channel_two_id”,“type”:[“null”,“int”],“default”:null},{“name”:“channel_two_name”,“type”:[“null”,“string”],“default”:null},{“name”:“channel_thr_id”,“type”:[“null”,“int”],“default”:null},{“name”:“channel_thr_name”,“type”:[“null”,“string”],“default”:null},{“name”:“province_id”,“type”:[“null”,“int”],“default”:null},{“name”:“province_name”,“type”:[“null”,“string”],“default”:null},{“name”:“city_id”,“type”:[“null”,“int”],“default”:null},{“name”:“city_name”,“type”:[“null”,“string”],“default”:null},{“name”:“search_word”,“type”:[“null”,“string”],“default”:null},{“name”:“creative_id”,“type”:[“null”,“int”],“default”:null},{“name”:“consume_amount”,“type”:[“null”,“int”],“default”:null},{“name”:“consume_top_amount”,“type”:[“null”,“int”],“default”:null},{“name”:“consume_top_sort”,“type”:[“null”,“int”],“default”:null},{“name”:“show_count”,“type”:[“null”,“int”],“default”:null},{“name”:“show_top_count”,“type”:[“null”,“int”],“default”:null},{“name”:“show_top_win”,“type”:[“null”,{“type”:“fixed”,“name”:“fixed”,“namespace”:“ods_mct_track_result_record.show_top_win”,“size”:5,“logicalType”:“decimal”,“precision”:10,“scale”:4}],“default”:null},{“name”:“click_count”,“type”:[“null”,“int”],“default”:null},{“name”:“click_top_count”,“type”:[“null”,“int”],“default”:null},{“name”:“clue_count”,“type”:[“null”,“int”],“default”:null},{“name”:“ask_click_count”,“type”:[“null”,“int”],“default”:null},{“name”:“ask_clue_count”,“type”:[“null”,“int”],“default”:null},{“name”:“phone_click_count”,“type”:[“null”,“int”],“default”:null},{“name”:“phone_succeed_count”,“type”:[“null”,“int”],“default”:null},{“name”:“phone_clue_count”,“type”:[“null”,“int”],“default”:null},{“name”:“form_click_count”,“type”:[“null”,“int”],“default”:null},{“name”:“form_succeed_count”,“type”:[“null”,“int”],“default”:null},{“name”:“form_clue_count”,“type”:[“null”,“int”],“default”:null},{“name”:“other_click_count”,“type”:[“null”,“int”],“default”:null},{“name”:“unique_index”,“type”:[“null”,“string”],“default”:null},{“name”:“unique_index_encrypt”,“type”:[“null”,“string”],“default”:null},{“name”:“exposal_person_count”,“type”:[“null”,“int”],“default”:null},{“name”:“detail_person_count”,“type”:[“null”,“int”],“default”:null},{“name”:“order_person_count”,“type”:[“null”,“int”],“default”:null},{“name”:“reserve_person_count”,“type”:[“null”,“int”],“default”:null},{“name”:“write_off_person_count”,“type”:[“null”,“int”],“default”:null},{“name”:“page_time”,“type”:[“null”,“int”],“default”:null},{“name”:“install”,“type”:[“null”,“int”],“default”:null},{“name”:“first_download”,“type”:[“null”,“int”],“default”:null},{“name”:“redownload”,“type”:[“null”,“int”],“default”:null},{“name”:“ext”,“type”:[“null”,“string”],“default”:null},{“name”:“create_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“update_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“region”,“type”:[“null”,“int”],“default”:null}]}
tableSchema: {“type”:“record”,“name”:“ods_mct_track_result_record”,“fields”:[{“name”:“_hoodie_commit_time”,“type”:[“null”,“string”],“doc”:“”,“default”:null},{“name”:“_hoodie_commit_seqno”,“type”:[“null”,“string”],“doc”:“”,“default”:null},{“name”:“_hoodie_record_key”,“type”:[“null”,“string”],“doc”:“”,“default”:null},{“name”:“_hoodie_partition_path”,“type”:[“null”,“string”],“doc”:“”,“default”:null},{“name”:“_hoodie_file_name”,“type”:[“null”,“string”],“doc”:“”,“default”:null},{“name”:“data_create_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“data_update_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“data_delete_flag”,“type”:[“null”,“int”],“default”:null},{“name”:“kafka_offset”,“type”:[“null”,“long”],“default”:null},{“name”:“kafka_send_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“canal_create_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“result_id”,“type”:[“null”,“string”],“default”:null},{“name”:“third_result_id”,“type”:[“null”,“string”],“default”:null},{“name”:“result_type”,“type”:[“null”,“int”],“default”:null},{“name”:“result_date”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“keyword”,“type”:[“null”,“string”],“default”:null},{“name”:“page_id”,“type”:[“null”,“int”],“default”:null},{“name”:“site_id”,“type”:[“null”,“int”],“default”:null},{“name”:“cell_id”,“type”:[“null”,“int”],“default”:null},{“name”:“plan_id”,“type”:[“null”,“int”],“default”:null},{“name”:“account_id”,“type”:[“null”,“int”],“default”:null},{“name”:“channel_one_id”,“type”:[“null”,“int”],“default”:null},{“name”:“channel_one_name”,“type”:[“null”,“string”],“default”:null},{“name”:“channel_two_id”,“type”:[“null”,“int”],“default”:null},{“name”:“channel_two_name”,“type”:[“null”,“string”],“default”:null},{“name”:“channel_thr_id”,“type”:[“null”,“int”],“default”:null},{“name”:“channel_thr_name”,“type”:[“null”,“string”],“default”:null},{“name”:“province_id”,“type”:[“null”,“int”],“default”:null},{“name”:“province_name”,“type”:[“null”,“string”],“default”:null},{“name”:“city_id”,“type”:[“null”,“int”],“default”:null},{“name”:“city_name”,“type”:[“null”,“string”],“default”:null},{“name”:“search_word”,“type”:[“null”,“string”],“default”:null},{“name”:“creative_id”,“type”:[“null”,“int”],“default”:null},{“name”:“consume_amount”,“type”:[“null”,“int”],“default”:null},{“name”:“consume_top_amount”,“type”:[“null”,“int”],“default”:null},{“name”:“consume_top_sort”,“type”:[“null”,“int”],“default”:null},{“name”:“show_count”,“type”:[“null”,“int”],“default”:null},{“name”:“show_top_count”,“type”:[“null”,“int”],“default”:null},{“name”:“show_top_win”,“type”:[“null”,{“type”:“fixed”,“name”:“decimal_10_4”,“size”:5,“logicalType”:“decimal”,“precision”:10,“scale”:4}],“default”:null},{“name”:“click_count”,“type”:[“null”,“int”],“default”:null},{“name”:“click_top_count”,“type”:[“null”,“int”],“default”:null},{“name”:“clue_count”,“type”:[“null”,“int”],“default”:null},{“name”:“ask_click_count”,“type”:[“null”,“int”],“default”:null},{“name”:“ask_clue_count”,“type”:[“null”,“int”],“default”:null},{“name”:“phone_click_count”,“type”:[“null”,“int”],“default”:null},{“name”:“phone_succeed_count”,“type”:[“null”,“int”],“default”:null},{“name”:“phone_clue_count”,“type”:[“null”,“int”],“default”:null},{“name”:“form_click_count”,“type”:[“null”,“int”],“default”:null},{“name”:“form_succeed_count”,“type”:[“null”,“int”],“default”:null},{“name”:“form_clue_count”,“type”:[“null”,“int”],“default”:null},{“name”:“other_click_count”,“type”:[“null”,“int”],“default”:null},{“name”:“unique_index”,“type”:[“null”,“string”],“default”:null},{“name”:“unique_index_encrypt”,“type”:[“null”,“string”],“default”:null},{“name”:“exposal_person_count”,“type”:[“null”,“int”],“default”:null},{“name”:“detail_person_count”,“type”:[“null”,“int”],“default”:null},{“name”:“order_person_count”,“type”:[“null”,“int”],“default”:null},{“name”:“reserve_person_count”,“type”:[“null”,“int”],“default”:null},{“name”:“write_off_person_count”,“type”:[“null”,“int”],“default”:null},{“name”:“page_time”,“type”:[“null”,“int”],“default”:null},{“name”:“install”,“type”:[“null”,“int”],“default”:null},{“name”:“first_download”,“type”:[“null”,“int”],“default”:null},{“name”:“redownload”,“type”:[“null”,“int”],“default”:null},{“name”:“ext”,“type”:[“null”,“string”],“default”:null},{“name”:“create_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“update_time”,“type”:[“null”,{“type”:“long”,“logicalType”:“timestamp-micros”}],“default”:null},{“name”:“region”,“type”:[“null”,“int”],“default”:null}]}
at org.apache.hudi.avro.AvroSchemaUtils.checkSchemaCompatible(AvroSchemaUtils.java:340)
at org.apache.hudi.table.HoodieTable.validateSchema(HoodieTable.java:838)
… 47 more
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (9 by maintainers)
Hi @KnightChess , let me explain my changes in https://github.com/apache/hudi/pull/7895
According documentation of
hoodie.datasource.write.schema.allow.auto.evolution.column.drop: “…batch’s schema can have any of the columns dropped. By default, Hudi will not allow this kind of (auto) schema evolution.” Defaulthoodie.datasource.write.schema.allow.auto.evolution.column.drop=false. So you would expect that if that option is not presented or false then column dropping would cause an error. But it didn’t work as expected. The example from https://github.com/apache/hudi/pull/7895 silently proceeded to work without the error.It happened because of
hoodie.avro.schema.validate=false. Pay attention that it is a default value as well! So I decoupledhoodie.datasource.write.schema.allow.auto.evolution.column.dropandhoodie.avro.schema.validate. Regardless of whetherhoodie.avro.schema.validateis true, false, or not represented, the column dropping check must be performed ifhoodie.datasource.write.schema.allow.auto.evolution.column.dropis false or not presented