This is an automated email from the ASF dual-hosted git repository.
jackylk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git
The following commit(s) were added to refs/heads/master by this push:
new 7e4bd88 [HOTFIX] Fix UDF, Hex SQL Functions test case for binary
7e4bd88 is described below
commit 7e4bd881f4921e56d87fbc670a25165d87b5ef8a
Author: Indhumathi27 <[email protected]>
AuthorDate: Wed Dec 25 14:04:52 2019 +0530
[HOTFIX] Fix UDF, Hex SQL Functions test case for binary
This closes #3534
---
.../carbondata/datasource/SparkCarbonDataSourceBinaryTest.scala | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git
a/integration/spark-datasource/src/test/scala/org/apache/spark/sql/carbondata/datasource/SparkCarbonDataSourceBinaryTest.scala
b/integration/spark-datasource/src/test/scala/org/apache/spark/sql/carbondata/datasource/SparkCarbonDataSourceBinaryTest.scala
index 9a3a9f0..b1c2832 100644
---
a/integration/spark-datasource/src/test/scala/org/apache/spark/sql/carbondata/datasource/SparkCarbonDataSourceBinaryTest.scala
+++
b/integration/spark-datasource/src/test/scala/org/apache/spark/sql/carbondata/datasource/SparkCarbonDataSourceBinaryTest.scala
@@ -469,16 +469,19 @@ class SparkCarbonDataSourceBinaryTest extends FunSuite
with BeforeAndAfterAll {
""".stripMargin)
sql("insert into carbon_table select * from hivetable")
- sqlContext.udf.register("decodeHex", (str: String) =>
Hex.decodeHex(str.toCharArray))
+ def getHexString(str: String) = {
+ str.toList.map(_.toInt.toHexString).mkString
+ }
+ sqlContext.udf.register("decodeHex", (str: String) =>
+ Hex.decodeHex(getHexString(str).toCharArray))
sqlContext.udf.register("decodeBase64", (str: String) =>
Base64.decodeBase64(str.getBytes()))
val udfHexResult = sql("SELECT decodeHex(image) FROM carbon_table")
- val unhexResult = sql("SELECT unhex(image) FROM carbon_table")
- checkAnswer(udfHexResult, unhexResult)
val udfBase64Result = sql("SELECT decodeBase64(image) FROM
carbon_table")
val unbase64Result = sql("SELECT unbase64(image) FROM carbon_table")
checkAnswer(udfBase64Result, unbase64Result)
+ checkAnswer(udfHexResult, unbase64Result)
val carbonResult = sql("SELECT * FROM carbon_table")
val hiveResult = sql("SELECT * FROM hivetable")