Athena Dynamic Partition Projection Issue

1

I have a paritioned table in Athena that uses dynamic partition projection. I enabled this using the following 2 table properties:

  'projection.latlong.type'='injected', 
  'storage.location.template'='s3://my_bucket/prefix/latlong=${latlong}'

Running a static select query specifying the filter on latlong partition key works just fine, e.g. :

SELECT count(*) FROM dtx_injected where latlong in ('50.076678_-5.235831', '50.100533_-5.259398')

However trying to build a dynamic list results in an error, where the minimal reproducible example is as folows:

SELECT count(*) FROM dtx_injected where latlong in (select '50.076678_-5.235831' union select '50.100533_-5.259398')

The error I get is the same as not providing a filter at all when trying to query a table that is setup with a dynamic projection.

CONSTRAINT_VIOLATION: Injected projected partition column latlong must have only (and at least one) equality conditions in the WHERE clause!

Has anynone encountered this issue and know the solution to this problem? I'm using Athena engine version 3 if that helps.

質問済み 1年前1437ビュー
2回答
1

Is this issue still valid, is there any resolution or workaround on this?

Bipin
回答済み 8ヶ月前
0

This is expected behaviour and also a known issue. As mentioned in [1] “Queries with multiple values for a filter expression on an injected column succeed only if the values are disjunct”.

This sentence can be interpreted as, while using injected columns , queries work with a static array of values, however they do not work with subquery in where clause. 

————————

Reference:

[1] https://docs.aws.amazon.com/athena/latest/ug/partition-projection-supported-types.html#partition-projection-injected-type

AWS
サポートエンジニア
Arun
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ