IMPALA-14536: Fix CONVERT TO ICEBERG to not throw exception on Iceberg tables

Previously, running ALTER TABLE <table> CONVERT TO ICEBERG on an Iceberg
table produced an error. This patch fixes that, so the statement will do
nothing when called on an Iceberg table and return with 'Table has
already been migrated.' message.

This is achieved by adding a new flag to StatementBase to signal when a
statement ends up NO_OP, if that's true, the new TStmtType::NO_OP will
be set as TExecRequest's type and noop_result can be used to set result
from Frontend-side.

Tests:
 * extended fe and e2e tests

Change-Id: I41ecbfd350d38e4e3fd7b813a4fc27211d828f73
Reviewed-on: http://gerrit.cloudera.org:8080/23699
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Reviewed-by: Peter Rozsa <prozsa@cloudera.com>
This commit is contained in:
Daniel Vanko
2025-11-19 17:56:06 +01:00
committed by Peter Rozsa
parent d54b75ccf1
commit 9d112dae23
8 changed files with 59 additions and 5 deletions

View File

@@ -750,6 +750,10 @@ struct TExecRequest {
// Request for "KILL QUERY" statements.
26: optional TKillQueryReq kill_query_request
// Result of statements which end up being NO_OP. Set iff stmt_type is NO_OP. E.g.,
// "ALTER TABLE ... CONVERT TO ICEBERG" when the table is already an Iceberg table.
27: optional list<string> noop_result
}
// Parameters to FeSupport.cacheJar().

View File

@@ -115,6 +115,7 @@ enum TStmtType {
CONVERT = 8
UNKNOWN = 9
KILL = 10
NO_OP = 11
}
enum TIcebergOperation {