Skip to content

Commit

Permalink
Fixed compilation error.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxin committed Jan 27, 2015
1 parent ce4a5d2 commit d35efd5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,19 @@ class DataFrame(
}

/** Projection */
override def apply(projection: Product): DataFrame = select(projection.productIterator.map {
case c: Column => c
case o: Any => new Column(Some(sqlContext), None, LiteralExpr(o))
}.toSeq :_*)
override def apply(projection: Product): DataFrame = {
require(projection.productArity >= 1)
select(projection.productIterator.map {
case c: Column => c
case o: Any => new Column(Some(sqlContext), None, LiteralExpr(o))
}.toSeq :_*)
}

override def as(name: String): DataFrame = Subquery(name, logicalPlan)

@scala.annotation.varargs
override def select(col: Column, cols: Column*): DataFrame = {
val exprs = (col +: cols).zipWithIndex.map {
override def select(cols: Column*): DataFrame = {
val exprs = cols.zipWithIndex.map {
case (Column(expr: NamedExpression), _) =>
expr
case (Column(expr: Expression), _) =>
Expand Down
2 changes: 1 addition & 1 deletion sql/core/src/main/scala/org/apache/spark/sql/api.scala
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ trait DataFrameSpecificApi {
def apply(projection: Product): DataFrame

@scala.annotation.varargs
def select(col: Column, cols: Column*): DataFrame
def select(cols: Column*): DataFrame

/** Filtering */
def apply(condition: Column): DataFrame = filter(condition)
Expand Down

0 comments on commit d35efd5

Please sign in to comment.