Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ballista/rust/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ datafusion = { path = "../../../datafusion/core", version = "7.0.0" }
futures = "0.3"
log = "0.4"
parking_lot = "0.12"
sqlparser = "0.16"
sqlparser = "0.17"
tempfile = "3"
tokio = "1.0"

Expand Down
2 changes: 1 addition & 1 deletion ballista/rust/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ parse_arg = "0.1.3"
prost = "0.10"
prost-types = "0.10"
serde = { version = "1", features = ["derive"] }
sqlparser = "0.16"
sqlparser = "0.17"
tokio = "1.0"
tonic = "0.7"
uuid = { version = "1.0", features = ["v4"] }
Expand Down
108 changes: 58 additions & 50 deletions datafusion-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion datafusion/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ cranelift-module = { version = "0.83.0", optional = true }
ordered-float = "3.0"
parquet = { version = "13", features = ["arrow"], optional = true }
pyo3 = { version = "0.16", optional = true }
sqlparser = "0.16"
sqlparser = "0.17"
2 changes: 1 addition & 1 deletion datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pyo3 = { version = "0.16", optional = true }
rand = "0.8"
rayon = { version = "1.5", optional = true }
smallvec = { version = "1.6", features = ["union"] }
sqlparser = "0.16"
sqlparser = "0.17"
tempfile = "3"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "fs", "parking_lot"] }
tokio-stream = "0.1"
Expand Down
7 changes: 6 additions & 1 deletion datafusion/core/src/sql/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn plan_key(key: SQLExpr) -> Result<ScalarValue> {
SQLExpr::Value(Value::SingleQuotedString(s)) => ScalarValue::Utf8(Some(s)),
_ => {
return Err(DataFusionError::SQL(ParserError(format!(
"Unsuported index key expression: {}",
"Unsuported index key expression: {:?}",
key
))))
}
Expand Down Expand Up @@ -1645,6 +1645,11 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
}
}

SQLExpr::ArrayIndex { obj, indexs } => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

❤️ for @ovr

let expr = self.sql_expr_to_logical_expr(*obj, schema, ctes)?;
plan_indexed(expr, indexs)
}

SQLExpr::CompoundIdentifier(ids) => {
let mut var_names: Vec<_> = ids.into_iter().map(|s| normalize_ident(&s)).collect();

Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/tests/sql/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ async fn query_nested_get_indexed_field_on_struct() -> Result<()> {
ctx.register_table("structs", table_a)?;

// Original column is micros, convert to millis and check timestamp
let sql = "SELECT some_struct[\"bar\"] as l0 FROM structs LIMIT 3";
let sql = "SELECT some_struct['bar'] as l0 FROM structs LIMIT 3";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #2500 (comment) for an explanation of this change

let actual = execute_to_batches(&ctx, sql).await;
let expected = vec![
"+----------------+",
Expand All @@ -666,7 +666,7 @@ async fn query_nested_get_indexed_field_on_struct() -> Result<()> {
];
assert_batches_eq!(expected, &actual);

let sql = "SELECT some_struct[\"bar\"][0] as i0 FROM structs LIMIT 3";
let sql = "SELECT some_struct['bar'][0] as i0 FROM structs LIMIT 3";
let actual = execute_to_batches(&ctx, sql).await;
#[rustfmt::skip]
let expected = vec![
Expand Down
2 changes: 1 addition & 1 deletion datafusion/expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ path = "src/lib.rs"
ahash = { version = "0.7", default-features = false }
arrow = { version = "13", features = ["prettyprint"] }
datafusion-common = { path = "../common", version = "7.0.0" }
sqlparser = "0.16"
sqlparser = "0.17"