[ 
https://issues.apache.org/jira/browse/HIVE-26235?focusedWorklogId=773323&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-773323
 ]

ASF GitHub Bot logged work on HIVE-26235:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/May/22 07:36
            Start Date: 23/May/22 07:36
    Worklog Time Spent: 10m 
      Work Description: pvary commented on code in PR #3305:
URL: https://github.com/apache/hive/pull/3305#discussion_r879114018


##########
ql/src/test/queries/clientpositive/udf_in_binary.q:
##########
@@ -0,0 +1,6 @@
+create table test_binary(data_col timestamp, binary_col binary) partitioned by 
(ts string);
+insert into test_binary partition(ts='202204200000') values ('2022-04-20 
00:00:00.0', 'a'),('2022-04-20 00:00:00.0', 'b'), ('2022-04-20 00:00:00.0', 
'c');
+select * from test_binary where ts='202204200000' and binary_col = unhex('61');
+select * from test_binary where ts='202204200000' and binary_col between 
unhex('61') and unhex('62');
+select * from test_binary where binary_col = unhex('61') or binary_col = 
unhex('62');
+select * from test_binary where ts='202204200000' and (binary_col = 
unhex('61') or binary_col = unhex('62'));

Review Comment:
   Good idea!
   Added





Issue Time Tracking
-------------------

    Worklog Id:     (was: 773323)
    Time Spent: 0.5h  (was: 20m)

> OR Condition on binary column is returning empty result
> -------------------------------------------------------
>
>                 Key: HIVE-26235
>                 URL: https://issues.apache.org/jira/browse/HIVE-26235
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Naresh P R
>            Assignee: Peter Vary
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Repro steps
> {code:java}
> create table test_binary(data_col timestamp, binary_col binary) partitioned 
> by (ts string);
> insert into test_binary partition(ts='202204200000') values ('2022-04-20 
> 00:00:00.0', 'a'),('2022-04-20 00:00:00.0', 'b'), ('2022-04-20 00:00:00.0', 
> 'c');
> // Works
> select * from test_binary where ts='202204200000' and binary_col = 
> unhex('61');
> select * from test_binary where ts='202204200000' and binary_col between 
> unhex('61') and unhex('62');
> //Returns empty result
> select * from test_binary where binary_col = unhex('61') or binary_col = 
> unhex('62');
> select * from test_binary where ts='202204200000' and (binary_col = 
> unhex('61') or binary_col = unhex('62'));
> {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to