Skip to content

Commit e6fb734

Browse files
authored
update to datafusion 49 (#91)
1 parent 1e9358d commit e6fb734

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "datafusion-functions-json"
3-
version = "0.48.0"
3+
version = "0.49.0"
44
edition = "2021"
55
description = "JSON functions for DataFusion"
66
readme = "README.md"
@@ -11,16 +11,16 @@ repository = "https://github.com/datafusion-contrib/datafusion-functions-json/"
1111
rust-version = "1.85.1"
1212

1313
[dependencies]
14-
datafusion = { version = "48", default-features = false }
14+
datafusion = { version = "49", default-features = false }
1515
jiter = "0.10"
16-
paste = "1"
1716
log = "0.4"
17+
paste = "1"
1818

1919
[dev-dependencies]
20-
datafusion = { version = "48", default-features = false, features = [
20+
codspeed-criterion-compat = "2.6"
21+
datafusion = { version = "49", default-features = false, features = [
2122
"nested_expressions",
2223
] }
23-
codspeed-criterion-compat = "2.6"
2424
tokio = { version = "1.43", features = ["full"] }
2525

2626
[lints.clippy]

src/common.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,15 @@ impl<'s> JsonPathArgs<'s> {
113113
.iter()
114114
.enumerate()
115115
.map(|(pos, arg)| match arg {
116-
ColumnarValue::Scalar(ScalarValue::Utf8(Some(s)) | ScalarValue::LargeUtf8(Some(s))) => {
117-
Ok(JsonPath::Key(s))
118-
}
116+
ColumnarValue::Scalar(
117+
ScalarValue::Utf8(Some(s)) | ScalarValue::Utf8View(Some(s)) | ScalarValue::LargeUtf8(Some(s)),
118+
) => Ok(JsonPath::Key(s)),
119119
ColumnarValue::Scalar(ScalarValue::UInt64(Some(i))) => Ok((*i).into()),
120120
ColumnarValue::Scalar(ScalarValue::Int64(Some(i))) => Ok((*i).into()),
121121
ColumnarValue::Scalar(
122122
ScalarValue::Null
123123
| ScalarValue::Utf8(None)
124+
| ScalarValue::Utf8View(None)
124125
| ScalarValue::LargeUtf8(None)
125126
| ScalarValue::UInt64(None)
126127
| ScalarValue::Int64(None),

src/common_union.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub(crate) fn json_from_union_scalar<'a>(
4040
if let Some((type_id, value)) = type_id_value {
4141
// we only want to take the ScalarValue string if the type_id indicates the value represents nested JSON
4242
if fields == &union_fields() && (*type_id == TYPE_ID_ARRAY || *type_id == TYPE_ID_OBJECT) {
43-
if let ScalarValue::Utf8(s) = value.as_ref() {
43+
if let ScalarValue::Utf8(s) | ScalarValue::Utf8View(s) | ScalarValue::LargeUtf8(s) = value.as_ref() {
4444
return s.as_deref();
4545
}
4646
}

src/rewrite.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn optimise_json_get_cast(cast: &Cast) -> Option<Transformed<Expr>> {
4444
crate::json_get_float::json_get_float_udf()
4545
}
4646
DataType::Int64 | DataType::Int32 => crate::json_get_int::json_get_int_udf(),
47-
DataType::Utf8 => crate::json_get_str::json_get_str_udf(),
47+
DataType::Utf8 | DataType::Utf8View | DataType::LargeUtf8 => crate::json_get_str::json_get_str_udf(),
4848
_ => return None,
4949
};
5050
Some(Transformed::yes(Expr::ScalarFunction(ScalarFunction {

0 commit comments

Comments
 (0)