Member since
05-03-2017
3
Posts
0
Kudos Received
0
Solutions
05-05-2017
06:54 AM
Anyways, your answer has given an approach to solve this. Shall accept your answer.
... View more
05-05-2017
06:52 AM
Thanks for your replay Peter. Actually, this was EXACTLY the question asked during my certification exam and the column was a string '#N/A'. I didn't know about the cast() function, so I was directly comparing float datatype to a string value using '!='. Also the SELECT wasn't returning any rows.
... View more
05-03-2017
05:35 AM
I have a table `exchangedata` in hive with the following columns day STRING
euro float
yen float
dollar float and the tasks to perform on this table are 1) Load data from '/user/practiceuser/exchangedata.csv' in HDFS into `exchangedata` table 2) Remove All the rows where value of euro, yen and dollar is equal to string '#N/A' 3) Load the result into `exchangedata` table My Solution ------- As the `exchangedata` table is not in ORC format and is also not clustered(For DELETE query), I created a temporary table `exchange_temp` with the same columns and then used below query to insert data into `exchangedata` INSERT INTO TABLE exchangedata SELECT day,euro,yen,dollar FROM exchange_temp WHERE euro != '#N/A' AND yen != '#N/A' AND dollar != '#N/A';
But after executing this query I am not getting any row in output.
My question is how can I compare float datatype column with String '#N/A'? The data in the CSV file looks like this FRIDAY,1.234,2.456,1.059
... View more
Labels:
- Labels:
-
Apache Hive