Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2773,4 +2773,22 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
}
}
}

Seq("orc", "parquet", "csv", "json").foreach { format =>
test(s"Write and read back unicode schema - $format") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of keeping adding test cases in SQLQuerySuite, shall we create a dedicate test suite for file based data source now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. That's a best idea. I'll update like that.

withTempPath { path =>
val dir = path.getCanonicalPath

// scalastyle:off nonascii
val df = Seq("a").toDF("한글")
// scalastyle:on nonascii

df.write.format(format).option("header", "true").save(dir)
val answerDf = spark.read.format(format).option("header", "true").load(dir)

assert(df.schema === answerDf.schema)
checkAnswer(df, answerDf)
}
}
}
}