You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/12/28 09:07:14 UTC

[GitHub] [incubator-doris] marising commented on pull request #5061: [Optimize] Latest partition selecting optimize

marising commented on pull request #5061:
URL: https://github.com/apache/incubator-doris/pull/5061#issuecomment-751641592


   The function update the latestTime of the table with the latest partition time, I suggest getVisibleVersionTime() and getVisibleVersion() in the same partition.
   ```    
       private CacheTable getLastUpdateTime(OlapTable olapTable) {
           CacheTable table = new CacheTable();
           table.olapTable = olapTable;
           for (Partition partition : olapTable.getPartitions()) {
               if (partition.getVisibleVersionTime() >= table.latestTime &&
                       partition.getVisibleVersion() > table.latestVersion) {
                   table.latestPartitionId = partition.getId();
                   table.latestTime = partition.getVisibleVersionTime();
                   table.latestVersion = partition.getVisibleVersion();
               }
           }
           return table;
       }
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org