简体   繁体   中英

AWS Athena Return Zero Records from Tables Created by GLUE Crawler input csv from S3

I have already read the answers under the question AWS Athena Returning Zero Records from Tables Created from GLUE Crawler input csv from S3

and the question https://aws.amazon.com/de/premiumsupport/knowledge-center/athena-empty-results/

As advised

  1. I have given the folder path in S3 instead of the file name to the Glue crawler.
  2. I have deleted and recreated the crawler

But it didn´t help

my case:

sample data from csv in s3 storage: 在此处输入图像描述

Cloud Watch Log show the glue table is successfully created: 在此处输入图像描述

the schema structure looks like: 在此处输入图像描述

Sizekey 333 matched the csv data size: 数据大小:333 字节

But when I run the Athena query, I got the result: 扫描数据 0 KB

Only the columns are returned, no records returned. Data scanned: 0 KB

Anyone has an idea why the glue crawler can not transform the data?

Thanks!

After looking at the table names generated it looks like you have multiple files with different schemas in the folder path that you have passed to Glue crawler. If you want these tables to be queried in Athena then you have to place these CSV files with different schema in different folders.

Although you passed folder path to Glue crawler it creates tables with full file path for Athena tables.You can verify the same by running show create table <table-name> .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM