You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/12/16 03:48:55 UTC

[GitHub] [hudi] voonhous opened a new pull request, #7480: Fix read issues when Hudi-FULL schema evolution is not enabled

voonhous opened a new pull request, #7480:
URL: https://github.com/apache/hudi/pull/7480

   ### Change Logs
   
   Prior to Hudi's FULL Schema evolution (HFSE) support, Hudi relies on Avro's schema-resolution to perform schema evolution.
   
   The exhaustive list of permitted schema-changes that Avro's schema-resolution allows for can be found here:
   https://avro.apache.org/docs/1.10.2/spec.html#Schema+Resolution
   
   A summary of the **type changes**  is listed down below:
   ```markdown
   Supported cast conversions:
    - Integer => Long, Float, Double, Decimal*, String*
    - Long => Float, Double, Decimal*, String*
    - Float => Double, Decimal*, String*
    - Double => Decimal*, String*
    - Decimal => Decimal*, String*
    - String => Byte, Decimal*, Date*
    - Byte=> String
    - Date => String*
   
   *type conversions that are supported in Hudi, but not in Native Avro's schema-resolution
   ```
   
   The current write execution flow is as such:
   1. deduceWriterSchema to check if the incoming schema is compatible with table's schema
   2. deduceWriterSchema's validation is an adaptation of Avro's schema compatibility check; if Avro permits such operation, allow execution to proceed
   3. As such if there are implicit schema changes which are compatible with Avro's schema resolution feature, HFSE does not need to be enabled
   4. If writer is writing to a different filegroup, this filegroup will be written with a new schema; while existing filegroups that are not written to will contain the old schema
   
   When reading:
   1. When reading, the same schema will be used for all the filegroup since nothing is written to `.schema`.
   2. Parquet reader will throw errors due to type mismatches when reading
   
   This PR fixes the Spark-read issues when implicit schema changes are made without enabling HFSE. 
   
   The scope of this fix is limited to Spark-Read + Spark-Write.
   
   TODO: Check if issue exists in Flink reader/writer. 
   
   ### Impact
   
   None; no public APIs changed.
   
   ### Risk level (write none, low medium or high below)
   
   low
   
   ### Documentation Update
   
   _Describe any necessary documentation update if there is any new feature, config, or user-facing change_
   
   - _The config description must be updated if new configs are added or the default value of the configs are changed_
   - _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
     ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make
     changes to the website._
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Change Logs and Impact were stated clearly
   - [ ] Adequate tests were added if applicable
   - [ ] CI passed
   


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] voonhous commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
voonhous commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1359140661

   > @voonhous Maybe we need a parameter to control this feature, not all tables need to follow this logic
   
   Hmmm, CMIIW, Hudi has been relying on ASR for schema resolution since Hudi-0.7. As such, I was under the impression that this should be a default behaviour.
   
   Nonetheless, a configuration key can be introduced where in this behaviour is enabled by default. 
   
   However, validation will need to be performed such that the choice between ASR/HFSE is mutually exclusive. i.e. if ASR is enabled, HFSE should be disabled and vice-versa.


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1363745805

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793",
       "triggerID" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13801",
       "triggerID" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13899",
       "triggerID" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ac9854b7f378ba0968373d76033ce07f962f9a49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13926",
       "triggerID" : "ac9854b7f378ba0968373d76033ce07f962f9a49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ac9854b7f378ba0968373d76033ce07f962f9a49",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13940",
       "triggerID" : "1363702710",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13899",
       "triggerID" : "1363702710",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13899) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] voonhous commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
voonhous commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1362461598

   @xiarixiaoyao I have added support for Hudi tables that are schema-evolved via ASR for Spark2.4. 
   
   Can you please help to review the PR again? 
   
   Thank you!


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1360835512

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793",
       "triggerID" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13801",
       "triggerID" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 90722aa7ae44570b58ef6d6e673a1f39429acf39 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13801) 
   * a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] xiarixiaoyao commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1360811258

   > > > @voonhous Maybe we need a parameter to control this feature, not all tables need to follow this logic
   > > 
   > > 
   > > Hmmm, CMIIW, Hudi has been relying on ASR for schema resolution since `hudi-0.7`. As such, I was under the impression that this should be a default behaviour.
   > > Nonetheless, a configuration key can be introduced where in this behaviour is enabled by default.
   > > However, validation will need to be performed such that the choice between ASR/HFSE is mutually exclusive. i.e. if ASR is enabled, HFSE should be disabled and vice-versa. WDYT?
   > 
   > @xiarixiaoyao I looked at the code and realised that there is no way validate configuration values based on other configuration values.
   > 
   > I wanted to add a `AVRO_SCHEMA_RESOLUTION_ENABLE` configuration key with the description:
   > 
   > ```
   > Enable support for schema evolution using Avro's Schema Resolution (ASR). This configuration is mutually exclusive to Hudi's Full/Comprehensive Schema Evolution (HFSE) feature via the configuration key (hoodie.schema.on.read.enable). 
   > 
   > The choice between ASR/HFSE is mutually exclusive. i.e. if ASR is enabled, HFSE should be disabled and vice-versa. 
   > 
   > HFSE will take precedence over ASR. i.e. Enabling both HFSE and ASR will cause Hudi to default to HFSE for schema evolution.
   > ```
   > 
   > Given that this is the intended behaviour and lack of configuration validation, I see no benefit for introducing `AVRO_SCHEMA_RESOLUTION_ENABLE`.
   > 
   > Since `SCHEMA_EVOLUTION_ENABLE` will take precedence over `AVRO_SCHEMA_RESOLUTION_ENABLE`, I think we can rely on the former (`SCHEMA_EVOLUTION_ENABLE`) to determine if ASR should be used.
   > 
   > If `SCHEMA_EVOLUTION_ENABLE` is enabled, use HFSE, else, fallback to ASR.
   > 
   > WDYT?
   agree


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] voonhous commented on a diff in pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
voonhous commented on code in PR #7480:
URL: https://github.com/apache/hudi/pull/7480#discussion_r1053930850


##########
hudi-spark-datasource/hudi-spark3.2plus-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/Spark32PlusHoodieParquetFileFormat.scala:
##########
@@ -228,7 +228,24 @@ class Spark32PlusHoodieParquetFileFormat(private val shouldAppendPartitionValues
 
         SparkInternalSchemaConverter.collectTypeChangedCols(querySchemaOption.get(), mergedInternalSchema)
       } else {
-        new java.util.HashMap()
+        val implicitTypeChangeInfo: java.util.Map[Integer, Pair[DataType, DataType]] = new java.util.HashMap()

Review Comment:
   > Nonetheless, a configuration key can be introduced where in this behaviour is enabled by default.
   
   
   
   > > @voonhous Maybe we need a parameter to control this feature, not all tables need to follow this logic
   > 
   > Hmmm, CMIIW, Hudi has been relying on ASR for schema resolution since `hudi-0.7`. As such, I was under the impression that this should be a default behaviour.
   > 
   > Nonetheless, a configuration key can be introduced where in this behaviour is enabled by default.
   > 
   > However, validation will need to be performed such that the choice between ASR/HFSE is mutually exclusive. i.e. if ASR is enabled, HFSE should be disabled and vice-versa. WDYT?
   
   @xiarixiaoyao I looked at the code and realised that there is no way validate configuration values based on other configuration values. 
   
   I wanted to add a `AVRO_SCHEMA_RESOLUTION_ENABLE` configuration key with the description:
   
   ```text
   Enable support for schema evolution using Avro's Schema Resolution (ASR). This configuration is mutually exclusive to Hudi's Full/Comprehensive Schema Evolution (HFSE) feature via the configuration key (hoodie.schema.on.read.enable). 
   
   The choice between ASR/HFSE is mutually exclusive. i.e. if ASR is enabled, HFSE should be disabled and vice-versa. 
   
   HFSE will take precedence over ASR. i.e. Enabling both HFSE and ASR will cause Hudi to default to HFSE for schema evolution.
   ```
   
   Given that this is the intended behaviour and lack of configuration validation, I see no benefit for introducing `AVRO_SCHEMA_RESOLUTION_ENABLE`.
   
   Since `SCHEMA_EVOLUTION_ENABLE` will take precedence over `AVRO_SCHEMA_RESOLUTION_ENABLE`, I think we can rely on the former (`SCHEMA_EVOLUTION_ENABLE`) to determine if ASR should be used.
   
   If  `SCHEMA_EVOLUTION_ENABLE` is enabled, use HFSE, else, fallback to ASR.
   
   WDYT?



-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] xiarixiaoyao commented on a diff in pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao commented on code in PR #7480:
URL: https://github.com/apache/hudi/pull/7480#discussion_r1053309260


##########
hudi-spark-datasource/hudi-spark3.2plus-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/Spark32PlusHoodieParquetFileFormat.scala:
##########
@@ -228,7 +228,24 @@ class Spark32PlusHoodieParquetFileFormat(private val shouldAppendPartitionValues
 
         SparkInternalSchemaConverter.collectTypeChangedCols(querySchemaOption.get(), mergedInternalSchema)
       } else {
-        new java.util.HashMap()
+        val implicitTypeChangeInfo: java.util.Map[Integer, Pair[DataType, DataType]] = new java.util.HashMap()

Review Comment:
   pls extract a function



-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] xiarixiaoyao merged pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao merged PR #7480:
URL: https://github.com/apache/hudi/pull/7480


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] xiarixiaoyao commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1354387964

   @voonhous 
   nice work,will take a look at the weekend


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1354452732

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793",
       "triggerID" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f3193eb19203e43c28e6c20dc9318be27dd06e49 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793) 
   * 90722aa7ae44570b58ef6d6e673a1f39429acf39 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1354217164

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793",
       "triggerID" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f3193eb19203e43c28e6c20dc9318be27dd06e49 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1355053313

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793",
       "triggerID" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13801",
       "triggerID" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 90722aa7ae44570b58ef6d6e673a1f39429acf39 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13801) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] xiarixiaoyao commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1357152051

   @voonhous 
   Maybe we need a parameter to control this feature, not all tables need to follow this logic


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] xiarixiaoyao commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1360813325

   @voonhous
   pls rebase code,
   once ci pass,we can merge 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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] voonhous commented on a diff in pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
voonhous commented on code in PR #7480:
URL: https://github.com/apache/hudi/pull/7480#discussion_r1053934368


##########
hudi-spark-datasource/hudi-spark3.2plus-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/Spark32PlusHoodieParquetFileFormat.scala:
##########
@@ -228,7 +228,24 @@ class Spark32PlusHoodieParquetFileFormat(private val shouldAppendPartitionValues
 
         SparkInternalSchemaConverter.collectTypeChangedCols(querySchemaOption.get(), mergedInternalSchema)
       } else {
-        new java.util.HashMap()
+        val implicitTypeChangeInfo: java.util.Map[Integer, Pair[DataType, DataType]] = new java.util.HashMap()

Review Comment:
   Fixed with the latest commit



-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] xiarixiaoyao commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1363702710

   @hudi-bot run azure


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1363571082

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793",
       "triggerID" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13801",
       "triggerID" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13899",
       "triggerID" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ac9854b7f378ba0968373d76033ce07f962f9a49",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13926",
       "triggerID" : "ac9854b7f378ba0968373d76033ce07f962f9a49",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13899) 
   * ac9854b7f378ba0968373d76033ce07f962f9a49 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13926) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] xiarixiaoyao commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1359342135

   Looks good.
   maybe we also need a pr for flink


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] xiarixiaoyao commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1364480552

   @voonhous 
   Thanks for your contribution


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] voonhous commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
voonhous commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1360814665

   > @voonhous pls rebase code, once ci pass,we can merge it .
   
   Done!


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1354164147

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f3193eb19203e43c28e6c20dc9318be27dd06e49 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1363567337

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793",
       "triggerID" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13801",
       "triggerID" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13899",
       "triggerID" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ac9854b7f378ba0968373d76033ce07f962f9a49",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ac9854b7f378ba0968373d76033ce07f962f9a49",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13899) 
   * ac9854b7f378ba0968373d76033ce07f962f9a49 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1363741831

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793",
       "triggerID" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13801",
       "triggerID" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13899",
       "triggerID" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ac9854b7f378ba0968373d76033ce07f962f9a49",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13926",
       "triggerID" : "ac9854b7f378ba0968373d76033ce07f962f9a49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a3015b0c6ecdfbdaebdb6f539f3ba167eabb327c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1363702710",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "ac9854b7f378ba0968373d76033ce07f962f9a49",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13940",
       "triggerID" : "1363702710",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * ac9854b7f378ba0968373d76033ce07f962f9a49 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13926) Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13940) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] xiarixiaoyao commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1362632735

   @voonhous 
   Thank you for your support for spark2.4, although I personally think we don't need to support 2.4.
   let‘s  extract  buildImplicitSchemaChangeInfo and isDataTypeEqual to a helper class to reuse.


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] voonhous commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
voonhous commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1362665267

   > @voonhous Thank you for your support for spark2.4, although I personally think we don't need to support 2.4. let‘s extract buildImplicitSchemaChangeInfo and isDataTypeEqual to a helper class to reuse.
   
   Done!


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] voonhous commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
voonhous commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1360786269

   > > @voonhous Maybe we need a parameter to control this feature, not all tables need to follow this logic
   > 
   > Hmmm, CMIIW, Hudi has been relying on ASR for schema resolution since `hudi-0.7`. As such, I was under the impression that this should be a default behaviour.
   > 
   > Nonetheless, a configuration key can be introduced where in this behaviour is enabled by default.
   > 
   > However, validation will need to be performed such that the choice between ASR/HFSE is mutually exclusive. i.e. if ASR is enabled, HFSE should be disabled and vice-versa. WDYT?
   
   @xiarixiaoyao I looked at the code and realised that there is no way validate configuration values based on other configuration values. 
   
   I wanted to add a `AVRO_SCHEMA_RESOLUTION_ENABLE` configuration key with the description:
   
   ```text
   Enable support for schema evolution using Avro's Schema Resolution (ASR). This configuration is mutually exclusive to Hudi's Full/Comprehensive Schema Evolution (HFSE) feature via the configuration key (hoodie.schema.on.read.enable). 
   
   The choice between ASR/HFSE is mutually exclusive. i.e. if ASR is enabled, HFSE should be disabled and vice-versa. 
   
   HFSE will take precedence over ASR. i.e. Enabling both HFSE and ASR will cause Hudi to default to HFSE for schema evolution.
   ```
   
   Given that this is the intended behaviour and lack of configuration validation, I see no benefit for introducing `AVRO_SCHEMA_RESOLUTION_ENABLE`.
   
   Since `SCHEMA_EVOLUTION_ENABLE` will take precedence over `AVRO_SCHEMA_RESOLUTION_ENABLE`, I think we can rely on the former (`SCHEMA_EVOLUTION_ENABLE`) to determine if ASR should be used.
   
   If  `SCHEMA_EVOLUTION_ENABLE` is enabled, use HFSE, else, fallback to ASR.
   
   WDYT?


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #7480: [HUDI-5400] Fix read issues when Hudi-FULL schema evolution is not enabled

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7480:
URL: https://github.com/apache/hudi/pull/7480#issuecomment-1354459082

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793",
       "triggerID" : "f3193eb19203e43c28e6c20dc9318be27dd06e49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13801",
       "triggerID" : "90722aa7ae44570b58ef6d6e673a1f39429acf39",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f3193eb19203e43c28e6c20dc9318be27dd06e49 Azure: [CANCELED](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13793) 
   * 90722aa7ae44570b58ef6d6e673a1f39429acf39 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13801) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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