问题
when creating Hive table against csv saved in S3, do I absolutely have to order fields in the order of comma separated values for rows in csv? the csv has the first row as header. I understand that csv is row based not columnar, but was wondering if there is a way to match the value of the header with the field name of the hive table and order columns differently.
回答1:
Yes, columns in the table definition (DDL) should be in the same order as in the underlying csv files. You can skip header from being selected using tblproperties("skip.header.line.count"="1")
.
See also Create Table manual.
来源:https://stackoverflow.com/questions/51959180/when-creating-hive-table-against-csv-saved-in-s3-do-i-absolutely-have-to-order