Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-24446

Materialized View plan alters explicit cast type in query

    XMLWordPrintableJSON

    Details

      Description

      create materialized view mv_tv_view_data_av2 stored as orc TBLPROPERTIES ('transactional'='true') as
      select
        total_views `total_views`,
        sum(cast(1.5 as decimal(9,4))) over (order by total_views) as quartile,
        program
      from tv_view_data;
      
      LogicalProject(quartile=[CAST($0):DECIMAL(12, 1)], total=[$1])
        HiveTableScan(table=[[arc_view, mv_tv_view_data_av1]], table:alias=[mv_tv_view_data_av1])
      

      Some constant decimal values are not padded in the result set.

      select
      POSTHOOK: query: select
        t.quartile,
        t.quartile,
        max(t.total_views) total
        max(t.total_views) total
      from wealth t2,
      from wealth t2,
      (select
      (select
        total_views `total_views`,
        total_views `total_views`,
        sum(cast(1.5 as decimal(9,4))) over (order by total_views) as quartile,
        sum(cast(1.5 as decimal(9,4))) over (order by total_views) as quartile,
        program
        program
      from tv_view_data) t
      from tv_view_data) t
      where t.program=t2.watches
      where t.program=t2.watches
      group by quartile
      group by quartile
      order by quartile
      
      1.5	1300000
      4.5	15000000
      6.0	20000000
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kkasa Krisztian Kasa
                Reporter:
                kkasa Krisztian Kasa
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m