Type Cast Functions for Data Type Conversion


Let us understand how we can type cast to change the data type of extracted value to its original type.

SELECT current_date;
SELECT split(current_date, '-')[1];
SELECT cast(split(current_date, '-')[1] AS INT);
SELECT cast('0.04' AS FLOAT);
SELECT cast('0.04' AS INT); //0

Practice hive on state of the art Big Data cluster - https://labs.itversity.com
You can sign up for our courses on Udemy using $10 coupons - Udemy Coupons - Big Data Courses