Skip to content

Commit c74be46

Browse files
Bump datafusion to v41 (#34)
Co-authored-by: David Hewitt <[email protected]>
1 parent 4ad1e9b commit c74be46

File tree

2 files changed

+108
-108
lines changed

2 files changed

+108
-108
lines changed

Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "datafusion-functions-json"
3-
version = "0.40.0"
3+
version = "0.41.0"
44
edition = "2021"
55
description = "JSON functions for DataFusion"
66
readme = "README.md"
@@ -11,19 +11,19 @@ repository = "https://github.com/datafusion-contrib/datafusion-functions-json/"
1111
rust-version = "1.76.0"
1212

1313
[dependencies]
14-
arrow = "52.1.0"
15-
arrow-schema = "52.1.0"
16-
datafusion-common = "40"
17-
datafusion-expr = "40"
18-
datafusion-execution = "40"
14+
arrow = "52.2"
15+
arrow-schema = "52.2"
16+
datafusion-common = "41"
17+
datafusion-expr = "41"
18+
datafusion-execution = "41"
1919
jiter = "0.5"
2020
paste = "1"
2121
log = "0.4"
2222

2323
[dev-dependencies]
2424
codspeed-criterion-compat = "2.3"
2525
criterion = "0.5.1"
26-
datafusion = "40"
26+
datafusion = "41"
2727
clap = "4"
2828
tokio = { version = "1.37", features = ["full"] }
2929

tests/main.rs

+101-101
Original file line numberDiff line numberDiff line change
@@ -733,17 +733,17 @@ async fn test_arrow() {
733733
let batches = run_query("select name, json_data->'foo' from test").await.unwrap();
734734

735735
let expected = [
736-
"+------------------+--------------------------+",
737-
"| name | json_data -> Utf8(\"foo\") |",
738-
"+------------------+--------------------------+",
739-
"| object_foo | {str=abc} |",
740-
"| object_foo_array | {array=[1]} |",
741-
"| object_foo_obj | {object={}} |",
742-
"| object_foo_null | {null=} |",
743-
"| object_bar | {null=} |",
744-
"| list_foo | {null=} |",
745-
"| invalid_json | {null=} |",
746-
"+------------------+--------------------------+",
736+
"+------------------+-------------------------------+",
737+
"| name | test.json_data -> Utf8(\"foo\") |",
738+
"+------------------+-------------------------------+",
739+
"| object_foo | {str=abc} |",
740+
"| object_foo_array | {array=[1]} |",
741+
"| object_foo_obj | {object={}} |",
742+
"| object_foo_null | {null=} |",
743+
"| object_bar | {null=} |",
744+
"| list_foo | {null=} |",
745+
"| invalid_json | {null=} |",
746+
"+------------------+-------------------------------+",
747747
];
748748
assert_batches_eq!(expected, &batches);
749749
}
@@ -753,7 +753,7 @@ async fn test_plan_arrow() {
753753
let lines = logical_plan(r#"explain select json_data->'foo' from test"#).await;
754754

755755
let expected = [
756-
"Projection: json_get(test.json_data, Utf8(\"foo\")) AS json_data -> Utf8(\"foo\")",
756+
"Projection: json_get(test.json_data, Utf8(\"foo\")) AS test.json_data -> Utf8(\"foo\")",
757757
" TableScan: test projection=[json_data]",
758758
];
759759

@@ -765,17 +765,17 @@ async fn test_long_arrow() {
765765
let batches = run_query("select name, json_data->>'foo' from test").await.unwrap();
766766

767767
let expected = [
768-
"+------------------+---------------------------+",
769-
"| name | json_data ->> Utf8(\"foo\") |",
770-
"+------------------+---------------------------+",
771-
"| object_foo | abc |",
772-
"| object_foo_array | [1] |",
773-
"| object_foo_obj | {} |",
774-
"| object_foo_null | |",
775-
"| object_bar | |",
776-
"| list_foo | |",
777-
"| invalid_json | |",
778-
"+------------------+---------------------------+",
768+
"+------------------+--------------------------------+",
769+
"| name | test.json_data ->> Utf8(\"foo\") |",
770+
"+------------------+--------------------------------+",
771+
"| object_foo | abc |",
772+
"| object_foo_array | [1] |",
773+
"| object_foo_obj | {} |",
774+
"| object_foo_null | |",
775+
"| object_bar | |",
776+
"| list_foo | |",
777+
"| invalid_json | |",
778+
"+------------------+--------------------------------+",
779779
];
780780
assert_batches_eq!(expected, &batches);
781781
}
@@ -785,7 +785,7 @@ async fn test_plan_long_arrow() {
785785
let lines = logical_plan(r#"explain select json_data->>'foo' from test"#).await;
786786

787787
let expected = [
788-
"Projection: json_as_text(test.json_data, Utf8(\"foo\")) AS json_data ->> Utf8(\"foo\")",
788+
"Projection: json_as_text(test.json_data, Utf8(\"foo\")) AS test.json_data ->> Utf8(\"foo\")",
789789
" TableScan: test projection=[json_data]",
790790
];
791791

@@ -799,17 +799,17 @@ async fn test_long_arrow_eq_str() {
799799
.unwrap();
800800

801801
let expected = [
802-
"+------------------+-----------------------------------------+",
803-
"| name | json_data ->> Utf8(\"foo\") = Utf8(\"abc\") |",
804-
"+------------------+-----------------------------------------+",
805-
"| object_foo | true |",
806-
"| object_foo_array | false |",
807-
"| object_foo_obj | false |",
808-
"| object_foo_null | |",
809-
"| object_bar | |",
810-
"| list_foo | |",
811-
"| invalid_json | |",
812-
"+------------------+-----------------------------------------+",
802+
"+------------------+----------------------------------------------+",
803+
"| name | test.json_data ->> Utf8(\"foo\") = Utf8(\"abc\") |",
804+
"+------------------+----------------------------------------------+",
805+
"| object_foo | true |",
806+
"| object_foo_array | false |",
807+
"| object_foo_obj | false |",
808+
"| object_foo_null | |",
809+
"| object_bar | |",
810+
"| list_foo | |",
811+
"| invalid_json | |",
812+
"+------------------+----------------------------------------------+",
813813
];
814814
assert_batches_eq!(expected, &batches);
815815
}
@@ -836,7 +836,7 @@ async fn test_plan_arrow_cast_int() {
836836
let lines = logical_plan(r#"explain select (json_data->'foo')::int from test"#).await;
837837

838838
let expected = [
839-
"Projection: json_get_int(test.json_data, Utf8(\"foo\")) AS json_data -> Utf8(\"foo\")",
839+
"Projection: json_get_int(test.json_data, Utf8(\"foo\")) AS test.json_data -> Utf8(\"foo\")",
840840
" TableScan: test projection=[json_data]",
841841
];
842842

@@ -848,17 +848,17 @@ async fn test_arrow_double_nested() {
848848
let batches = run_query("select name, json_data->'foo'->0 from test").await.unwrap();
849849

850850
let expected = [
851-
"+------------------+--------------------------------------+",
852-
"| name | json_data -> Utf8(\"foo\") -> Int64(0) |",
853-
"+------------------+--------------------------------------+",
854-
"| object_foo | {null=} |",
855-
"| object_foo_array | {int=1} |",
856-
"| object_foo_obj | {null=} |",
857-
"| object_foo_null | {null=} |",
858-
"| object_bar | {null=} |",
859-
"| list_foo | {null=} |",
860-
"| invalid_json | {null=} |",
861-
"+------------------+--------------------------------------+",
851+
"+------------------+-------------------------------------------+",
852+
"| name | test.json_data -> Utf8(\"foo\") -> Int64(0) |",
853+
"+------------------+-------------------------------------------+",
854+
"| object_foo | {null=} |",
855+
"| object_foo_array | {int=1} |",
856+
"| object_foo_obj | {null=} |",
857+
"| object_foo_null | {null=} |",
858+
"| object_bar | {null=} |",
859+
"| list_foo | {null=} |",
860+
"| invalid_json | {null=} |",
861+
"+------------------+-------------------------------------------+",
862862
];
863863
assert_batches_eq!(expected, &batches);
864864
}
@@ -868,7 +868,7 @@ async fn test_plan_arrow_double_nested() {
868868
let lines = logical_plan(r#"explain select json_data->'foo'->0 from test"#).await;
869869

870870
let expected = [
871-
"Projection: json_get(test.json_data, Utf8(\"foo\"), Int64(0)) AS json_data -> Utf8(\"foo\") -> Int64(0)",
871+
"Projection: json_get(test.json_data, Utf8(\"foo\"), Int64(0)) AS test.json_data -> Utf8(\"foo\") -> Int64(0)",
872872
" TableScan: test projection=[json_data]",
873873
];
874874

@@ -882,17 +882,17 @@ async fn test_arrow_double_nested_cast() {
882882
.unwrap();
883883

884884
let expected = [
885-
"+------------------+--------------------------------------+",
886-
"| name | json_data -> Utf8(\"foo\") -> Int64(0) |",
887-
"+------------------+--------------------------------------+",
888-
"| object_foo | |",
889-
"| object_foo_array | 1 |",
890-
"| object_foo_obj | |",
891-
"| object_foo_null | |",
892-
"| object_bar | |",
893-
"| list_foo | |",
894-
"| invalid_json | |",
895-
"+------------------+--------------------------------------+",
885+
"+------------------+-------------------------------------------+",
886+
"| name | test.json_data -> Utf8(\"foo\") -> Int64(0) |",
887+
"+------------------+-------------------------------------------+",
888+
"| object_foo | |",
889+
"| object_foo_array | 1 |",
890+
"| object_foo_obj | |",
891+
"| object_foo_null | |",
892+
"| object_bar | |",
893+
"| list_foo | |",
894+
"| invalid_json | |",
895+
"+------------------+-------------------------------------------+",
896896
];
897897
assert_batches_eq!(expected, &batches);
898898
}
@@ -902,7 +902,7 @@ async fn test_plan_arrow_double_nested_cast() {
902902
let lines = logical_plan(r#"explain select (json_data->'foo'->0)::int from test"#).await;
903903

904904
let expected = [
905-
"Projection: json_get_int(test.json_data, Utf8(\"foo\"), Int64(0)) AS json_data -> Utf8(\"foo\") -> Int64(0)",
905+
"Projection: json_get_int(test.json_data, Utf8(\"foo\"), Int64(0)) AS test.json_data -> Utf8(\"foo\") -> Int64(0)",
906906
" TableScan: test projection=[json_data]",
907907
];
908908

@@ -953,17 +953,17 @@ async fn test_lexical_precedence_wrong() {
953953
#[tokio::test]
954954
async fn test_question_mark_contains() {
955955
let expected = [
956-
"+------------------+-------------------------+",
957-
"| name | json_data ? Utf8(\"foo\") |",
958-
"+------------------+-------------------------+",
959-
"| object_foo | true |",
960-
"| object_foo_array | true |",
961-
"| object_foo_obj | true |",
962-
"| object_foo_null | true |",
963-
"| object_bar | false |",
964-
"| list_foo | false |",
965-
"| invalid_json | false |",
966-
"+------------------+-------------------------+",
956+
"+------------------+------------------------------+",
957+
"| name | test.json_data ? Utf8(\"foo\") |",
958+
"+------------------+------------------------------+",
959+
"| object_foo | true |",
960+
"| object_foo_array | true |",
961+
"| object_foo_obj | true |",
962+
"| object_foo_null | true |",
963+
"| object_bar | false |",
964+
"| list_foo | false |",
965+
"| invalid_json | false |",
966+
"+------------------+------------------------------+",
967967
];
968968

969969
let batches = run_query("select name, json_data ? 'foo' from test").await.unwrap();
@@ -1056,17 +1056,17 @@ async fn test_arrow_union_is_null() {
10561056
.unwrap();
10571057

10581058
let expected = [
1059-
"+------------------+----------------------------------+",
1060-
"| name | json_data -> Utf8(\"foo\") IS NULL |",
1061-
"+------------------+----------------------------------+",
1062-
"| object_foo | false |",
1063-
"| object_foo_array | false |",
1064-
"| object_foo_obj | false |",
1065-
"| object_foo_null | true |",
1066-
"| object_bar | true |",
1067-
"| list_foo | true |",
1068-
"| invalid_json | true |",
1069-
"+------------------+----------------------------------+",
1059+
"+------------------+---------------------------------------+",
1060+
"| name | test.json_data -> Utf8(\"foo\") IS NULL |",
1061+
"+------------------+---------------------------------------+",
1062+
"| object_foo | false |",
1063+
"| object_foo_array | false |",
1064+
"| object_foo_obj | false |",
1065+
"| object_foo_null | true |",
1066+
"| object_bar | true |",
1067+
"| list_foo | true |",
1068+
"| invalid_json | true |",
1069+
"+------------------+---------------------------------------+",
10701070
];
10711071
assert_batches_eq!(expected, &batches);
10721072
}
@@ -1078,17 +1078,17 @@ async fn test_arrow_union_is_not_null() {
10781078
.unwrap();
10791079

10801080
let expected = [
1081-
"+------------------+--------------------------------------+",
1082-
"| name | json_data -> Utf8(\"foo\") IS NOT NULL |",
1083-
"+------------------+--------------------------------------+",
1084-
"| object_foo | true |",
1085-
"| object_foo_array | true |",
1086-
"| object_foo_obj | true |",
1087-
"| object_foo_null | false |",
1088-
"| object_bar | false |",
1089-
"| list_foo | false |",
1090-
"| invalid_json | false |",
1091-
"+------------------+--------------------------------------+",
1081+
"+------------------+-------------------------------------------+",
1082+
"| name | test.json_data -> Utf8(\"foo\") IS NOT NULL |",
1083+
"+------------------+-------------------------------------------+",
1084+
"| object_foo | true |",
1085+
"| object_foo_array | true |",
1086+
"| object_foo_obj | true |",
1087+
"| object_foo_null | false |",
1088+
"| object_bar | false |",
1089+
"| list_foo | false |",
1090+
"| invalid_json | false |",
1091+
"+------------------+-------------------------------------------+",
10921092
];
10931093
assert_batches_eq!(expected, &batches);
10941094
}
@@ -1119,14 +1119,14 @@ async fn test_long_arrow_cast() {
11191119
let batches = run_query("select (json_data->>'foo')::int from other").await.unwrap();
11201120

11211121
let expected = [
1122-
"+---------------------------+",
1123-
"| json_data ->> Utf8(\"foo\") |",
1124-
"+---------------------------+",
1125-
"| 42 |",
1126-
"| 42 |",
1127-
"| |",
1128-
"| |",
1129-
"+---------------------------+",
1122+
"+---------------------------------+",
1123+
"| other.json_data ->> Utf8(\"foo\") |",
1124+
"+---------------------------------+",
1125+
"| 42 |",
1126+
"| 42 |",
1127+
"| |",
1128+
"| |",
1129+
"+---------------------------------+",
11301130
];
11311131
assert_batches_eq!(expected, &batches);
11321132
}

0 commit comments

Comments
 (0)