我是Hive的新手,所以如果我使用任何错误的条款,请原谅。我基本上想要转换/转换
的输出SELECT to_date(EXPOSURE.ETL_START_DATE) as EXPOSURE_Date_Key
成一个字符串,也
coalesce(EXPOSURE_OPEN.open,0) as open,coalesce(EXPOSURE_CLOSED.closed,0) as closed
也成了一个字符串。
请帮忙。我已经在这方面努力了2天,但无法解决它。提前谢谢!
答案 0 :(得分:0)
你可以像这样使用演员陈述
SELECT cast(to_date(EXPOSURE.ETL_START_DATE) as string) as EXPOSURE_Date_Key
SELECT cast(coalesce(EXPOSURE_OPEN.open,0) as open,coalesce(EXPOSURE_CLOSED.closed,0) as string) as closed