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/05/10 13:39:51 UTC

[GitHub] [arrow-datafusion] ovr commented on a diff in pull request #2500: Update to `sqlparser` `0.17.0`

ovr commented on code in PR #2500:
URL: https://github.com/apache/arrow-datafusion/pull/2500#discussion_r869250295


##########
datafusion/core/src/sql/planner.rs:
##########
@@ -97,9 +97,10 @@ fn plan_key(key: SQLExpr) -> Result<ScalarValue> {
             ScalarValue::Int64(Some(s.parse().unwrap()))
         }
         SQLExpr::Value(Value::SingleQuotedString(s)) => ScalarValue::Utf8(Some(s)),
+        SQLExpr::Identifier(Ident { value, .. }) => ScalarValue::Utf8(Some(value)),

Review Comment:
   Looks likes, there are mistakes in tests, I found that current tests are not valid:
   
   In select.rs, you need to do some changes:
   
   ```
   // " - is used for identifiers, but in this test, should be some_struct['bar'], because it's a name of the field, not an identifier.
   let sql = "SELECT some_struct[\"bar\"] as l0 FROM structs LIMIT 3";
   ```



-- 
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