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

后端 未结 2 1937
清酒与你
清酒与你 2020-12-31 17:28

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

If the column contains non numeric values, then return those

2条回答
  •  余生分开走
    2020-12-31 18:17

    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.

提交回复
热议问题