Skip to content
Advertisement

Tag: amazon-athena

sql; concatenate MIN(price) and MAX(price) into column?

I am working on an aws athena query like so: Which will give results like so: Right now I have maxprice and minprice as two separate columns, but I want to combine them into one column “price range” which will have minprice and maxprice separated by a ” – ” string, so it would look something like this: I tried

Athena UNION – do I need to define struct columns?

I have a bunch of tables in Athena that contain structs with different nested columns. I’d like to query from all of those tables as a single table (ie, a union view) and I’d like to be able to return the nested column from the struct only if it exists, otherwise return a null. Example: I’d like to be able

Athena nested Struct Querying – how to query Value_counts in SQL

I have a big nested struct in AWS Athena. Here’s one column named “petowners” in the table: I’m looking for: The equivalent of the python function value_counts in the column. Meaning I’m looking for the SQL Athena command that will output for this row: [mammals:1, birds:2, UnknownField:4] A way to query aggregation – to create a histogram of total number

Advertisement