Skip to content

Commit

Permalink
keep the original one and update code style
Browse files Browse the repository at this point in the history
  • Loading branch information
xubo245 committed Jan 5, 2018
1 parent fa902d6 commit cf7cbce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ object HiveSerDe {
def sourceToSerDe(source: String): Option[HiveSerDe] = {
val key = source.toLowerCase(Locale.ROOT) match {
case s if s.startsWith("org.apache.spark.sql.parquet") => "parquet"
case s if s.startsWith("org.apache.spark.sql.orc") => "orc"
case s if s.startsWith("org.apache.spark.sql.hive.orc") => "orc"
case s if s.equals("orcfile") => "orc"
case s if s.equals("parquetfile") => "parquet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ class HiveOrcSourceSuite extends OrcSuite with TestHiveSingleton {
|OPTIONS (
| PATH '${new File(orcTableAsDir.getAbsolutePath).toURI}'
|)
""".
stripMargin)
spark.sql(
"desc formatted normal_orc_as_source_hive").show()
""".stripMargin)

spark.sql("desc formatted normal_orc_as_source_hive").show()
checkAnswer(sql("SELECT COUNT(*) FROM normal_orc_as_source_hive"), Row(10))
assert(HiveSerDe.sourceToSerDe("org.apache.spark.sql.hive.orc")
.equals(HiveSerDe.sourceToSerDe("orc")))
assert(HiveSerDe.sourceToSerDe("org.apache.spark.sql.orc")
.equals(HiveSerDe.sourceToSerDe("orc")))
}

test("SPARK-19459/SPARK-18220: read char/varchar column written by Hive") {
Expand Down

0 comments on commit cf7cbce

Please sign in to comment.