Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The idea is to rely as much as possible on the logic in ColumnStatsSemanticAnalyzer as other operations do. In particular, they create a 'analyze table t compute statistics for columns', use ColumnStatsSemanticAnalyzer to parse it, and connect resulting plan to existing INSERT/INSERT OVERWRITE statement. The challenge for CTAS or CREATE MATERIALIZED VIEW is that the table object does not exist yet, hence we cannot rely fully on ColumnStatsSemanticAnalyzer.
Thus, we use same process, but ColumnStatsSemanticAnalyzer produces a statement for column stats collection that uses a table values clause instead of the original table reference:
select compute_stats(col1), compute_stats(col2), compute_stats(col3) from table(values(cast(null as int), cast(null as int), cast(null as string))) as t(col1, col2, col3);
Attachments
Attachments
Issue Links
- is related to
-
HIVE-18178 Column stats are not autogathered for materialized views
- Closed
- links to