Review panics in the sql crate - #3397
Conversation
Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
| match (n.parse::<i64>(), n.parse::<f64>()) { | ||
| (Ok(n), _) => Ok(lit(n)), | ||
| (Err(_), Ok(n)) => Ok(lit(n)), | ||
| (Err(_), Err(_)) => Err(DataFusionError::from(ParserError(format!( | ||
| "Cannot parse {} as i64 or f64", | ||
| n | ||
| )))), | ||
| } |
There was a problem hiding this comment.
It may be simpler to do this in two steps?
| match (n.parse::<i64>(), n.parse::<f64>()) { | |
| (Ok(n), _) => Ok(lit(n)), | |
| (Err(_), Ok(n)) => Ok(lit(n)), | |
| (Err(_), Err(_)) => Err(DataFusionError::from(ParserError(format!( | |
| "Cannot parse {} as i64 or f64", | |
| n | |
| )))), | |
| } | |
| match n.parse::<i64>() { | |
| Ok(n) => Ok(lit(n)), | |
| _ => match n.parse::<f64>() { | |
| Ok(n) => Ok(lit(n)), | |
| _ => Err(DataFusionError::from(ParserError(format!("Cannot parse {} as i64 or f64", n)))), | |
| } | |
| } |
There was a problem hiding this comment.
Here is an alternate proposal of (yet) another way to do it: #3432
|
Thank you @HaoYang670 |
|
Benchmark runs are scheduled for baseline = 8b59b20 and contender = e14d090. e14d090 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Signed-off-by: remzi 13716567376yh@gmail.com
Which issue does this PR close?
Closes #3315.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?