You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does dbtools::get_athena_query_response() allow for querying of ad hoc arrays?
eg. should "SELECT ARRAY[1, 2, 3] AS list" return anything? I'm getting Error in py_call_impl(callable, dots$args, dots$keywords) : KeyError: 'array'
☝️ My assumption is that the underlying python script is trying to take each Athena data type and converting it to our agnostic data. However, as our agnostic data doesn't (yet) support STRUCT or ARRAY you're getting that key error as there is no array key in the lookup dictionary.
Running the following
dbtools::get_athena_query_response('SELECT ARRAY[1, 2, 3] AS list', 'alpha-everyone', return_athena_types=T)
Works and therefore supports the theory above. Probably should error out for the time being but the error should be more informative.
The text was updated successfully, but these errors were encountered:
For the record - you can turn the ARRAY into a STRUCT which dbtools is happy to return, so the functionality of arrays can be used in Athena queries.
To return a table with
n
0
1
2
3
Use:
SELECT t.n
FROM (
SELECT sequence(0,3) AS n
)
CROSS JOIN UNNEST(n) AS t (n);
From AP slack:
On replication traceback is...
☝️ My assumption is that the underlying python script is trying to take each Athena data type and converting it to our agnostic data. However, as our agnostic data doesn't (yet) support
STRUCT
orARRAY
you're getting that key error as there is noarray
key in the lookup dictionary.Running the following
Works and therefore supports the theory above. Probably should error out for the time being but the error should be more informative.
The text was updated successfully, but these errors were encountered: