kadirozde commented on a change in pull request #1021:
URL: https://github.com/apache/phoenix/pull/1021#discussion_r544789894



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java
##########
@@ -694,16 +695,20 @@ private Void addDataColInfo(final PTable dataTable, 
Expression expression) {
                         output.write(ptr.get(), ptr.getOffset(), 
ptr.getLength());
                     }
                 }
+                indexColToFixedSize.add(indexColumnType.isFixedWidth());

Review comment:
       Lines 698 to 712 can be simplified as follows : (I think there is no 
need to allocate a boolean array here)
   
   int trailingVariableWitdthColumnNum = 0;
   if (!indexColumnType.isFixedWidth()) { 
      output.writeByte(SchemaUtil.getSeparatorByte(rowKeyOrderOptimizable, 
ptr.getLength() == 0, isIndexColumnDesc ? SortOrder.DESC : SortOrder.ASC));
       trailingVariableWitdthColumnNum++;
   else {
       trailingVariableWitdthColumnNum = 0;
   }
   int length = stream.size();
   int minLength = length - maxTrailingNulls;
   byte[] indexRowKey = stream.getBuffer();
   // Remove trailing nulls
   while (trailingVariableWitdthColumnNum > 0 && length > minLength && 
indexRowKey[length-1] == QueryConstants.SEPARATOR_BYTE) {
                   length--;
                   trailingVariableWitdthColumnNum--;
               }




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to