Skip to content

Commit 80ffb7b

Browse files
committed
ci: Utf8view cast issue
1 parent d756a0b commit 80ffb7b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "Apache-2.0"
88
keywords = ["datafusion", "JSON", "SQL"]
99
categories = ["database-implementations", "parsing"]
1010
repository = "https://github.com/datafusion-contrib/datafusion-functions-json/"
11-
rust-version = "1.82.0"
11+
rust-version = "1.85.1"
1212

1313
[dependencies]
1414
datafusion = { version = "49", default-features = false }

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)