AWS Glue+Athena 跳过标题行

2 aws-cloudformation amazon-athena aws-glue

截至2018年1月19日更新,Athena可以跳过文件的标题行,

支持忽略标头。您可以skip.header.line.count在定义表时使用该属性,以允许 Athena 忽略标头。

在 Cloudformation 中使用 AWS Glue来管理我的 Athena 表。使用Glue Table 输入,如何告诉 Athena 跳过标题行?

小智 9

基于AWS::Glue::Table 此处的完整模板,进行更改,

Resources:
  ...
  MyGlueTable:
    ...
    Properties:
      ...
      TableInput:
        ...
        StorageDescriptor:
          ...
          SerdeInfo:
            Parameters: { "separatorChar" : "," }
Run Code Online (Sandbox Code Playgroud)

到,

            Parameters:
              separatorChar : ","
              "skip.header.line.count" : 1
Run Code Online (Sandbox Code Playgroud)

确实有窍门。

  • 需要给skip.header.line.count一个字符串值。供参考 (3认同)