maropu commented on a change in pull request #29045:
URL: https://github.com/apache/spark/pull/29045#discussion_r453170403



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala
##########
@@ -181,10 +183,19 @@ class OrcFileFormat
       val readerOptions = OrcFile.readerOptions(conf).filesystem(fs)
       val requestedColIdsOrEmptyFile =
         Utils.tryWithResource(OrcFile.createReader(filePath, readerOptions)) { 
reader =>
+          // for ORC file written by Hive, no field names
+          // in the physical schema, there is a need to send the
+          // entire dataSchema instead of required schema
+          val orcFieldNames = reader.getSchema.getFieldNames.asScala
+          if (orcFieldNames.forall(_.startsWith("_col"))) {

Review comment:
       What does this code mean? `_col` needs to be hard-coded?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to