does aws athena have the equivalent of select struct('*') in spark?

Viewed 151

related doc: https://docs.aws.amazon.com/athena/latest/ug/rows-and-structs.html

spark hast the struct('*') function that converts a row to a nested struct: for example: if t has the columns a and b

t.select(struct('*').alias('x')

will have a column x which is a struct with a and b fields

what I found in athena requires explicitly specifying all fields:

select cast(row(a,b) as row(a varchar, b varchar)) as x from t

this is fine for a small number of columns, but is hard to work with for tables with a large number of rows

is there a way to create a nested row in athena that doesn't requires explicitly specifying all fields?

0 Answers
Related