You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "matthias-Q (via GitHub)" <gi...@apache.org> on 2023/01/21 19:58:46 UTC
[GitHub] [arrow-datafusion] matthias-Q opened a new pull request, #5017: Check placeholder __timeTo and return Datafusion::Plan error
matthias-Q opened a new pull request, #5017:
URL: https://github.com/apache/arrow-datafusion/pull/5017
# Which issue does this PR close?
Closes #5005 .
# Rationale for this change
As suggested by @alamb in #5005, we are catching the parameter `$__timeTo` and returning `DatafusionError::Plan` error
# What changes are included in this PR?
* check the param to match `__timeTo`
* created a test in
# Are these changes tested?
yes
# Are there any user-facing changes?
Specific error message when this parameter is used.
P.S.: This is my first commit to Datafusion. I hope this is ok. Tell me, if I misunderstood the issue. Thanks for the great project!
--
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
[GitHub] [arrow-datafusion] alamb commented on pull request #5017: Check placeholder __timeTo and return Datafusion::Plan error
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #5017:
URL: https://github.com/apache/arrow-datafusion/pull/5017#issuecomment-1399537365
Thanks again @matthias-Q
--
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
[GitHub] [arrow-datafusion] alamb merged pull request #5017: Check placeholder __timeTo and return Datafusion::Plan error
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #5017:
URL: https://github.com/apache/arrow-datafusion/pull/5017
--
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
[GitHub] [arrow-datafusion] matthias-Q commented on a diff in pull request #5017: Check placeholder __timeTo and return Datafusion::Plan error
Posted by "matthias-Q (via GitHub)" <gi...@apache.org>.
matthias-Q commented on code in PR #5017:
URL: https://github.com/apache/arrow-datafusion/pull/5017#discussion_r1083446840
##########
datafusion/sql/tests/integration_test.rs:
##########
@@ -3112,6 +3112,15 @@ fn test_prepare_statement_to_plan_panic_param_format() {
logical_plan(sql).unwrap();
Review Comment:
Sure, no problem. This test is not needed then.
--
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
[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #5017: Check placeholder __timeTo and return Datafusion::Plan error
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #5017:
URL: https://github.com/apache/arrow-datafusion/pull/5017#discussion_r1083438508
##########
datafusion/sql/src/expr/value.rs:
##########
@@ -96,13 +96,20 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
param_data_types: &[DataType],
) -> Result<Expr> {
// Parse the placeholder as a number because it is the only support from sqlparser and postgres
+ // __timeTo is not supported and should return a Plan Error #5005
let index = param[1..].parse::<usize>();
let idx = match index {
Ok(index) => index - 1,
Err(_) => {
- return Err(DataFusionError::Internal(format!(
- "Invalid placeholder, not a number: {param}"
- )));
+ if ¶m[1..] == "__timeTo" {
+ return Err(DataFusionError::Plan(format!(
+ "Placeholder not supported: {param}"
+ )));
+ } else {
+ return Err(DataFusionError::Internal(format!(
+ "Invalid placeholder, not a number: {param}"
+ )));
+ }
Review Comment:
I think in general, parameters like `$__foo` are not valid and should cause an error. I don't think there is anything special about `$__timeTo` other than it happened to be the example I had.
What would you think about
```suggestion
return Err(DataFusionError::Plan(format!(
"Invalid placeholder, not a number: {param}"
)));
```
##########
datafusion/sql/tests/integration_test.rs:
##########
@@ -3112,6 +3112,15 @@ fn test_prepare_statement_to_plan_panic_param_format() {
logical_plan(sql).unwrap();
Review Comment:
We could probably update this previous test to change Internal / Plan rather than adding a new test
--
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
[GitHub] [arrow-datafusion] matthias-Q commented on a diff in pull request #5017: Check placeholder __timeTo and return Datafusion::Plan error
Posted by "matthias-Q (via GitHub)" <gi...@apache.org>.
matthias-Q commented on code in PR #5017:
URL: https://github.com/apache/arrow-datafusion/pull/5017#discussion_r1083445890
##########
datafusion/sql/src/expr/value.rs:
##########
@@ -96,13 +96,20 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
param_data_types: &[DataType],
) -> Result<Expr> {
// Parse the placeholder as a number because it is the only support from sqlparser and postgres
+ // __timeTo is not supported and should return a Plan Error #5005
let index = param[1..].parse::<usize>();
let idx = match index {
Ok(index) => index - 1,
Err(_) => {
- return Err(DataFusionError::Internal(format!(
- "Invalid placeholder, not a number: {param}"
- )));
+ if ¶m[1..] == "__timeTo" {
+ return Err(DataFusionError::Plan(format!(
+ "Placeholder not supported: {param}"
+ )));
+ } else {
+ return Err(DataFusionError::Internal(format!(
+ "Invalid placeholder, not a number: {param}"
+ )));
+ }
Review Comment:
Ah, this was actually my first attempt, but it sounded too easy.
I will implement it this way. Thanks for clarification
--
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
[GitHub] [arrow-datafusion] ursabot commented on pull request #5017: Check placeholder __timeTo and return Datafusion::Plan error
Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #5017:
URL: https://github.com/apache/arrow-datafusion/pull/5017#issuecomment-1399539241
Benchmark runs are scheduled for baseline = e713547fb346e38738ae354a263e801d7be848c1 and contender = 407caad40ec7f8f40372275c1978d3414c6bb82d. 407caad40ec7f8f40372275c1978d3414c6bb82d is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/16665763378a4c4086851a708bce6c48...a164b994b79c4c5eb13aad45074cfaf1/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/0778c83572be4401ab65ea7c1eeb3f8d...1b24daad01b34af39a32622e9aa08275/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/5c3f26f9fbc24bf6983b0c3056d5d889...4b7312fff7234c888ca6a66648ff00b6/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/3ca94893214e4ef5a7f36f9bd75e31cb...5b26040ef54c438cac01c5b0b1454337/)
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
--
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