我在亚马逊网络服务S3中有一大堆数据是以JSON格式存储的。它看起来是这样的:
s3://my-bucket/store-1/20190101/sales.json
s3://my-bucket/store-1/20190102/sales.json
s3://my-bucket/store-1/20190103/sales.json
s3://my-bucket/store-1/20190104/sales.json
...
s3://my-bucket/store-2/20190101/sales.json
s3://my-bucket/store-2/20190102/sales.json
s3://my-bucket/store-2/20190103/sales.json
s3://my-bucket/store-2/20190104/sales.json
...它们都是相同的模式。我想把所有的JSON数据放到一个数据库表中。我找不到一个好的教程来解释如何设置它。
理想情况下,我还可以在一些列上执行小的“规范化”转换。
我认为胶水是正确的选择,但我对其他选择持开放态度!
发布于 2019-03-21 19:38:21
如果您需要使用Glue处理数据,并且不需要在Glue Catalog中注册一个表,那么就不需要运行Glue Crawler。您可以设置一个作业并使用getSourceWithFormat(),同时将recurse选项设置为true,并将paths指向根文件夹(在本例中为["s3://my-bucket/"]或["s3://my-bucket/store-1", "s3://my-bucket/store-2", ...])。在作业中,您还可以应用任何所需的transformations,然后将结果写入另一个S3 bucket, relational DB or a Glue Catalog。
https://stackoverflow.com/questions/55262557
复制相似问题