wchevreuil commented on code in PR #171:
URL: https://github.com/apache/hbase-connectors/pull/171#discussion_r4400340452
##########
spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala:
##########
@@ -226,9 +226,20 @@ case class HBaseRelation(
val rdd = data.rdd
def convertToPut(row: Row) = {
// construct bytes for row key
- val rowBytes = rkIdxedFields.map {
- case (x, y) =>
- Utils.toBytes(row(x), y)
+ val rowBytes = rkIdxedFields.zipWithIndex.map {
+ case ((x, field), index) =>
+ val bytes = Utils.toBytes(row(x), field)
+ if (field.length == -1 && field.dt == StringType) {
+ require(
+ !bytes.contains(HBaseTableCatalog.delimiter),
+ s"Row key column '${field.colName}' cannot contain the
delimiter")
Review Comment:
I think this is a nice to have, and is a simple matter of moving this
require check to the if branch from line #236.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]