Skip to content

Commit 8acb466

Browse files
committed
add test
1 parent 29698ef commit 8acb466

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/main.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,23 @@ async fn test_long_arrow_eq_str() {
819819
assert_batches_eq!(expected, &batches);
820820
}
821821

822+
#[tokio::test]
823+
async fn test_arrow_cast_key_text() {
824+
let sql = r#"select ('{"foo": 42}'->('foo'::text))"#;
825+
let batches = run_query(sql).await.unwrap();
826+
827+
let expected = [
828+
"+------------------------+",
829+
"| '{\"foo\": 42}' -> 'foo' |",
830+
"+------------------------+",
831+
"| {int=42} |",
832+
"+------------------------+",
833+
];
834+
assert_batches_eq!(expected, &batches);
835+
836+
assert_eq!(display_val(batches).await, (DataType::Int64, "42".to_string()));
837+
}
838+
822839
#[tokio::test]
823840
async fn test_arrow_cast_int() {
824841
let sql = r#"select ('{"foo": 42}'->'foo')::int"#;

0 commit comments

Comments
 (0)