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

Sorted dynamic partition optimization doesn't work if plan require implicit cast

    XMLWordPrintableJSON

Details

    Description

      Repro
      set hive.stats.autogather=false;
      set hive.optimize.sort.dynamic.partition.threshold=1;
      set hive.optimize.bucketingsorting = true;

      drop table if exists t1_staging;
      create table t1_staging(
                                 a string,
                                 b int,
                                 c int,
                                 d string)
          partitioned by (e  decimal(18,0))
          clustered by(a)
              into 256 buckets STORED AS TEXTFILE;
      load data local inpath '../../data/files/sortdp/000000_0' overwrite into table t1_staging partition (e=100);
      
      drop table t1_n147;
      create table t1_n147(
                              a string,
                              b decimal(6,0),
                              c int,
                              d string)
          partitioned by (e decimal(3,0))
          clustered by(a,b)
              into 10 buckets STORED AS ORC TBLPROPERTIES ('transactional'='true');
      
      set hive.stats.autogather=false;
      set hive.optimize.bucketingsorting = true;
      explain insert overwrite table t1_n147 partition(e) select a,b,c,d,e  from t1_staging;
      

      Attachments

        1. HIVE-22777.1.patch
          64 kB
          Vineet Garg
        2. HIVE-22777.2.patch
          172 kB
          Vineet Garg
        3. HIVE-22777.3.patch
          173 kB
          Vineet Garg
        4. HIVE-22777.4.patch
          173 kB
          Vineet Garg
        5. HIVE-22777.5.patch
          209 kB
          Vineet Garg

        Issue Links

          Activity

            People

              vgarg Vineet Garg
              vgarg Vineet Garg
              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 - 0.5h
                  0.5h