phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmaho...@apache.org
Subject phoenix git commit: PHOENIX-2112 Phoenix-Spark need to support UTF8String for spark 1.4.0 (Yi Tian)
Date Mon, 13 Jul 2015 21:05:17 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 ee3882394 -> 35b7776e7


PHOENIX-2112 Phoenix-Spark need to support UTF8String for spark 1.4.0 (Yi Tian)


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/35b7776e
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/35b7776e
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/35b7776e

Branch: refs/heads/4.x-HBase-1.0
Commit: 35b7776e799d9ceadd4420fe03dcf4d858c9b49a
Parents: ee38823
Author: Josh Mahonin <jmahonin@interset.com>
Authored: Mon Jul 13 16:15:42 2015 -0400
Committer: Josh Mahonin <jmahonin@interset.com>
Committed: Mon Jul 13 17:05:03 2015 -0400

----------------------------------------------------------------------
 phoenix-spark/pom.xml                                         | 2 +-
 .../main/scala/org/apache/phoenix/spark/PhoenixRelation.scala | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/35b7776e/phoenix-spark/pom.xml
----------------------------------------------------------------------
diff --git a/phoenix-spark/pom.xml b/phoenix-spark/pom.xml
index 99a7b63..78194f4 100644
--- a/phoenix-spark/pom.xml
+++ b/phoenix-spark/pom.xml
@@ -34,7 +34,7 @@
   <name>Phoenix - Spark</name>
 
   <properties>
-    <spark.version>1.3.0</spark.version>
+    <spark.version>1.4.0</spark.version>
     <scala.version>2.10.4</scala.version>
     <scala.binary.version>2.10</scala.binary.version>
     <top.dir>${project.basedir}/..</top.dir>

http://git-wip-us.apache.org/repos/asf/phoenix/blob/35b7776e/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRelation.scala
----------------------------------------------------------------------
diff --git a/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRelation.scala b/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRelation.scala
index 8804f3b..f20ad61 100644
--- a/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRelation.scala
+++ b/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRelation.scala
@@ -19,10 +19,10 @@ package org.apache.phoenix.spark
 
 import org.apache.hadoop.conf.Configuration
 import org.apache.spark.rdd.RDD
-import org.apache.spark.sql.types.StructType
+import org.apache.spark.sql.types.{UTF8String, StructType}
 import org.apache.spark.sql.{Row, SQLContext}
 import org.apache.spark.sql.sources._
-import org.apache.commons.lang.StringEscapeUtils.escapeSql
+import org.apache.phoenix.util.StringUtil.escapeStringConstant
 
 case class PhoenixRelation(tableName: String, zkUrl: String)(@transient val sqlContext: SQLContext)
     extends BaseRelation with PrunedFilteredScan {
@@ -91,7 +91,8 @@ case class PhoenixRelation(tableName: String, zkUrl: String)(@transient
val sqlC
 
   // Helper function to escape string values in SQL queries
   private def compileValue(value: Any): Any = value match {
-    case stringValue: String => s"'${escapeSql(stringValue)}'"
+    case stringValue: String => s"'${escapeStringConstant(stringValue)}'"
+    case stringValue: UTF8String => s"'${escapeStringConstant(stringValue.toString)}'"
     case _ => value
   }
 }


Mime
View raw message