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

Vectorized UDFToBoolean may unable to filter rows if input is string

    XMLWordPrintableJSON

Details

    Description

      If we use cast boolean to filter rows,  in vectorization mode the filter may be unable to filter rows,  step to reproduce:

      create table vtb (key string, value string);
      insert into table vtb values('0', 'val0'), ('false', 'valfalse'),('off', 'valoff'),('no','valno'),('vk', 'valvk');
      select distinct value from vtb where cast(key as boolean); 

      It's seems we don't generate a SelectColumnIsTrue to filter the rows if the casted type is string:
       https://github.com/apache/hive/blob/ff6f3565e50148b7bcfbcf19b970379f2bd59290/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java#L2995-L2996

      Attachments

        1. HIVE-24666.2.patch
          24 kB
          Zhihua Deng

        Issue Links

          Activity

            People

              dengzh Zhihua Deng
              dengzh Zhihua Deng
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 50m
                  50m