jiangxt2 opened a new pull request, #12747: URL: https://github.com/apache/gravitino/pull/12747
### What changes were proposed in this pull request? This pull request preserves the loaded Doris column default when `TableChange.UpdateColumnType` builds the replacement column definition. It also adds focused SQL-generation coverage for string, numeric, `CURRENT_TIMESTAMP`, explicit `DEFAULT NULL`, unset defaults, preserved column attributes, and nested-column rejection. The integration coverage verifies successful default-preserving type changes on Doris 3.0.6.2 and 4.0.6, and verifies on Doris 4.0.6 that an unsupported `VARCHAR` to `BOOLEAN` conversion is still rejected without changing the column type or default. This pull request is opened as a draft so it can be reviewed in parallel with a related Doris default-literal converter change. Before this draft is marked ready, it will be rebased onto that change, its string and numeric SQL expectations will be aligned with the merged Doris quoting rules, and an exact quote/backslash default-value case will be added and verified. ### Why are the changes needed? The Doris catalog currently replaces the existing default with `DEFAULT_VALUE_NOT_SET` when generating a `MODIFY COLUMN` statement for `UpdateColumnType`. Doris treats `MODIFY COLUMN` as a complete column definition and rejects the operation with `Can not change default value` when the submitted definition omits an existing default. Preserving the loaded default makes the generated definition faithful to the unchanged column attributes while leaving type and default compatibility validation to Doris. Fix: #12740 ### Does this PR introduce _any_ user-facing change? Yes. A supported Doris column type change can now preserve an existing default value instead of failing because the generated `MODIFY COLUMN` definition omits that default. This pull request does not change any public API or property key. ### How was this patch tested? - `./gradlew :catalogs:catalog-jdbc-doris:spotlessCheck --console=plain --no-daemon` - `./gradlew rat --console=plain --no-daemon` - `./gradlew :catalogs:catalog-jdbc-doris:test -PskipITs --console=plain --no-daemon` - `./gradlew :catalogs:catalog-jdbc-doris:build -x test --console=plain --no-daemon` - Local static precheck covering negative-test consistency, string-slice safety, switch-case coverage, stale-comment references, orphan-test detection, commit-message validation, regex validation, cross-module impact, and unintended-file detection: all checks passed. - Doris 3.0.6.2: `./gradlew :catalogs:catalog-jdbc-doris:test --tests 'org.apache.gravitino.catalog.doris.integration.test.CatalogDoris3xIT.testAlterColumnTypePreservesDefaultValue' -PskipDockerTests=false -PdorisMultiVersionTest --console=plain --no-daemon` - Doris 4.0.6: `./gradlew :catalogs:catalog-jdbc-doris:test --tests 'org.apache.gravitino.catalog.doris.integration.test.CatalogDoris4xIT.testAlterColumnTypePreservesDefaultValue' -PskipDockerTests=false -PdorisMultiVersionTest --console=plain --no-daemon` - Doris 4.0.6: `./gradlew :catalogs:catalog-jdbc-doris:test --tests 'org.apache.gravitino.catalog.doris.integration.test.CatalogDoris4xIT.testAlterColumnTypeRejectsInvalidConversionWithDefaultValue' -PskipDockerTests=false -PdorisMultiVersionTest --console=plain --no-daemon` All listed checks and focused tests passed. The post-commit static precheck completed all nine checks successfully. -- 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]
