Github user chenghao-intel commented on a diff in the pull request:
https://github.com/apache/spark/pull/4014#discussion_r23424312
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala ---
@@ -165,8 +165,20 @@ private[hive] trait HiveStrategies {
object Scripts extends Strategy {
def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
- case logical.ScriptTransformation(input, script, output, child) =>
- ScriptTransformation(input, script, output,
planLater(child))(hiveContext) :: Nil
+ case logical.ScriptTransformation(input, script, output, child,
--- End diff --
I think a better place to extract the schema (the `output`) is in
`Analyzer`, `HiveContext` should be able to create its own rules for that,
instead of doing this in `Strategy`. Otherwise it probably fails in resolving
the attributes.
e.g.:
```
SELECT transform(key + 1, value) USING '/bin/cat' FROM src ORDER BY key,
value`
```
sorry, I didn't test that, let me know if I am wrong.
---
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]