Skip to content

Conversation

@HaoYang670
Copy link
Contributor

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?

Signed-off-by: remzi <13716567376yh@gmail.com>
@github-actions github-actions bot added the sql SQL Planner label Sep 8, 2022
Signed-off-by: remzi <13716567376yh@gmail.com>
Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @HaoYang670

Comment on lines +2686 to 2693
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
)))),
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be simpler to do this in two steps?

Suggested change
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)))),
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an alternate proposal of (yet) another way to do it: #3432

@alamb
Copy link
Contributor

alamb commented Sep 10, 2022

Thank you @HaoYang670

@alamb alamb merged commit e14d090 into apache:master Sep 10, 2022
@ursabot
Copy link

ursabot commented Sep 10, 2022

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.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review use of panic in datafusion-sql crate

4 participants