Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/14007#discussion_r69307924
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
---
@@ -215,6 +215,8 @@ abstract class Star extends LeafExpression with
NamedExpression {
case class UnresolvedStar(target: Option[Seq[String]]) extends Star with
Unevaluable {
override def expand(input: LogicalPlan, resolver: Resolver):
Seq[NamedExpression] = {
+ // When the table does not have any column, the input LogicalPlan does
not have any column
+ if (input.output.isEmpty) return Seq.empty[NamedExpression]
--- End diff --
how about we fix the next code block? e.g.
```
if (target.isEmpty) {
// If there is no table specified, use all input attributes.
input.output
} else if (target.get.size == 1) {
// If there is a table, pick out attributes that are part of this table.
input.output.filter(_.qualifier.exists(resolver(_, t.head)))
} else {
...... // the rest
}
```
---
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]