Details
-
Improvement
-
Status: In Progress
-
Trivial
-
Resolution: Unresolved
-
2.1.1
-
None
-
None
Description
It is not possible to specify target table columns in static partition insert.
As a result SQL parser will throw an error if fields from sub select does not match target table fields.
For example for the following table
CREATE TABLE my_table(col1 STRING, col2 STRING, col3 STRING) PARTITIONED BY (pcol STRING);
following insert will failed due to different number of fields in select and in target table:
INSERT OVERWRITE TABLE my_table
PARTITION(pcol='TEST')
SELECT 'A' as a, 'B'as b;
Proposed change adds support for the following syntax:
INSERT OVERWRITE TABLE my_table
PARTITION(pcol='TEST')
(col1, col3)
SELECT 'A' as a, 'B'as b;
Issue is marked with Trivial priority as it has workaround such as using dynamic partition insert.