Finding out the data type of a value in Presto

Leo Jiang picture Leo Jiang · May 26, 2017 · Viewed 9.8k times · Source

I'm getting values from nested maps and it's hard to figure out what data type each value is. Is there a typeof function that can tell me the data type of each value?

Answer

Piotr Findeisen picture Piotr Findeisen · Jan 3, 2018

Yes, there is the typeof function:

presto> select typeof(1), typeof('a');
  _col0  |   _col1
---------+------------
 integer | varchar(1)
(1 row)