I have a csv file with a year column. By default DuckDBClient recognizes it with a number type.
But i’d like to cast it to a varchar type.
According to the DuckDB doc, i can override the types of specific columns with a types option :
SELECT * FROM read_csv_auto('world_data.csv', types={'year': 'VARCHAR'});
So i am trying:
db = DuckDBClient.of({
world_data: {
file: FileAttachment("world_data.csv"),
types: {year: 'VARCHAR'}
}
})
and:
db = DuckDBClient.of({
world_data: {
file: FileAttachment("world_data.csv"),
types: {year: new Arrow.Utf8()}
}
})
but still get a number column for year.
Is there a proper way to write that “types” option, or isn’t she implemented in DuckDBClient yet?