kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KYLIN-3398) Inaccurate arithmetic operation in LookupTableToHFileJob#calculateShardNum
Date Sun, 10 Jun 2018 06:48:00 GMT

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

ASF GitHub Bot commented on KYLIN-3398:
---------------------------------------

codecov-io commented on issue #152: KYLIN-3398 Fix inaccurate arithmetic operations
URL: https://github.com/apache/kylin/pull/152#issuecomment-396025190
 
 
   # [Codecov](https://codecov.io/gh/apache/kylin/pull/152?src=pr&el=h1) Report
   > Merging [#152](https://codecov.io/gh/apache/kylin/pull/152?src=pr&el=desc) into
[master](https://codecov.io/gh/apache/kylin/commit/93247fa7f23ac427e8b6a581b0f902366bb9804f?src=pr&el=desc)
will **increase** coverage by `<.01%`.
   > The diff coverage is `0%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/kylin/pull/152/graphs/tree.svg?src=pr&token=JawVgbgsVo&width=650&height=150)](https://codecov.io/gh/apache/kylin/pull/152?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #152      +/-   ##
   ============================================
   + Coverage     22.14%   22.14%   +<.01%     
   - Complexity     4019     4020       +1     
   ============================================
     Files          1012     1012              
     Lines         61207    61207              
     Branches       8768     8768              
   ============================================
   + Hits          13552    13553       +1     
     Misses        46414    46414              
   + Partials       1241     1240       -1
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/kylin/pull/152?src=pr&el=tree) | Coverage
Δ | Complexity Δ | |
   |---|---|---|---|
   | [...in/storage/hbase/lookup/LookupTableToHFileJob.java](https://codecov.io/gh/apache/kylin/pull/152/diff?src=pr&el=tree#diff-c3RvcmFnZS1oYmFzZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUva3lsaW4vc3RvcmFnZS9oYmFzZS9sb29rdXAvTG9va3VwVGFibGVUb0hGaWxlSm9iLmphdmE=)
| `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: |
   | [...rg/apache/kylin/cube/inmemcubing/MemDiskStore.java](https://codecov.io/gh/apache/kylin/pull/152/diff?src=pr&el=tree#diff-Y29yZS1jdWJlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reWxpbi9jdWJlL2lubWVtY3ViaW5nL01lbURpc2tTdG9yZS5qYXZh)
| `69.6% <0%> (-0.61%)` | `7% <0%> (ø)` | |
   | [...a/org/apache/kylin/dict/Number2BytesConverter.java](https://codecov.io/gh/apache/kylin/pull/152/diff?src=pr&el=tree#diff-Y29yZS1kaWN0aW9uYXJ5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reWxpbi9kaWN0L051bWJlcjJCeXRlc0NvbnZlcnRlci5qYXZh)
| `82.53% <0%> (+0.79%)` | `18% <0%> (+1%)` | :arrow_up: |
   | [...g/apache/kylin/source/datagen/ColumnGenerator.java](https://codecov.io/gh/apache/kylin/pull/152/diff?src=pr&el=tree#diff-Y29yZS1tZXRhZGF0YS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUva3lsaW4vc291cmNlL2RhdGFnZW4vQ29sdW1uR2VuZXJhdG9yLmphdmE=)
| `72.29% <0%> (+1.35%)` | `8% <0%> (ø)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/kylin/pull/152?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/kylin/pull/152?src=pr&el=footer).
Last update [93247fa...d50873b](https://codecov.io/gh/apache/kylin/pull/152?src=pr&el=lastupdated).
Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Inaccurate arithmetic operation in LookupTableToHFileJob#calculateShardNum
> --------------------------------------------------------------------------
>
>                 Key: KYLIN-3398
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3398
>             Project: Kylin
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: jiatao.tao
>            Priority: Major
>
> There're two issues with the following code:
> {code}
>     private int calculateShardNum(KylinConfig kylinConfig, long dataSize) {
>         long shardSize = kylinConfig.getExtTableSnapshotShardingMB() * 1024 * 1024;
>         return dataSize < shardSize ? 1 : (int) (Math.ceil(dataSize / shardSize));
> {code}
> getExtTableSnapshotShardingMB returns an int. The multiplication is done using 32-bit
arithmetic, and then used in a context that expects an expression of type "long".
> Second, Math.ceil expects a double. The integer division would lose some precision.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message