Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/11936#discussion_r57510021
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcRelation.scala ---
@@ -291,10 +308,10 @@ private[orc] case class OrcTableScan(
val orcFormat = new DefaultSource
val dataSchema =
orcFormat
- .inferSchema(sqlContext, Map.empty, inputPaths)
- .getOrElse(sys.error("Failed to read schema from target ORC
files."))
+ .inferSchema(sqlContext, Map.empty, inputPaths)
+ .getOrElse(sys.error("Failed to read schema from target ORC
files."))
// Sets requested columns
- addColumnIds(dataSchema, attributes, conf)
+ OrcRelation.setRequiredColumns(conf, dataSchema,
StructType.fromAttributes(attributes))
--- End diff --
The original method is in `OrcFileScan`, which is a case class, and is hard
to reuse. This PR refactors `addColumnIds` and `fillObject` in `OrcFileScan`
and moves them to `object OrcRelation` so that they can be easily reused.
---
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]