Why does all columns get created as string when I use OpenCSVSerde in Hive?

馋奶兔 提交于 2019-12-03 16:07:49

This is known limitation of CSVSerDe serde. CSVSerDe treats all columns to be of type String. Even if you create a table with non-string column types using this SerDe, the DESCRIBE TABLE output would show string column type. The type information is retrieved from the SerDe. To convert columns to the desired type in a table, you can create a view over the table that does the CAST to the desired type.

See here: CSVSerde This confluence is about CSVSerDe, but it uses Open-CSV

Also see here: https://docs.aws.amazon.com/athena/latest/ug/csv.html

And here: Hive "OpenCSVSerde" Changes Your Table Definition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!