Skip to content Skip to sidebar Skip to footer

How To Compare Two Columns With Different Data Type Groups

This is an extension of a question I posed yesterday: How to handle potential data loss when performing comparisons across data types in different groups In HIVE, is it possible to

Solution 1:

Cast implicitly is good idea:

CASE 
    WHEN  Column1 <=> cast(Column2 as bigint) THEN 0 
    ELSE 1
END

If not possible to cast, the result of cast is NULL.


Post a Comment for "How To Compare Two Columns With Different Data Type Groups"