HIVE-26980: Creation of materialized view stored by Iceberg fails if …#3993
Conversation
| throw new SemanticException("Unknown destination type: " + destType); | ||
| } | ||
|
|
||
| if (!(destType == QBMetaData.DEST_DFS_FILE && qb.getIsQuery())) { |
There was a problem hiding this comment.
@kasakrisz, could you please elaborate on if condition? what if destType=DEST_LOCAL_FILE?
IsQuery() would be always false for CTAS and MV
There was a problem hiding this comment.
-
IIUC when destType=DEST_LOCAL_FILE we are inserting into a local directory and no conversion is required since the target is not an actual table. Example.
I extended the if condition with checking whether the destinationTable is null and does it has a storage handler. -
yes, isQuery should be false for ctas and mv
hive/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
Lines 2443 to 2444 in 0a5558d
5cfab02 to
5e24c8d
Compare
|
Hi, @kasakrisz ! Thank you for fixing that issue. I have faced with the exact same in https://issues.apache.org/jira/browse/HIVE-26977? Could you please add that qtest as well to validate your fix fixes the other issue as well. I already tested it on my computer and it worked. Thank you, |
8ba31a4 to
084ec5c
Compare
|
@InvisibleProgrammer |
Sad to hear. That means, if we run the test on the build server, we get a different result than running it on our machine. Could you please add that vectorization test to the setting to get the exact same behavior? |
|
Kudos, SonarCloud Quality Gate passed! |








…source table has tinyint column
What changes were proposed in this pull request?
Some Hive column datatypes are currently not supported by Iceberg. In case of CTAS statements and materialized views Hive converts some of the source table column types to a compatible Iceberg column type.
For the conversion a select operator is generated. The number of input and output columns has to be the same. The number of output columns also depends on dynamic partitioning but in case of Iceberg target table partitioning is handled by the storage handler so it should be ignored.
Why are the changes needed?
To support partitioned materialized view stored by iceberg and to support ctas statements which create tables stored by Iceberg but the source table/query has a column datatype which is not supported by Iceberg.
Does this PR introduce any user-facing change?
No. But such statements runs successfuly.
How was this patch tested?