AWS Glue Crawler 将 json 文件分类为 UNKNOWN [英] AWS Glue Crawler Classifies json file as UNKNOWN

查看:31
本文介绍了AWS Glue Crawler 将 json 文件分类为 UNKNOWN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一项 ETL 作业,该作业会将 JSON 文件提取到 RDS 临时表中.我配置的爬虫可以对 JSON 文件进行分类,只要它们的大小小于 1MB.如果我缩小文件(而不是漂亮的打印件),如果结果小于 1MB,它将毫无问题地对文件进行分类.

I'm working on an ETL job that will ingest JSON files into a RDS staging table. The crawler I've configured classifies JSON files without issue as long as they are under 1MB in size. If I minify a file (instead of pretty print) it will classify the file without issue if the result is under 1MB.

我在想出解决方法时遇到了麻烦.我尝试将 JSON 转换为 BSON 或 GZIPing JSON 文件,但它仍然归类为 UNKNOWN.

I'm having trouble coming up with a workaround. I tried converting the JSON to BSON or GZIPing the JSON file but it is still classified as UNKNOWN.

有没有其他人遇到过这个问题?有一个更好的方法吗?

Has anyone else run into this issue? Is there a better way to do this?

推荐答案

我有两个 json 文件,分别为 42mb 和 16mb,在 S3 上作为路径分区:

I have two json files which are 42mb and 16mb, partitioned on S3 as path:

  • s3://bucket/stg/year/month/_0.json

  • s3://bucket/stg/year/month/_0.json

s3://bucket/stg/year/month/_1.json

s3://bucket/stg/year/month/_1.json

我遇到了和你一样的问题,爬虫分类为 UNKNOWN.

I had the same problem as you, crawler classification as UNKNOWN.

我能够解决它:

  • 您必须使用 jsonPath 为$[*]"创建自定义分类器,然后使用分类器创建新的爬虫.
  • 使用 S3 上的数据运行您的新爬虫,将创建正确的架构.
  • 不要使用分类器更新您当前的爬网程序,因为它不会应用更改,我不知道为什么,可能是因为他们的文档中提到了 AWS 的分类器版本控制.创建新的爬虫使它们工作

这篇关于AWS Glue Crawler 将 json 文件分类为 UNKNOWN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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