Re: Discrepancy in String matching between Teradata and HIVE

2015-03-27 Thread Nitin Pawar
Hive is only PRO SQL compliance, In hive the string comparisons work just like they would work in java so in hive "BUILDING" = "BUILDING" "BUILDING " != "BUILDING" (extra space added) On Fri, Mar 27, 2015 at 2:11 PM, @Sanjiv Singh wrote: > Hi, > > I can use rtrim function, i.e: > > select id,

Re: Discrepancy in String matching between Teradata and HIVE

2015-03-27 Thread Raunak Jhawar
Here you are trying to compare two strings ' BUILDING ' (this value has extra white spaces) and 'BUILDING'. These strings are not same since one has bunch of extra white-spaces and other doesn't. Moreover, length of both strings is not same. This would return 1: select if('ABC' == rtrim('ABC

Re: Discrepancy in String matching between Teradata and HIVE

2015-03-27 Thread @Sanjiv Singh
Hi, I can use rtrim function, i.e: select id,name,CONCAT ('"' , status , '"') from customer WHERE rtrim(status) = 'BUILDING' LIMIT 2; But question raised what standard in string comparison Hive uses? According to ANSI/ISO SQL-92 'BUILDING' == 'BUILDING ', Here is a link

Re: Discrepancy in String matching between Teradata and HIVE

2015-03-27 Thread Nitin Pawar
Hive does not manipulate data by its own, if your processing logic needs the trimming of spaces then you can provide that in query. On Fri, Mar 27, 2015 at 1:17 PM, @Sanjiv Singh wrote: > > Hi All, > > I am getting into Hive and learning hive. I have customer table in > teradata , used sqoop

Discrepancy in String matching between Teradata and HIVE

2015-03-27 Thread @Sanjiv Singh
Hi All, I am getting into Hive and learning hive. I have customer table in teradata , used sqoop to extract complete table in hive which worked fine. See below customer table both in Teradata and HIVE. *In Teradata :* select TOP 4 id,name,'"'||status||'"' from customer; 3172460 Cus