Skip to content

Commit

Permalink
add uts
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyang-li committed Jul 26, 2024
1 parent d632b5c commit f678141
Showing 1 changed file with 10 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -903,38 +903,20 @@ class GlutenClickHouseNativeWriteTableSuite
| ) partitioned by (day string)
| stored as $format""".stripMargin

// FIXME:
// Spark analyzer(>=3.4) will resolve map type to
// map_from_arrays(transform(map_keys(map('t1','a','t2','b')), v->v),
// transform(map_values(map('t1','a','t2','b')), v->v))
// which cause core dump. see https://github.com/apache/incubator-gluten/issues/6561
// for details.
val insert_sql =
if (isSparkVersionLE("3.3")) {
s"""insert overwrite $table_name partition (day)
|select id as a,
| str_to_map(concat('t1:','a','&t2:','b'),'&',':'),
| struct('1', null) as c,
| '2024-01-08' as day
|from range(10)""".stripMargin
} else {
s"""insert overwrite $table_name partition (day)
|select id as a,
| map('t1', 'a', 't2', 'b'),
| struct('1', null) as c,
| '2024-01-08' as day
|from range(10)""".stripMargin
}
s"""insert overwrite $table_name partition (day)
|select id as a,
| map('t1', 'a', 't2', 'b'),
| struct('1', null) as c,
| '2024-01-08' as day
|from range(10)""".stripMargin
(table_name, create_sql, insert_sql)
},
(table_name, _) =>
if (isSparkVersionGE("3.4")) {
// FIXME: Don't Know Why Failed
compareResultsAgainstVanillaSpark(
s"select * from $table_name",
compareResult = true,
_ => {})
}
compareResultsAgainstVanillaSpark(
s"select * from $table_name",
compareResult = true,
_ => {})
)
}
}

0 comments on commit f678141

Please sign in to comment.