hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simanchal Das <>
Subject Re: Review Request 53845: 'like any' and 'like all' operators in hive
Date Mon, 21 Nov 2016 12:29:44 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated Nov. 21, 2016, 12:29 p.m.)

Review request for hive and Carl Steinbach.

Repository: hive-git


In Teradata 'like any' and 'like all' operators are mostly used when we are matching a text
field with numbers of patterns.
'like any' and 'like all' operator are equivalents of multiple like operator like example
--like any
select col1 from table1 where col2 like any ('%accountant%', '%accounting%', '%retail%', '%bank%',

--Can be written using multiple like condition 
select col1 from table1 where col2 like '%accountant%' or col2 like '%accounting%' or col2
like '%retail%' or col2 like '%bank%' or col2 like '%insurance%' ;

--like all
select col1 from table1 where col2 like all ('%accountant%', '%accounting%', '%retail%', '%bank%',

--Can be written using multiple like operator 
select col1 from table1 where col2 like '%accountant%' and col2 like '%accounting%' and col2
like '%retail%' and col2 like '%bank%' and col2 like '%insurance%' ;

Problem statement:

Now a days so many data warehouse projects are being migrated from Teradata to Hive.
Always Data engineer and Business analyst are searching for these two operator.
If we introduce these two operator in hive then so many scripts will be migrated smoothly
instead of converting these operators to multiple like operators.

Diffs (updated)

  ql/src/java/org/apache/hadoop/hive/ql/exec/ 0dbbc1d 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g 4357328 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 55915a6 
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g a82083b 
  ql/src/java/org/apache/hadoop/hive/ql/parse/ 5e708d3 
  ql/src/java/org/apache/hadoop/hive/ql/udf/generic/ PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/udf/generic/ PRE-CREATION 
  ql/src/test/org/apache/hadoop/hive/ql/udf/generic/ PRE-CREATION

  ql/src/test/org/apache/hadoop/hive/ql/udf/generic/ PRE-CREATION

  ql/src/test/queries/clientnegative/udf_likeall_wrong1.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_likeany_wrong1.q PRE-CREATION 
  ql/src/test/queries/clientpositive/udf_likeall.q PRE-CREATION 
  ql/src/test/queries/clientpositive/udf_likeany.q PRE-CREATION 
  ql/src/test/results/clientnegative/udf_likeall_wrong1.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_likeany_wrong1.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/udf_like.q.out 8ffcf9b 
  ql/src/test/results/clientpositive/udf_likeall.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/udf_likeany.q.out PRE-CREATION 



Junit test cases and query.q files are attached


Simanchal Das

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message