AWS Glue+Athena skip header row

怎甘沉沦 提交于 2020-01-15 10:32:36

问题


As of January 19, 2018 updates, Athena can skip the header row of files,

Support for ignoring headers. You can use the skip.header.line.count property when defining tables, to allow Athena to ignore headers.

I use AWS Glue in Cloudformation to manage my Athena tables. Using the Glue Table Input, how can I tell Athena to skip the header row?


回答1:


Basing off the full template for AWS::Glue::Table here, making the change from,

Resources:
  ...
  MyGlueTable:
    ...
    Properties:
      ...
      TableInput:
        ...
        StorageDescriptor:
          ...
          SerdeInfo:
            Parameters: { "separatorChar" : "," }

To,

            Parameters:
              separatorChar : ","
              "skip.header.line.count" : 1

Does the trick.



来源:https://stackoverflow.com/questions/49866197/aws-glueathena-skip-header-row

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