You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2023/01/22 16:32:53 UTC

[arrow-datafusion] branch master updated: Check placeholder __timeTo and return Datafusion::Plan error (#5017)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 407caad40 Check placeholder  __timeTo and return Datafusion::Plan error (#5017)
407caad40 is described below

commit 407caad40ec7f8f40372275c1978d3414c6bb82d
Author: Matthias Q <35...@users.noreply.github.com>
AuthorDate: Sun Jan 22 17:32:47 2023 +0100

    Check placeholder  __timeTo and return Datafusion::Plan error (#5017)
    
    * check placeholder for __timeTo param
    
    * Plan error instead of Internal error for unsupported query params
    
    * add original comment
---
 datafusion/sql/src/expr/value.rs         | 2 +-
 datafusion/sql/tests/integration_test.rs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/datafusion/sql/src/expr/value.rs b/datafusion/sql/src/expr/value.rs
index 07d7c9b6c..f28fb50b4 100644
--- a/datafusion/sql/src/expr/value.rs
+++ b/datafusion/sql/src/expr/value.rs
@@ -100,7 +100,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
         let idx = match index {
             Ok(index) => index - 1,
             Err(_) => {
-                return Err(DataFusionError::Internal(format!(
+                return Err(DataFusionError::Plan(format!(
                     "Invalid placeholder, not a number: {param}"
                 )));
             }
diff --git a/datafusion/sql/tests/integration_test.rs b/datafusion/sql/tests/integration_test.rs
index 8cc0f7615..e93ec8712 100644
--- a/datafusion/sql/tests/integration_test.rs
+++ b/datafusion/sql/tests/integration_test.rs
@@ -3104,7 +3104,7 @@ fn test_ambiguous_column_references_with_in_using_join() {
 }
 
 #[test]
-#[should_panic(expected = "value: Internal(\"Invalid placeholder, not a number: $foo\"")]
+#[should_panic(expected = "value: Plan(\"Invalid placeholder, not a number: $foo\"")]
 fn test_prepare_statement_to_plan_panic_param_format() {
     // param is not number following the $ sign
     // panic due to error returned from the parser