'AWS Athena - Queries of this type are not supported [basic query]
I'm running the following query and I get the 'queries of this type are not supported'.
What am I doing wrong?
select
t.pol_number,
t.pdb_id
from
static_filters T
where left(cast(t.pdb_id as string), 1) = '5'
limit 10
Both those fields are integers
Solution 1:[1]
athena knows nothing of left so use use substr
you can look here which functions are supported
select
t.pol_number,
t.pdb_id
from
static_filters t
where substr((cast(t.pdb_id as string), 1,1) = '5'
limit 10
still your query needs and ORDER BY
without it a limit makes not much sense
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | nbk |