Dieken commented on a change in pull request #72:
URL: https://github.com/apache/hbase-connectors/pull/72#discussion_r537942618



##########
File path: 
spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala
##########
@@ -150,12 +151,10 @@ case class HBaseRelation (
 
   def createTable() {
     val numReg = parameters.get(HBaseTableCatalog.newTable).map(x => 
x.toInt).getOrElse(0)
-    val startKey =  Bytes.toBytes(
-      parameters.get(HBaseTableCatalog.regionStart)
-        .getOrElse(HBaseTableCatalog.defaultRegionStart))
-    val endKey = Bytes.toBytes(
-      parameters.get(HBaseTableCatalog.regionEnd)
-        .getOrElse(HBaseTableCatalog.defaultRegionEnd))
+    val startKey = parameters.get(HBaseTableCatalog.regionStart)
+      
.getOrElse(HBaseTableCatalog.defaultRegionStart).getBytes(StandardCharsets.ISO_8859_1)

Review comment:
       The spark option use string to pass parameters, not support directly 
passing bytes,I need pass binary row key so I have to interpreter binary bytes 
as ISO_8859_1 encoded String, it’s not valid UTF-8.
   
   It’s a trick, does break backward compatibility for UTF-8 string containing 
characters beyond ISO_8859_1 charset, the UTF-8 string must be wrapped as 
explained in the JIRA issue.
   
   I can’t figure out better way to pass bytes in spark option.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to