Github user dongjoon-hyun commented on a diff in the pull request:
https://github.com/apache/spark/pull/19871#discussion_r154860853
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala
---
@@ -568,8 +574,13 @@ object DataSource extends Logging {
"org.apache.spark.Logging")
/** Given a provider name, look up the data source class definition. */
- def lookupDataSource(provider: String): Class[_] = {
- val provider1 = backwardCompatibilityMap.getOrElse(provider, provider)
+ def lookupDataSource(provider: String, conf: SQLConf): Class[_] = {
+ val provider1 = backwardCompatibilityMap.getOrElse(provider, provider)
match {
+ case name if name.equalsIgnoreCase("orc") &&
+ conf.getConf(SQLConf.ORC_IMPLEMENTATION) == "native" =>
+ classOf[OrcFileFormat].getCanonicalName
+ case name => name
--- End diff --
I agree with both of you.
Just for explanation: The original design completely preserves the previous
behavior.
Without `SQLConf.ORC_IMPLEMENTATION` option, Spark doesn't know
OrcFileFormat. So, in case of non-Hive support, creating data source with "orc"
will fail with unknown data source.
Anyway, I'm happy to update according to your advice. :)
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]