alamb commented on issue #9538: URL: https://github.com/apache/arrow-rs/issues/9538#issuecomment-4090322177
Copying some comments from https://github.com/apache/arrow-rs/pull/9537 I guess question comes down to "Numeric parsers should ignore leading and trailing whitespace before parsing. For example, " 42 " should parse successfully to Some(42) rather than returning None. This behavior is consistent with how most data ingestion systems handle text-to-number conversion. " I did some brief checking of postgres and duckdb and they indeed do trim spaces Interestingly DuckDB does automatically trim ```sql andrewlamb@Andrews-MacBook-Pro-3:~/Software/influxdb_pro/ent$ duckdb DuckDB v1.5.0 (Variegata) Enter ".help" for usage hints. memory D select ' 4.5'::float; ┌────────────────────────┐ │ CAST(' 4.5' AS FLOAT) │ │ float │ ├────────────────────────┤ │ 4.5 │ └────────────────────────┘ ``` As does postgres 🤔 ```sql andrewlamb@Andrews-MacBook-Pro-3:~/Software/influxdb_pro/ent$ psql -h localhost -U postgres psql (14.22 (Homebrew), server 11.16 (Debian 11.16-1.pgdg90+1)) Type "help" for help. postgres=# select ' 4.5'::float; float8 -------- 4.5 (1 row) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
