Search code examples
sqlhivehiveqlnumeric

HiveQL - How to find the column value is numeric or not using any UDF?


Basically i would like to return rows based on one column value.

If the column contains non numeric values, then return those rows from a hive table.

Any UDF is available in Hive?


Solution

  • I believe Hive supports rlike (regular expressions). So, you can do:

    where col rlike '[^0-9]'
    

    This looks for any non-digit character. You can expand this, if your numeric values might have decimal points or commas.