Skip to content
Advertisement

Hive query conditional statement in same select query

Is there a way to get in one single hive query to do a if-else kind of setup.

In the my data below I want to ensure that if Model is empty or having ‘-‘ I populate the Final column with Device else it should be populated with Model

Can someone please help here.

Advertisement

Answer

Read about CASE operator syntax.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement