Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/4380#discussion_r30635633
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala ---
@@ -469,6 +470,40 @@ private[hive] class HiveMetastoreCatalog(val client:
ClientInterface, hive: Hive
}
}
+ object WriteToDirs extends Rule[LogicalPlan] with HiveInspectors {
+ import org.apache.hadoop.hive.ql.Context
+ import org.apache.hadoop.hive.ql.parse.{ASTNode, SemanticAnalyzer}
+
+ def apply(plan: LogicalPlan): LogicalPlan = plan transform {
+ // Wait until children are resolved.
+ case p: LogicalPlan if !p.childrenResolved => p
+
+ case WriteToDirectory(path, child, isLocal, extra: ASTNode) =>
--- End diff --
We shouldn't be holding onto the AST anymore, as this ties us a little too
closely to a specific version of Hive. Instead look at how we are doing things
in
[CreateTableAsSelect](https://github.com/apache/spark/blob/master/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/CreateTableAsSelect.scala).
Also, please add a test case where you use this new operation on a Spark
SQL temporary table.
---
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]