Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: force casting when necessary #247

Closed
aborruso opened this issue Feb 4, 2024 · 1 comment · Fixed by #249
Closed

feature request: force casting when necessary #247

aborruso opened this issue Feb 4, 2024 · 1 comment · Fixed by #249
Labels
enhancement New feature or request GDAL

Comments

@aborruso
Copy link
Contributor

aborruso commented Feb 4, 2024

Hi,
I have these two files:

If I do a JOIN

COPY (
    SELECT w.*, n.*
    FROM st_read('layer.geojson') w
    LEFT JOIN read_csv_auto('table.csv') n ON w.POSTAL = n."ISO_3166-1"
    ORDER BY POSTAL
) TO 'test_1.geojson' WITH (FORMAT 'GDAL', DRIVER 'GeoJSON')

I have this error

Error: near line 1: Not implemented Error: Unsupported field type

And I have it, because I have a date field in the CSV.
If I remove the field Data_Report, I have no error.

I had to do some testing to figure out what the problem was, and this is an example with a few fields.
It would be optimal to have casting forcing for those fields not compatible with the output. An option that forces the field type to text, for non-compatible fields, without having to list them in hard coding.

I am not able to help with code writing, sorry. I report here simply my user experience.

Thank you

@Maxxen
Copy link
Member

Maxxen commented Feb 4, 2024

Hi! Thanks for reporting this issue.
This is a known problem, not all data types are supported when reading from GDAL yet, most notably dates and timestamps. I will look into fixing it properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request GDAL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants