Aws Athena - 创建外部表跳过第一行 [英] Aws Athena - Create external table skipping first row

查看:37
本文介绍了Aws Athena - 创建外部表跳过第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Aws Athena 在 csv 文件上创建一个外部表,代码如下,但行 TBLPROPERTIES ("skip.header.line.count"="1") 没有'有效:它不会跳过 csv 文件的第一行(标题).

创建外部表 mytable(colA 字符串,字符串)行格式 SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'具有 SERDE 属性 ('separatorChar' = ',','quoteChar' = '"','escapeChar' = '\')存储为文本文件LOCATION 's3://mybucket/mylocation/'TBL 属性 ("skip.header.line.count"="1")

有什么建议吗?

解决方案

刚刚尝试了 "skip.header.line.count"="1" 并且现在似乎工作正常.

I'm trying to create an external table on csv files with Aws Athena with the code below but the line TBLPROPERTIES ("skip.header.line.count"="1") doesn't work: it doesn't skip the first line (header) of the csv file.

CREATE EXTERNAL TABLE mytable
(
  colA string,
  colB int
  )

 ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
 WITH SERDEPROPERTIES (
   'separatorChar' = ',',
   'quoteChar' = '"',
   'escapeChar' = '\'
   )
STORED AS TEXTFILE
LOCATION 's3://mybucket/mylocation/'
TBLPROPERTIES (
  "skip.header.line.count"="1")

Any advise?

解决方案

Just tried the "skip.header.line.count"="1" and seems to be working fine now.

这篇关于Aws Athena - 创建外部表跳过第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆