carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackylk <...@git.apache.org>
Subject [GitHub] carbondata pull request #1308: [CARBONDATA-1440]Fix coverity issues
Date Wed, 06 Sep 2017 12:47:49 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1308#discussion_r137256155
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/page/UnsafeFixLengthColumnPage.java
---
    @@ -223,39 +223,39 @@ public BigDecimal getDecimal(int rowId) {
       @Override
       public int[] getIntPage() {
         int[] data = new int[getPageSize()];
    -    for (int i = 0; i < data.length; i++) {
    +    for (long i = 0; i < data.length; i++) {
           long offset = i << intBits;
    -      data[i] = CarbonUnsafe.getUnsafe().getInt(baseAddress, baseOffset + offset);
    +      data[(int)i] = CarbonUnsafe.getUnsafe().getInt(baseAddress, baseOffset + offset);
         }
         return data;
       }
     
       @Override
       public long[] getLongPage() {
         long[] data = new long[getPageSize()];
    -    for (int i = 0; i < data.length; i++) {
    +    for (long i = 0; i < data.length; i++) {
           long offset = i << longBits;
    -      data[i] = CarbonUnsafe.getUnsafe().getLong(baseAddress, baseOffset + offset);
    +      data[(int)i] = CarbonUnsafe.getUnsafe().getLong(baseAddress, baseOffset + offset);
         }
         return data;
       }
     
       @Override
       public float[] getFloatPage() {
         float[] data = new float[getPageSize()];
    -    for (int i = 0; i < data.length; i++) {
    +    for (long i = 0; i < data.length; i++) {
    --- End diff --
    
    why this modification is needed?


---

Mime
View raw message