You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/02 00:52:30 UTC
[GitHub] [arrow-datafusion] andygrove commented on issue #4072: Floating value literals without postfix should be parsed as decimal
andygrove commented on issue #4072:
URL: https://github.com/apache/arrow-datafusion/issues/4072#issuecomment-1299405633
Thanks @viirya I had forgotten about this ... this is the relevant code in sql/planner.rs, for reference
```rust
// Parse number in sql string, convert to Expr::Literal
fn parse_sql_number(n: &str) -> Result<Expr> {
// parse first as i64
n.parse::<i64>()
.map(lit)
// if parsing as i64 fails try f64
.or_else(|_| n.parse::<f64>().map(lit))
.map_err(|_| {
DataFusionError::from(ParserError(format!(
"Cannot parse {} as i64 or f64",
n
)))
})
}
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org