gstvg commented on code in PR #12116:
URL: https://github.com/apache/datafusion/pull/12116#discussion_r1727614121


##########
datafusion/sqllogictest/src/test_context.rs:
##########
@@ -361,3 +369,893 @@ fn create_example_udf() -> ScalarUDF {
         adder,
     )
 }
+
+fn register_union_tables(ctx: &SessionContext) {
+    sparse_1_1_single_field(ctx);
+    sparse_1_2_empty(ctx);
+    sparse_1_3a_null_target(ctx);
+    sparse_1_3b_null_target(ctx);
+    sparse_2_all_types_match(ctx);
+    sparse_3_1_none_match_target_can_contain_null_mask(ctx);
+    sparse_3_2_none_match_cant_contain_null_mask_union_target(ctx);
+    sparse_4_1_1_target_with_nulls(ctx);
+    sparse_4_1_2_target_without_nulls(ctx);
+    sparse_4_2_some_match_target_cant_contain_null_mask(ctx);
+    dense_1_1_both_empty(ctx);
+    dense_1_2_empty_union_target_non_empty(ctx);
+    dense_2_non_empty_union_target_empty(ctx);
+    dense_3_1_null_target_smaller_len(ctx);
+    dense_3_2_null_target_equal_len(ctx);
+    dense_3_3_null_target_bigger_len(ctx);
+    dense_4_1a_single_type_sequential_offsets_equal_len(ctx);
+    dense_4_2a_single_type_sequential_offsets_bigger(ctx);
+    dense_4_3a_single_type_non_sequential(ctx);
+    dense_4_1b_empty_siblings_sequential_equal_len(ctx);
+    dense_4_2b_empty_siblings_sequential_bigger_len(ctx);
+    dense_4_3b_empty_sibling_non_sequential(ctx);
+    dense_4_1c_all_types_match_sequential_equal_len(ctx);
+    dense_4_2c_all_types_match_sequential_bigger_len(ctx);
+    dense_4_3c_all_types_match_non_sequential(ctx);
+    dense_5_1a_none_match_less_len(ctx);
+    dense_5_1b_cant_contain_null_mask(ctx);
+    dense_5_2_none_match_equal_len(ctx);
+    dense_5_3_none_match_greater_len(ctx);
+    dense_6_some_matches(ctx);
+    empty_sparse_union(ctx);
+    empty_dense_union(ctx);
+}
+
+fn register_union_table(
+    ctx: &SessionContext,
+    union: UnionArray,
+    table_name: &str,
+    expected: impl Array + 'static,
+) {
+    let schema = Schema::new(vec![
+        Field::new("my_union", union.data_type().clone(), false),
+        Field::new("expected", expected.data_type().clone(), true),
+    ]);
+
+    let batch = RecordBatch::try_new(
+        Arc::new(schema.clone()),
+        vec![Arc::new(union), Arc::new(expected)],
+    )
+    .unwrap();
+
+    ctx.register_batch(table_name, batch).unwrap();
+}
+
+fn sparse_1_1_single_field(ctx: &SessionContext) {

Review Comment:
   [see other 
comment](https://github.com/apache/datafusion/pull/12116/files#r1727611010)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to