Skip to content

Commit 51d49e4

Browse files
committed
fix: Update parser for indexed field
1 parent a7c3b08 commit 51d49e4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

datafusion/core/src/sql/planner.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ fn plan_key(key: SQLExpr) -> Result<ScalarValue> {
9797
ScalarValue::Int64(Some(s.parse().unwrap()))
9898
}
9999
SQLExpr::Value(Value::SingleQuotedString(s)) => ScalarValue::Utf8(Some(s)),
100+
SQLExpr::Identifier(Ident { value, .. }) => ScalarValue::Utf8(Some(value)),
100101
_ => {
101102
return Err(DataFusionError::SQL(ParserError(format!(
102-
"Unsuported index key expression: {}",
103+
"Unsuported index key expression: {:?}",
103104
key
104105
))))
105106
}
@@ -1645,6 +1646,11 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
16451646
}
16461647
}
16471648

1649+
SQLExpr::ArrayIndex { obj, indexs } => {
1650+
let expr = self.sql_expr_to_logical_expr(*obj, schema, ctes)?;
1651+
plan_indexed(expr, indexs)
1652+
}
1653+
16481654
SQLExpr::CompoundIdentifier(ids) => {
16491655
let mut var_names: Vec<_> = ids.into_iter().map(|s| normalize_ident(&s)).collect();
16501656

0 commit comments

Comments
 (0)