[
https://issues.apache.org/jira/browse/TAJO-1940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15111771#comment-15111771
]
ASF GitHub Bot commented on TAJO-1940:
--------------------------------------
Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/910#discussion_r50493447
--- Diff:
tajo-storage/tajo-storage-hbase/src/main/java/org/apache/tajo/storage/hbase/HBaseTablespace.java
---
@@ -101,8 +104,19 @@ public Configuration getHbaseConf() {
}
@Override
- public long getTableVolume(URI uri, Optional<EvalNode> filter) throws
UnsupportedException {
- throw new UnsupportedException();
+ public long getTableVolume(TableDesc table, Optional<EvalNode> filter) {
+ long totalVolume;
+ try {
+ totalVolume = getRawSplits("", table, filter.orElse(null)).stream()
+ .map(f -> f.getLength())
+ .filter(size -> size > 0) // eliminate unknown sizes (-1)
+ .reduce(0L, (sum, size) -> sum + size);
--- End diff --
This line can be more simplified into ```.reduce(0L, Long::sum)```.
> Implement HBaseTablespace::getTableVolume() method
> --------------------------------------------------
>
> Key: TAJO-1940
> URL: https://issues.apache.org/jira/browse/TAJO-1940
> Project: Tajo
> Issue Type: Task
> Components: HBase Storage
> Reporter: Jihoon Son
> Assignee: Hyunsik Choi
> Fix For: 0.12.0, 0.11.1
>
>
> Table volume has an important role in query planning. Tajo's query optimizer
> makes many decisions based on table volume, because it is currently the only
> available statistics.
> However, HBaseTablespace doesn't support getTableVolume() method, so our plan
> is not good when the query involves any HBase tables.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)