From fe033c16923dd1899d2608537115152f5d2f07ae Mon Sep 17 00:00:00 2001 From: Novemser <2072806652@qq.com> Date: Wed, 27 Dec 2017 17:23:28 +0800 Subject: [PATCH] Fix Aggregation push down NPE issue (#164) --- src/main/scala/org/apache/spark/sql/TiStrategy.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/scala/org/apache/spark/sql/TiStrategy.scala b/src/main/scala/org/apache/spark/sql/TiStrategy.scala index df31eb4d2a..17b82d04fb 100644 --- a/src/main/scala/org/apache/spark/sql/TiStrategy.scala +++ b/src/main/scala/org/apache/spark/sql/TiStrategy.scala @@ -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)) }