I was trying to create an external table pointing to AWS detailed billing report CSV from Athena. The problem is, when I create an external table with the default ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' ESCAPED BY '\\' LOCATION 's3://mybucket/folder, I end up with values enclosed by double quotes in rows. That is a bit problematic because I won’t be able to run aggregate queries easily. When I looked up the documentation, here is what it says:
The serde_name indicates the SerDe to use, for example,
org.apache.hadoop.hive.serde2.OpenCSVSerde. The WITH SERDEPROPERTIES clause allows you to provide one or more custom properties allowed by the SerDe. For example, the CSV SerDe allows custom separators (“separatorChar” = “\t”), custom quote characters (“quoteChar” = “'”), and escape characters (“escapeChar” = “\”).
That kind of makes you believe that OpenCSVSerde is supported. But when I try that, Athena showed the following error:
‘org.apache.hadoop.hive.serde2.OpenCSVSerde’ is not supported. (Service: AmazonAthena; Status Code: 400; Error Code: InvalidRequestException; Request ID: 78ab6af6-c052-11e6-ba09-37b63c32e0fa)
I think the documentation is misleading and needs to be corrected. Also, anyone know how can I get rid of double quotes enclosing rows while I create external table? I didn’t find that option on org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe which seems to be the supported Serde
Related discussions:
- how does AWS Glue make the tables? (based on what)
- Hidden cost for AWS Athena?
- RDS vs s3+Athena
- Maybe I’m late to this, but I finally spent time comparing CUR and FOCUS (CUR 2.0 exposes ~115-131 fields, while FOCUS exposes ~60 … but theres more)
- Analyzing AWS VPC Flow Logs using Apache Parquet Files and Amazon Athena