@@ -304,25 +304,30 @@ class CometNativeReaderSuite extends CometTestBase with AdaptiveSparkPlanHelper
304304 " select c0[0].a, c0[0].a from tbl" )
305305 }
306306
307- test(" native reader - select nested field from a complex map key using map_keys" ) {
307+ test(" native reader - select nested field from a complex map[struct, struct] using map_keys" ) {
308308 testSingleLineQuery(
309309 """
310- | select map(str0, str0 ) c0 from
310+ | select map(str0, str1 ) c0 from
311311 | (
312- | select named_struct('a', cast(1 as long), 'b', cast(2 as long), 'c', cast(3 as long)) str0 union all
313- | select named_struct('a', cast(3 as long), 'b', cast(4 as long), 'c', cast(5 as long)) str0
312+ | select named_struct('a', cast(1 as long), 'b', cast(2 as long), 'c', cast(3 as long)) str0,
313+ | named_struct('x', cast(8 as long), 'y', cast(9 as long), 'z', cast(0 as long)) str1 union all
314+ | select named_struct('a', cast(3 as long), 'b', cast(4 as long), 'c', cast(5 as long)) str0,
315+ | named_struct('x', cast(6 as long), 'y', cast(7 as long), 'z', cast(8 as long)) str1
314316 | )
315317 |""" .stripMargin,
316318 " select map_keys(c0).b from tbl" )
317319 }
318320
319- // test("native reader - select nested field from a complex map key using map_values") {
321+ // commented out because of correctness issue https://github.com/apache/datafusion-comet/issues/1789
322+ // test("native reader - select nested field from a complex map[struct, struct] using map_values") {
320323// testSingleLineQuery(
321324// """
322- // | select map(str0, str0 ) c0 from
325+ // | select map(str0, str1 ) c0 from
323326// | (
324- // | select named_struct('a', cast(1 as long), 'b', cast(2 as long), 'c', cast(3 as long)) str0 union all
325- // | select named_struct('a', cast(3 as long), 'b', cast(4 as long), 'c', cast(5 as long)) str0
327+ // | select named_struct('a', cast(1 as long), 'b', cast(2 as long), 'c', cast(3 as long)) str0,
328+ // | named_struct('x', cast(8 as long), 'y', cast(9 as long), 'z', cast(0 as long)) str1 union all
329+ // | select named_struct('a', cast(3 as long), 'b', cast(4 as long), 'c', cast(5 as long)) str0,
330+ // | named_struct('x', cast(6 as long), 'y', cast(7 as long), 'z', cast(8 as long)) str1
326331// | )
327332// |""".stripMargin,
328333// "select map_values(c0).b from tbl")
0 commit comments