You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Aditya Kishore (JIRA)" <ji...@apache.org> on 2014/09/18 07:19:33 UTC

[jira] [Commented] (DRILL-1433) Where query on HBase store fails when row_key doesn't exist in HBase

    [ https://issues.apache.org/jira/browse/DRILL-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14138520#comment-14138520 ] 

Aditya Kishore commented on DRILL-1433:
---------------------------------------

For the second diff block, wouldn't this be sufficient?
{code}
@@ -85,8 +85,10 @@ public class TableStatsCalculator {
           numColumnsSum += row.size();
           rowSizeSum += row.getBytes().getLength();
         }
-        avgRowSizeInBytes = rowSizeSum/rowCount;
-        colsPerRow = numColumnsSum/rowCount;
+        if (rowCount > 0) {
+          avgRowSizeInBytes = rowSizeSum/rowCount;
+          colsPerRow = numColumnsSum/rowCount;
+        }
         scanner.close();
       } 
{code}

> Where query on HBase store fails when row_key doesn't exist in HBase
> --------------------------------------------------------------------
>
>                 Key: DRILL-1433
>                 URL: https://issues.apache.org/jira/browse/DRILL-1433
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - HBase
>    Affects Versions: 0.6.0
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: 0001-Fixing-HBase-store-when-row_key-doesn-t-exist-in-HBa.patch
>
>
> Give any query on hbase using where clause. If the queried row_key does not exist on HBase,
> query fails with the following exception
> {noformat}
> java.lang.ArithmeticException: / by zero
> 	at org.apache.drill.exec.store.hbase.TableStatsCalculator.<init>(TableStatsCalculator.java:88) ~[drill-storage-hbase-0.6.0-incubating-SNAPSHOT.jar:0.6.0-incubating-SNAPSHOT]
> 	at org.apache.drill.exec.store.hbase.HBaseGroupScan.init(HBaseGroupScan.java:150) ~[drill-storage-hbase-0.6.0-incubating-SNAPSHOT.jar:0.6.0-incubating-SNAPSHOT]
> 	at org.apache.drill.exec.store.hbase.HBaseGroupScan.<init>(HBaseGroupScan.java:116) ~[drill-storage-hbase-0.6.0-incubating-SNAPSHOT.jar:0.6.0-incubating-SNAPSHOT]
> 	at org.apache.drill.exec.store.hbase.HBaseStoragePlugin.getPhysicalScan(HBaseStoragePlugin.java:65) ~[drill-storage-hbase-0.6.0-incubating-SNAPSHOT.jar:0.6.0-incubating-SNAPSHOT]
> 	at org.apache.drill.exec.store.hbase.HBaseStoragePlugin.getPhysicalScan(HBaseStoragePlugin.java:35) ~[drill-storage-hbase-0.6.0-incubating-SNAPSHOT.jar:0.6.0-incubating-SNAPSHOT]
> 	at org.apache.drill.exec.planner.logical.DrillTable.getGroupScan(DrillTable.java:53) ~[drill-java-exec-0.6.0-incubating-SNAPSHOT-rebuffed.jar:0.6.0-incubating-SNAPSHOT]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)