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

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

coveralls commented on issue #152: KYLIN-3398 Fix inaccurate arithmetic 
operations
URL: https://github.com/apache/kylin/pull/152#issuecomment-396025219
 
 
   ## Pull Request Test Coverage Report for [Build 
3215](https://coveralls.io/builds/17411321)
   
   * **0** of **2**   **(0.0%)**  changed or added relevant lines in **1** file 
are covered.
   * **1** unchanged line in **1** file lost coverage.
   * Overall coverage remained the same at **24.172%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | 
[storage-hbase/src/main/java/org/apache/kylin/storage/hbase/lookup/LookupTableToHFileJob.java](https://coveralls.io/builds/17411321/source?filename=storage-hbase%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fkylin%2Fstorage%2Fhbase%2Flookup%2FLookupTableToHFileJob.java#L236)
 | 0 | 2 | 0.0%
   <!-- | **Total:** | **0** | **2** | **0.0%** | -->
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | 
[core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/MemDiskStore.java](https://coveralls.io/builds/17411321/source?filename=core-cube%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fkylin%2Fcube%2Finmemcubing%2FMemDiskStore.java#L553)
 | 1 | 78.12% |
   <!-- | **Total:** | **1** |  | -->
   
   |  Totals | [![Coverage 
Status](https://coveralls.io/builds/17411321/badge)](https://coveralls.io/builds/17411321)
 |
   | :-- | --: |
   | Change from base [Build 3213](https://coveralls.io/builds/17411310): |  
0.0% |
   | Covered Lines: | 14795 |
   | Relevant Lines: | 61207 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   

----------------------------------------------------------------
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:
us...@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)

Reply via email to