You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spark/src/test/scala/org/apache/comet/exec/CometNativeReaderSuite.scala
+92Lines changed: 92 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -143,4 +143,96 @@ class CometNativeReaderSuite extends CometTestBase with AdaptiveSparkPlanHelper
143
143
|""".stripMargin,
144
144
"select c0 from tbl")
145
145
}
146
+
147
+
test("native reader - read MAP of value ARRAY fields") {
148
+
testSingleLineQuery(
149
+
"""
150
+
|select map('a', array(1), 'c', array(3)) as c0 union all
151
+
|select map('b', array(2))
152
+
|""".stripMargin,
153
+
"select c0 from tbl")
154
+
}
155
+
156
+
test("native reader - read MAP of value STRUCT fields") {
157
+
testSingleLineQuery(
158
+
"""
159
+
|select map('a', named_struct('f0', 0, 'f1', 'foo'), 'b', named_struct('f0', 1, 'f1', 'bar')) as c0 union all
160
+
|select map('c', named_struct('f2', 0, 'f1', 'baz')) as c0
161
+
|""".stripMargin,
162
+
"select c0 from tbl")
163
+
}
164
+
165
+
test("native reader - read MAP of value MAP fields") {
166
+
testSingleLineQuery(
167
+
"""
168
+
|select map('a', map('a1', 1, 'b1', 2), 'b', map('a2', 2, 'b2', 3)) as c0 union all
169
+
|select map('c', map('a3', 3, 'b3', 4))
170
+
|""".stripMargin,
171
+
"select c0 from tbl")
172
+
}
173
+
174
+
/*
175
+
org.apache.spark.SparkException: Job aborted due to stage failure: Task 1 in stage 171.0 failed 1 times, most recent failure:
176
+
Lost task 1.0 in stage 171.0 (TID 179) (knode0099.cngya03.pie.silu.net executor driver): org.apache.comet.CometNativeException: called `Result::unwrap()`
177
+
on an `Err` value: InvalidArgumentError("Incorrect datatype for StructArray field \"m0\", expected Map(Field { name: \"entries\",
0 commit comments