Parquet pyarrow schema 转换为 Glue schema AWS

huangapple go评论64阅读模式
英文:

Parquet pyarrow schema to Glue schema AWS

问题

我正在尝试找到一种将S3上的parquet文件的pyarrow模式转换为可用的Glue模式的方法。

为了更好地理解,我有一堆位于S3上的parquet文件,这些文件没有按照正确的结构进行组织,无法被爬虫解析,我想创建自定义的Glue表,调用Glue Catalog API并指定模式。

我考虑使用pyarrow读取parquet文件,然后使用该模式创建Glue表,但我遇到了兼容性问题。

另一个选项是使用爬虫,但不确定如何仅使用爬虫来查找位置的模式。

有什么建议吗?

谢谢。

英文:

I am trying to find a way to convert a pyarrow schema from a parquet file on s3 to a viable Glue schema.

To put it in context, I have a bunch of locations on S3 with parquet files which are not structured properly to be parsed by a crawler and I want to create custom Glue tables calling the Glue Catalog API with a specified schema.

I thought about using pyarrow to read a parquet file and then create the Glue table using that schema, but I'm having compatibility issues.

Another option would be to use a crawler, but not sure how you can use a crawler just to find out the schema from a location.

Any suggestions?

Thanks.

答案1

得分: 1

Glue Crawler支持在S3中使用parquet格式。只需将爬虫指向parquet文件的位置,它就应该能够自动推断模式。

更多信息请参阅文档

英文:

Glue Crawler support parquet in S3. Just point the crawler to the location of your parquet files, and it should be able to infer the schema automatically.

More info in the docs.

huangapple
  • 本文由 发表于 2023年6月16日 00:07:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76483548.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定