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

Vectorized UDFToBoolean may unable to filter rows if input is string

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dengzh Zhihua Deng Assign to me
            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

              Slack

                Issue deployment