Copilot commented on code in PR #172:
URL: https://github.com/apache/hbase-connectors/pull/172#discussion_r4455363618


##########
spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/datasources/HBaseTableScanRDD.scala:
##########
@@ -48,7 +48,8 @@ class HBaseTableScanRDD(
     } else {
       None
     }
-    val upper = if (r.upperBound != null && r.upperBound.length > 0) {
+    // Only null is unbounded; an empty upper key must not turn an empty range 
into a full scan.
+    val upper = if (r.upperBound != null) {

Review Comment:
   Preserving this finite empty upper bound makes standalone `key < ''` produce 
zero partitions, but `HBaseRelation.buildScan` (`DefaultSource.scala:436–465`) 
then starts an unbounded scan without the pushdown filter. This causes an 
unnecessary full-table read and can fail when projecting the row key because 
the fallback adds its empty column family. Keep the finite bound, return an 
empty RDD for a zero-partition plan, and add a standalone empty-range 
regression—the new union cases retain a point read and bypass this branch.



-- 
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]

Reply via email to