Impala Public Jenkins has submitted this change and it was merged. ( https://gerrit.cloudera.org/25191 )
Change subject: IMPALA-15617: Fix ALTER COLUMN DROP DEFAULT on TIMESTAMP and BINARY columns ...................................................................... IMPALA-15617: Fix ALTER COLUMN DROP DEFAULT on TIMESTAMP and BINARY columns ALTER TABLE ... ALTER COLUMN ... DROP DEFAULT failed during analysis on TIMESTAMP columns of Kudu and Iceberg V3 tables, and on BINARY columns of Iceberg V3 tables, even when the column had no default. This made it impossible to remove such defaults from Impala. SET DEFAULT NULL and CREATE TABLE with DEFAULT NULL failed the same way on Kudu TIMESTAMP columns. DROP DEFAULT is analyzed as a NULL default. ColumnDef tried to convert it to Unix time micros for TIMESTAMP columns, which fails for NULL, and AlterTableAlterColStmt validated the type as if a default was being set. ColumnDef now skips the TIMESTAMP conversion for NULL, and AlterTableAlterColStmt validates the type only for SET DEFAULT. Testing: - FE: AnalyzeDDLTest and AnalyzeKuduDDLTest cover DROP DEFAULT and DEFAULT NULL on Kudu TIMESTAMP columns. - E2E: kudu_alter.test and kudu_hms_alter.test cover DROP DEFAULT and SET DEFAULT NULL on a Kudu TIMESTAMP column, and iceberg-v3-default-values.test covers DROP DEFAULT on Iceberg TIMESTAMP and BINARY columns with write-defaults set outside Impala. Change-Id: Ibd358f91dd203261a6cc7f409a4121a4ccda93a8 Assisted-by: Composer 2.5 (Cursor) Reviewed-on: https://gerrit.cloudera.org/25191 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- M fe/src/main/java/org/apache/impala/analysis/AlterTableAlterColStmt.java M fe/src/main/java/org/apache/impala/analysis/ColumnDef.java M fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java M fe/src/test/java/org/apache/impala/analysis/AnalyzeKuduDDLTest.java M testdata/workloads/functional-query/queries/QueryTest/iceberg-v3-default-values.test M testdata/workloads/functional-query/queries/QueryTest/kudu_alter.test M testdata/workloads/functional-query/queries/QueryTest/kudu_hms_alter.test 7 files changed, 64 insertions(+), 4 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit https://gerrit.cloudera.org/25191 To unsubscribe, visit https://gerrit.cloudera.org/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibd358f91dd203261a6cc7f409a4121a4ccda93a8 Gerrit-Change-Number: 25191 Gerrit-PatchSet: 6 Gerrit-Owner: Arnab Karmakar <[email protected]> Gerrit-Reviewer: Arnab Karmakar <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Peter Rozsa <[email protected]> Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
