amazon-web-services - 我应该每次都运行 Glue 爬虫来获取最新数据吗?

标签 amazon-web-services amazon-s3 aws-glue aws-glue-data-catalog aws-glue-spark

我有一个名为 Employee 的 S3 存储桶。每三个小时我就会在存储桶中获取一个文件,上面附有时间戳。我将使用 Glue 作业通过一些转换将文件从 S3 移动到 Redshift。我在 S3 存储桶中的输入文件将具有固定结构。 My Glue Job 将使用通过爬虫在 Data Catalog 中创建的表作为输入。

第一次运行:

datasource0 = glueContext.create_dynamic_frame.from_catalog(database = "test", table_name = "employee_623215", transformation_ctx = "datasource0")

三个小时后,如果我再为员工获取一份文件,我是否应该再次抓取它?

有没有办法在 Data Catalog 中拥有单个表,如 employee 并使用最新的 S3 文件更新表,Glue Job 可以使用该文件进行处理。还是每次都运行爬虫获取最新的数据?问题是将在我的数据目录中创建更多的表。

如果可行,请告诉我。

最佳答案

如果架构发生变化,您只需再次运行 AWS Glue 爬虫。只要架构保持不变,您就可以将文件添加到 Amazon S3,而无需重新运行爬虫。

更新:@Eman 下面的评论是正确的

If you are reading from catalog this suggestion will not work. Partitions will not be updated to the catalog table if you do not recrawl. Running the crawler maps those new partitions to the table and allow you to process the next day's partitions.

关于amazon-web-services - 我应该每次都运行 Glue 爬虫来获取最新数据吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62541496/

相关文章:

amazon-web-services - 使用工具时 URL 被禁止 403 但浏览器没问题

python - 分布式处理 - AWS Sagemaker

python - 使用 Boto3 Lambda 函数进行 S3 存储桶生命周期配置并收到 MalformedXML 格式错误

dataframe - Glue PySpark - 固定宽度文件处理和验证

amazon-web-services - 更新 Glue Table Schema 时设置小数位数

amazon-web-services - S3 具有角色的跨账户访问

amazon-web-services - 502 错误 : CloudFront wasn't able to connect to the origin

ubuntu - EC2 用户数据以获取 S3 对象

parquet - 尝试运行具有大量列的极其基本的 AWS-glue 爬虫时获取 "Internal Service Exception"

amazon-web-services - SNS批量发布