2 réponses
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
For partition pruning to work, you would have to use a where like: WHERE year='2024' and month='02' and day='25'
répondu il y a un mois
0
Adding to the above answer, you can consider enabling partition projection and use date format for year, month and day partitions. https://docs.aws.amazon.com/athena/latest/ug/partition-projection-supported-types.html
To enable partition projection, you can define the partitioning column and table properties as shown below -
CREATE EXTERNAL TABLE tableName(
col1 string,
col2 int,
.....)
PARTITIONED BY (
`timestamp` string)
LOCATION
's3://bucket/prefix/'
TBLPROPERTIES (
'projection.enabled'='true',
'projection.timestamp.format'='yyyy-MM-dd',
'projection.timestamp.interval'='1',
'projection.timestamp.interval.unit'='DAYS',
'projection.timestamp.range'='2023-01-01,NOW',
'projection.timestamp.type'='date',
'storage.location.template'='s3://bucket/prefix/${timestamp}')
With this you can use following in where clause timestamp >= '2024-03-18'. In this case you can pass date as string and need not use 'from_iso8601_timestamp' function.
répondu il y a un mois
Contenus pertinents
- demandé il y a un an
- demandé il y a un an
- demandé il y a 7 mois
- AWS OFFICIELA mis à jour il y a 6 mois
- AWS OFFICIELA mis à jour il y a 3 ans
- AWS OFFICIELA mis à jour il y a 2 ans