Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
weixiuli committed Nov 6, 2024
1 parent 3cb3229 commit aec4b3f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,25 @@ package org.apache.spark.sql.execution.datasources.parquet

import org.apache.spark.sql.GlutenSQLTestsBaseTrait

class GlutenParquetFieldIdIOSuite extends ParquetFieldIdIOSuite with GlutenSQLTestsBaseTrait {}
class GlutenParquetFieldIdIOSuite extends ParquetFieldIdIOSuite with GlutenSQLTestsBaseTrait {
testGluten("Parquet writer with ARRAY and MAP") {
spark.sql("""
|CREATE TABLE T1 (
| a INT,
| b ARRAY<STRING>,
| c MAP<STRING,STRING>
|)
|USING PARQUET
|""".stripMargin)

spark.sql("""
| INSERT OVERWRITE T1 VALUES
| (1, ARRAY(1, 2, 3), MAP("key1","value1"))
|""".stripMargin)

checkAnswer(
spark.sql("SELECT * FROM T1"),
Row(1, Array("1", "2", "3"), Map("key1" -> "value1")) :: Nil
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@
*/
package org.apache.spark.sql.execution.datasources.parquet

import org.apache.spark.sql.GlutenSQLTestsBaseTrait
import org.apache.spark.sql.{GlutenSQLTestsBaseTrait, Row}

class GlutenParquetFieldIdIOSuite extends ParquetFieldIdIOSuite with GlutenSQLTestsBaseTrait {}
class GlutenParquetFieldIdIOSuite extends ParquetFieldIdIOSuite with GlutenSQLTestsBaseTrait {
testGluten("Parquet writer with ARRAY and MAP") {
spark.sql("""
|CREATE TABLE T1 (
| a INT,
| b ARRAY<STRING>,
| c MAP<STRING,STRING>
|)
|USING PARQUET
|""".stripMargin)

spark.sql("""
| INSERT OVERWRITE T1 VALUES
| (1, ARRAY(1, 2, 3), MAP("key1","value1"))
|""".stripMargin)

checkAnswer(
spark.sql("SELECT * FROM T1"),
Row(1, Array("1", "2", "3"), Map("key1" -> "value1")) :: Nil
)
}
}

0 comments on commit aec4b3f

Please sign in to comment.