# Issue querying JSON data from ECS TASK module stored in S3 with Athena

**URL:** <https://community.cloudquery.io/t/issue-querying-json-data-from-ecs-task-module-stored-in-s3-with-athena/335>\
**Category:** CloudQuery Plugins\
**Created:** [February 29, 2024, 3:57pm UTC](https://community.cloudquery.io/t/issue-querying-json-data-from-ecs-task-module-stored-in-s3-with-athena/335 "2024-02-29T15:57:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![above-sawfly](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@above-sawfly](https://community.cloudquery.io/u/above-sawfly)\
**Post date:** [February 29, 2024, 3:57pm UTC](https://community.cloudquery.io/t/issue-querying-json-data-from-ecs-task-module-stored-in-s3-with-athena/335/1 "2024-02-29T15:57:15Z")

</div>

To be more precise, the data was from the ECS TASK module. I stored it in S3 as Parquet and crawled it with Glue. However, in Athena, I got some JSON data (like container info) that I could not query.

---

<div class="post-metadata">

**Author:** ![herman](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/herman/32/27_2.png) [@herman](https://community.cloudquery.io/u/herman)\
**Post date:** [February 29, 2024, 3:59pm UTC](https://community.cloudquery.io/t/issue-querying-json-data-from-ecs-task-module-stored-in-s3-with-athena/335/2 "2024-02-29T15:59:56Z")

</div>

hi @above-sawfly 👋 What do you mean you could not query it? Is the data there but in JSON format? Did you try some of the Athena JSON extraction functions, like `json_extract`?

---

<div class="post-metadata">

**Author:** ![above-sawfly](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@above-sawfly](https://community.cloudquery.io/u/above-sawfly)\
**Post date:** [February 29, 2024, 4:01pm UTC](https://community.cloudquery.io/t/issue-querying-json-data-from-ecs-task-module-stored-in-s3-with-athena/335/3 "2024-02-29T16:01:05Z")

</div>

The data is there but in JSON format.  
I did not know about the JSON extract function… I will test it.

---

<div class="post-metadata">

**Author:** ![KernelKnight](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@KernelKnight](https://community.cloudquery.io/u/KernelKnight)\
**Post date:** [February 29, 2024, 4:01pm UTC](https://community.cloudquery.io/t/issue-querying-json-data-from-ecs-task-module-stored-in-s3-with-athena/335/4 "2024-02-29T16:01:59Z")

</div>

Additionally, v5.0.0 was released only a couple of days ago: [CloudQuery S3 Plugin Release Notes](https://hub.cloudquery.io/plugins/destination/cloudquery/s3/latest/versions)

---

<div class="post-metadata">

**Author:** ![above-sawfly](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@above-sawfly](https://community.cloudquery.io/u/above-sawfly)\
**Post date:** [February 29, 2024, 4:02pm UTC](https://community.cloudquery.io/t/issue-querying-json-data-from-ecs-task-module-stored-in-s3-with-athena/335/5 "2024-02-29T16:02:51Z")

</div>

Ok, I will retest it… in case the `athena:true` functionality has changed since last week.

---

<div class="post-metadata">

**Author:** ![above-sawfly](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@above-sawfly](https://community.cloudquery.io/u/above-sawfly)\
**Post date:** [March 1, 2024, 3:22pm UTC](https://community.cloudquery.io/t/issue-querying-json-data-from-ecs-task-module-stored-in-s3-with-athena/335/6 "2024-03-01T15:22:11Z")

</div>

Ok, tested again.  
Seems some schema for `tag` is not working properly.

```auto
HIVE_INVALID_METADATA: Glue table 'foo_aws_ecs_cluster_tasks' column 'tags' has invalid data type: struct<Application:string,Core:string,Env:string,Environment:string,Name:string,Repo:string,Stack:string,App:string,StackName:string,Version:string,aws\:ecs\:clusterName:string,aws\:ecs\:serviceName:string>

```

---

<div class="post-metadata">

**Author:** ![herman](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/herman/32/27_2.png) [@herman](https://community.cloudquery.io/u/herman)\
**Post date:** [March 1, 2024, 3:31pm UTC](https://community.cloudquery.io/t/issue-querying-json-data-from-ecs-task-module-stored-in-s3-with-athena/335/7 "2024-03-01T15:31:06Z")

</div>

Hmm, if I had to guess, it’s not happy about having a struct with keys `aws:ecs:clusterName` and `aws:ecs:serviceName`, which contain colons. I assume there are tags in your account with those keys? Athena has many limitations, and we had a similar issue with duplicate keys a while back, if you’d like to read some background there: [GitHub Issue #7639](https://github.com/cloudquery/cloudquery/issues/7639#issuecomment-1419082572).

Maybe this is something we can handle as part of the `athena: true` delivery mode. Would you mind opening an issue about it with as much detail as possible, so we can prioritize and take a look? [Open a New Issue](https://github.com/cloudquery/cloudquery/issues/new/choose).

---

<div class="post-metadata">

**Author:** ![yevgenyp](https://avatars.discourse-cdn.com/v4/letter/y/3be4f8/32.png) [@yevgenyp](https://community.cloudquery.io/u/yevgenyp)\
**Post date:** [March 4, 2024, 3:11pm UTC](https://community.cloudquery.io/t/issue-querying-json-data-from-ecs-task-module-stored-in-s3-with-athena/335/8 "2024-03-04T15:11:47Z")

</div>

@above-sawfly I also just emailed you regarding a private channel so we can support the PoC faster.
