Closed wrb2 closed 1 year ago
I tried "hey let's look if timestamps are broken as well" and it turns out I'm either blind or this feature of automated data type inference in seeds is not actually documented anywhere in dbt.
trino> insert into memory.default.orders (orderkey, orderdate) values (99999, '2021-01-01');
Query 20210916_143132_00002_bz9pd failed: Insert query has mismatched column types: Table: [bigint, date], Query: [integer, varchar(10)]
trino> insert into memory.default.orders (orderkey, orderdate) values (99999, date '2021-01-01');
INSERT: 1 row
Query 20210916_143203_00003_bz9pd, FINISHED, 1 node
Splits: 35 total, 35 done (100.00%)
0.23 [0 rows, 0B] [0 rows/s, 0B/s]
I think that seeding dates on presto / trino will not work because the parsing of the dates needs to be made explicitly in presto/trino.
See :
Closing this sinde dbt-presto is abandonware.
Seed files with date values don't work in dbt-presto.
I created following CSV seed file:
when I run
dbt seed
I get following error:Pointing dbt to postgres instead of presto works and correctly creates the table:
As a workaround, also setting the column to string in
project.yml
works, but if you want that to be date, you have to cast it when using the seed file. Seed files with just strings and number work corrently.