Skip to content

Commit 06fed08

Browse files
Mikhail Gorbovekrivokonmapr
authored andcommitted
Mapr [SPARK-248] MapRDBTableScanRDD fails to convert to Scala Dataframe when using where clause (apache#289)
1 parent 2263735 commit 06fed08

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

external/maprdb/src/main/scala/com/mapr/db/spark/sql/DefaultSource.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class DefaultSource
4646
schema: StructType): BaseRelation = {
4747
val condition: Option[QueryCondition] = parameters
4848
.get("QueryCondition")
49-
.map(cond => ConditionImpl.parseFrom(ByteBuffer.wrap(cond.getBytes)))
49+
.map(cond => ConditionImpl.parseFrom(ByteBuffer.wrap(cond.getBytes("ISO-8859-1"))))
5050

5151
createMapRDBRelation(
5252
sqlContext,

external/maprdb/src/main/scala/com/mapr/db/spark/utils/MapRSpark.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,18 @@ case class MapRSpark(sparkSession: Option[SparkSession],
174174
.option("tablePath", this.tableName.get)
175175
.option("sampleSize", sampleSize)
176176

177-
val readerWithCondition =
178177
if (cond.isDefined) {
179178
reader.option("QueryCondition",
180179
new String(
181180
cond.get.condition
182181
.asInstanceOf[ConditionImpl]
183182
.getDescriptor
184183
.getSerialized
185-
.array))
186-
}
187-
188-
184+
.array,
185+
"ISO-8859-1"
186+
))
187+
}
189188

190-
val readerWithProjection =
191189
if (columns.isDefined) {
192190
reader.option(
193191
"ColumnProjection",

0 commit comments

Comments
 (0)