Skip to content

Commit

Permalink
Fix Aggregation push down NPE issue (pingcap#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
Novemser authored and birdstorm committed Dec 27, 2017
1 parent 5e1c1d5 commit fe033c1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/org/apache/spark/sql/TiStrategy.scala
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class TiStrategy(context: SQLContext) extends Strategy with Logging {
dagRequest: TiDAGRequest): SparkPlan = {
val table = source.table
dagRequest.setTableInfo(table)
// Need to resolve column info after add aggregation push downs
dagRequest.resolve()
if (dagRequest.getFields.isEmpty) {
dagRequest.addRequiredColumn(TiColumnRef.create(table.getColumns.get(0).getName))
}
Expand Down

0 comments on commit fe033c1

Please sign in to comment.