Reputation: 369
When trying to select only columns where a string is equal to a value in Hive I am returned an empty value.
DESCRIBE table_name;
a string
b int
c int
SELECT * FROM table_name;
"more" 10 30
"dur" 11 30
"vowww" 13 30
The SELECT ... WHERE query I am running is:
SELECT * FROM table_name WHERE a='more'
I have also tried:
To see if double quotes work, if querying for other column values work (it doesnt)
Upvotes: 0
Views: 6269
Reputation: 630
1st try wild card to see whether it is fetching records or not
SELECT * FROM table_name WHERE a like '%more%'
then if it is fetching records
SELECT * FROM table_name WHERE a='"more"'
Upvotes: 1
Reputation: 872
The result of your Query is:
SELECT * FROM table_name;
"more" 10 30
"dur" 11 30
"vowww" 13 30
This query will return the proper values:
SELECT * FROM table_name WHERE a='"more"'
you should remove the "
using regex
.
Please consider reading this answer
Values inserted in hive table with double quotes for string from csv file
Upvotes: 1