Github user manishgupta88 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2956#discussion_r236644573
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentPropertiesAndSchemaHolder.java
 ---
    @@ -332,13 +334,42 @@ public void clear() {
           }
           SegmentPropertiesAndSchemaHolder.SegmentPropertiesWrapper other =
               (SegmentPropertiesAndSchemaHolder.SegmentPropertiesWrapper) obj;
    -      return tableIdentifier.equals(other.tableIdentifier) && 
columnsInTable
    -          .equals(other.columnsInTable) && Arrays
    +      return tableIdentifier.equals(other.tableIdentifier) && 
checkColumnSchemaEquality(
    +          columnsInTable, other.columnsInTable) && Arrays
               .equals(columnCardinality, other.columnCardinality);
         }
     
    +    private boolean checkColumnSchemaEquality(List<ColumnSchema> obj1, 
List<ColumnSchema> obj2) {
    +      List<ColumnSchema> clonedObj1 = new ArrayList<>(obj1);
    --- End diff --
    
    You can add the first check for length in the first line of method...if 
length of 2 lists is not same then we can return false from here itself


---

Reply via email to