Define a column as struct in DBT

34 Views Asked by At

I'm using dbt seed to create and populate a table on Amanzon Athena from a CSV.

I'd like to specify that one column of the seed has to be created as struct<myfield:string> but cannot find this option in the list of data types (https://docs.getdbt.com/sql-reference/data-types).

The CSV is exported as CSV from another Athena table and if I look at the file the struct is exported with this format:

"{myfield=foo.bar}"

I tried to specify the column as JSON but the import fails because that field is not in JSON format. I also tried to use string as type, in that case the upload worked fine but the data is the table is stored as string (obviosly) and not as struct.

0

There are 0 best solutions below