nuno-faria commented on PR #24046:
URL: https://github.com/apache/datafusion/pull/24046#issuecomment-5157376207
> i think we need to account for edge cases like multiple underscores in a
row, and trailing underscores
>
> ```sql
> postgres=# select 12__10;
> ERROR: trailing junk after numeric literal at or near "12__10"
> LINE 1: select 12__10;
> postgres=# select 12_10_;
> ERROR: trailing junk after numeric literal at or near "12_10_"
> LINE 1: select 12_10_;
> ```
>
> i think this code allows that whilst postgres forbids it
Thanks @Jefffrey. I think that would need to be done directly in the
`sqlparser` crate. As far as I'm aware, the numbers that reach the
`parse_sql_number` are always valid. For example, with `10__00`, the number
that reaches is `10`, while `__10` is treated as the alias (like DuckDB does):
```sql
> select 10__00;
+------+
| __00 |
+------+
| 10 |
+------+
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]