Github user dongjoon-hyun commented on a diff in the pull request:
https://github.com/apache/spark/pull/18953#discussion_r134068925
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcQuerySuite.scala ---
@@ -205,38 +220,53 @@ class OrcQuerySuite extends QueryTest with
BeforeAndAfterAll with OrcTest {
spark.range(0, 10).write
.option("compression", "ZLIB")
.orc(file.getCanonicalPath)
+ val maybeOrcFile =
file.listFiles().find(_.getName.endsWith(".zlib.orc"))
+ assert(maybeOrcFile.isDefined)
+ val orcFilePath = new Path(maybeOrcFile.get.getAbsolutePath)
+ val conf = OrcFile.readerOptions(new Configuration())
val expectedCompressionKind =
-
OrcFileOperator.getFileReader(file.getCanonicalPath).get.getCompression
+ OrcFile.createReader(orcFilePath, conf).getCompressionKind
assert("ZLIB" === expectedCompressionKind.name())
}
withTempPath { file =>
spark.range(0, 10).write
.option("compression", "SNAPPY")
.orc(file.getCanonicalPath)
+ val maybeOrcFile =
file.listFiles().find(_.getName.endsWith(".snappy.orc"))
+ assert(maybeOrcFile.isDefined)
+ val orcFilePath = new Path(maybeOrcFile.get.getAbsolutePath)
+ val conf = OrcFile.readerOptions(new Configuration())
val expectedCompressionKind =
-
OrcFileOperator.getFileReader(file.getCanonicalPath).get.getCompression
+ OrcFile.createReader(orcFilePath, conf).getCompressionKind
assert("SNAPPY" === expectedCompressionKind.name())
}
withTempPath { file =>
spark.range(0, 10).write
.option("compression", "NONE")
.orc(file.getCanonicalPath)
+ val maybeOrcFile = file.listFiles().find(_.getName.endsWith(".orc"))
+ assert(maybeOrcFile.isDefined)
+ val orcFilePath = new Path(maybeOrcFile.get.getAbsolutePath)
+ val conf = OrcFile.readerOptions(new Configuration())
val expectedCompressionKind =
-
OrcFileOperator.getFileReader(file.getCanonicalPath).get.getCompression
+ OrcFile.createReader(orcFilePath, conf).getCompressionKind
assert("NONE" === expectedCompressionKind.name())
}
}
- // Following codec is not supported in Hive 1.2.1, ignore it now
- ignore("LZO compression options for writing to an ORC file not supported
in Hive 1.2.1") {
--- End diff --
This is a known improvement.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]