You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "voonhous (via GitHub)" <gi...@apache.org> on 2026/09/28 15:45:50 UTC
[PR] test(variant): pin ALTER COLUMN TYPE refusal [hudi]
voonhous opened a new pull request, #20127:
URL: https://github.com/apache/hudi/pull/20127
### Describe the issue this Pull Request addresses
Validation of Spark 4.1+ `PushVariantIntoScan` on master, schema-evolution item 3 of the checklist on #18285 (https://github.com/apache/hudi/issues/18285#issuecomment-5869224297): an explicit `ALTER TABLE ... ALTER COLUMN n TYPE bigint` on a column beside a variant, without schema-on-read.
Finding: the explicit path cannot widen anything. Without `hoodie.schema.on.read.enable`, `HoodieCatalog.loadTable` hands the table back as a V1Table and the Hudi ALTER rewrite rule is a no-op, so Spark's `ResolveSessionCatalog` turns `ALTER COLUMN ... TYPE` (and the Hive-style `CHANGE COLUMN`) into its v1 `AlterTableChangeColumnCommand`, which `HoodiePostAnalysisRule` swaps for `AlterHoodieTableChangeColumnCommand`. That command refuses every data-type change before `commitWithSchema`, and Spark's own up-cast check on `AlterColumns` never runs on this route, so re-typing the variant itself, or a sibling into a variant, meets the same refusal. A struct member never reaches Hudi: Spark refuses a qualified column on a v1 table at analysis. The DataFrame write pinned by #20125 and #20126 is therefore the only way a sibling gets widened beside a variant, and the "then the implicit read path" half of the checklist item has nothing new to read.
### Summary and Changelog
Test only. `TestVariantShreddingMixedLayouts` gets "Explicit ALTER COLUMN TYPE beside a variant is refused without schema-on-read":
- a top-level table `(id int, v variant, n int, ts long)` and a nested one `(id int, s struct<inner: variant, n: int>, ts long)`, COW and MOR, each seeded with a shredded base file and a second commit (a log block on MOR);
- refused statements, one pinned message each: `ALTER COLUMN n TYPE bigint`, `CHANGE COLUMN n n bigint`, `ALTER COLUMN v TYPE string` and `ALTER COLUMN n TYPE variant` (Hudi: "ALTER TABLE CHANGE COLUMN is not supported for changing column ..."); `ALTER COLUMN s.n TYPE bigint` and `ALTER COLUMN s.inner TYPE string` (Spark: "does not support ALTER COLUMN with qualified column");
- pins that nothing happened: no new instant, catalog types unchanged;
- the variant projection still reads back afterwards on both `spark.sql.variant.pushVariantIntoScan` arms with the plan pinned per arm, and one more insert lands.
Result: green on master as-is. No production change.
### Impact
None.
### Risk Level
none
### Documentation Update
none
### Contributor's checklist
- [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
- [x] Enough context is provided in the sections above
- [x] Adequate tests were added if applicable
--
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
Re: [PR] test(variant): pin ALTER COLUMN TYPE refusal [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #20127:
URL: https://github.com/apache/hudi/pull/20127#issuecomment-5875484825
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2b0afacbf267f579c1f501979ddc2ffe374332ac",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17336",
"triggerID" : "2b0afacbf267f579c1f501979ddc2ffe374332ac",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2b0afacbf267f579c1f501979ddc2ffe374332ac Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17336)
<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
Re: [PR] test(variant): pin ALTER COLUMN TYPE refusal [hudi]
Posted by "voonhous (via GitHub)" <gi...@apache.org>.
voonhous commented on PR #20127:
URL: https://github.com/apache/hudi/pull/20127#issuecomment-5904111888
@wombatu-kun Can you please help to review this? This is to fail loudly if someone tries to alter the column type of a VARIANT column. 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
Re: [PR] test(variant): pin ALTER COLUMN TYPE refusal [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #20127:
URL: https://github.com/apache/hudi/pull/20127#issuecomment-5873703719
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2b0afacbf267f579c1f501979ddc2ffe374332ac",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "2b0afacbf267f579c1f501979ddc2ffe374332ac",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2b0afacbf267f579c1f501979ddc2ffe374332ac 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
Re: [PR] test(variant): pin ALTER COLUMN TYPE refusal [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #20127:
URL: https://github.com/apache/hudi/pull/20127#issuecomment-5874055601
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2b0afacbf267f579c1f501979ddc2ffe374332ac",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17336",
"triggerID" : "2b0afacbf267f579c1f501979ddc2ffe374332ac",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2b0afacbf267f579c1f501979ddc2ffe374332ac Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17336)
<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
Re: [PR] test(variant): pin ALTER COLUMN TYPE refusal [hudi]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #20127:
URL: https://github.com/apache/hudi/pull/20127#issuecomment-5874965268
## [Codecov](https://app.codecov.io/gh/apache/hudi/pull/20127?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 80.40%. Comparing base ([`c74939e`](https://app.codecov.io/gh/apache/hudi/commit/c74939e3b1ed026d93426932e82192d9291c4570?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2b0afac`](https://app.codecov.io/gh/apache/hudi/commit/2b0afacbf267f579c1f501979ddc2ffe374332ac?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #20127 +/- ##
=========================================
Coverage 80.40% 80.40%
Complexity 34891 34891
=========================================
Files 2546 2546
Lines 142908 142908
Branches 17377 17377
=========================================
Hits 114910 114910
Misses 20083 20083
Partials 7915 7915
```
| [Components](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hudi-common](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.97% <ø> (ø)` | |
| [hudi-client](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.44% <ø> (ø)` | |
| [hudi-flink](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `85.72% <ø> (ø)` | |
| [hudi-spark-datasource](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.85% <ø> (ø)` | |
| [hudi-utilities](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.20% <ø> (ø)` | |
| [hudi-cli](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.05% <ø> (ø)` | |
| [hudi-hadoop](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.98% <ø> (ø)` | |
| [hudi-sync](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.02% <ø> (ø)` | |
| [hudi-io](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.50% <ø> (ø)` | |
| [hudi-timeline-service](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.06% <ø> (ø)` | |
| [hudi-cloud](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.00% <ø> (ø)` | |
| [hudi-kafka-connect](https://app.codecov.io/gh/apache/hudi/pull/20127/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.20% <ø> (ø)` | |
| [Flag](https://app.codecov.io/gh/apache/hudi/pull/20127/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hadoop-mr-java-client](https://app.codecov.io/gh/apache/hudi/pull/20127/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `43.99% <ø> (+0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</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
Re: [PR] test(variant): pin ALTER COLUMN TYPE refusal [hudi]
Posted by "voonhous (via GitHub)" <gi...@apache.org>.
voonhous merged PR #20127:
URL: https://github.com/apache/hudi/pull/20127
--
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