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
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "datafusion-functions-json"
version = "0.48.0"
version = "0.49.0"
edition = "2021"
description = "JSON functions for DataFusion"
readme = "README.md"
Expand All @@ -11,16 +11,16 @@ repository = "https://github.com/datafusion-contrib/datafusion-functions-json/"
rust-version = "1.85.1"

[dependencies]
datafusion = { version = "48", default-features = false }
datafusion = { version = "49", default-features = false }
jiter = "0.10"
paste = "1"
log = "0.4"
paste = "1"

[dev-dependencies]
datafusion = { version = "48", default-features = false, features = [
codspeed-criterion-compat = "2.6"
datafusion = { version = "49", default-features = false, features = [
"nested_expressions",
] }
codspeed-criterion-compat = "2.6"
tokio = { version = "1.43", features = ["full"] }

[lints.clippy]
Expand Down
7 changes: 4 additions & 3 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ impl<'s> JsonPathArgs<'s> {
.iter()
.enumerate()
.map(|(pos, arg)| match arg {
ColumnarValue::Scalar(ScalarValue::Utf8(Some(s)) | ScalarValue::LargeUtf8(Some(s))) => {
Ok(JsonPath::Key(s))
}
ColumnarValue::Scalar(
ScalarValue::Utf8(Some(s)) | ScalarValue::Utf8View(Some(s)) | ScalarValue::LargeUtf8(Some(s)),
) => Ok(JsonPath::Key(s)),
ColumnarValue::Scalar(ScalarValue::UInt64(Some(i))) => Ok((*i).into()),
ColumnarValue::Scalar(ScalarValue::Int64(Some(i))) => Ok((*i).into()),
ColumnarValue::Scalar(
ScalarValue::Null
| ScalarValue::Utf8(None)
| ScalarValue::Utf8View(None)
| ScalarValue::LargeUtf8(None)
| ScalarValue::UInt64(None)
| ScalarValue::Int64(None),
Expand Down
2 changes: 1 addition & 1 deletion src/common_union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub(crate) fn json_from_union_scalar<'a>(
if let Some((type_id, value)) = type_id_value {
// we only want to take the ScalarValue string if the type_id indicates the value represents nested JSON
if fields == &union_fields() && (*type_id == TYPE_ID_ARRAY || *type_id == TYPE_ID_OBJECT) {
if let ScalarValue::Utf8(s) = value.as_ref() {
if let ScalarValue::Utf8(s) | ScalarValue::Utf8View(s) | ScalarValue::LargeUtf8(s) = value.as_ref() {
return s.as_deref();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn optimise_json_get_cast(cast: &Cast) -> Option<Transformed<Expr>> {
crate::json_get_float::json_get_float_udf()
}
DataType::Int64 | DataType::Int32 => crate::json_get_int::json_get_int_udf(),
DataType::Utf8 => crate::json_get_str::json_get_str_udf(),
DataType::Utf8 | DataType::Utf8View | DataType::LargeUtf8 => crate::json_get_str::json_get_str_udf(),
_ => return None,
};
Some(Transformed::yes(Expr::ScalarFunction(ScalarFunction {
Expand Down