CREATE TABLE hive_table (hive_string_column string, hive_int_column int) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'; -- INSERT SOME DATA HERE SELECT * FROM hive_table WHERE hive_string_column != 0; SELECT * FROM hive_table WHERE hive_int_column != '';Both of the queries above will return no results regardless, simply because the types don’t match. The correct query should be:
SELECT * FROM hive_table WHERE hive_string_column != '' OR hive_string_column != '0'; SELECT * FROM hive_table WHERE hive_int_column != 0;It is not an easy pickup initially, but now you know!