Skip to content

Wrong datatype after reading FROM CSV  #1181

@casavipiestrick

Description

@casavipiestrick

I am very enthusiastic about alasql and it was already a great help to me. Thanks a lot for the great work.
But...

Datatype switches from string to number after FROM CSV import.

CSV sample:
"117.20";"some name"
"88.33";"other name"

SQL:
CREATE TABLE test (id string,name string);
SELECT * INTO test FROM CSV('some csv file');
SELECT * FROM test;

results in:

id name
117.2 some name
88.33 other name

The column 'ID' datatype changed to number and the value is handled as float and trailing Null is cut off.
Bad if this is an identifier.

PS: it seems to work with FROM XLSX, when column is formated as TEXT in Excel

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions