PHOENIX-3601 PhoenixRDD doesn't expose the preferred node locations to Spark
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/c1027f17 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/c1027f17 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/c1027f17 Branch: refs/heads/encodecolumns2 Commit: c1027f17facad8870835b880767312e15be7e651 Parents: e1b1cd8 Author: Josh Mahonin <jmaho...@gmail.com> Authored: Mon Feb 13 10:58:02 2017 -0500 Committer: Josh Mahonin <jmaho...@gmail.com> Committed: Mon Feb 13 11:04:45 2017 -0500 ---------------------------------------------------------------------- .../src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/c1027f17/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala ---------------------------------------------------------------------- diff --git a/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala b/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala index 01a9077..63547d2 100644 --- a/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala +++ b/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala @@ -55,6 +55,10 @@ class PhoenixRDD(sc: SparkContext, table: String, columns: Seq[String], phoenixRDD.partitions } + override protected def getPreferredLocations(split: Partition): Seq[String] = { + phoenixRDD.preferredLocations(split) + } + @DeveloperApi override def compute(split: Partition, context: TaskContext) = { phoenixRDD.compute(split, context).map(r => r._2)