jiangmanhua created CARBONDATA-1801:
---------------------------------------
Summary: Remove unnecessary mdk computation code
Key: CARBONDATA-1801
URL:
https://issues.apache.org/jira/browse/CARBONDATA-1801 Project: CarbonData
Issue Type: Improvement
Reporter: jiangmanhua
Priority: Minor
In `org.apache.carbondata.core.datastore.page.key.TablePageKey#update`, argument `mdk` can be reused to avoid duplicate computation for mdk by replacing `WriteStepRowUtil.getMdk(row, mdkGenerator)`
Original Code:
{code:java}
/** update all keys based on the input row */
public void update(int rowId, CarbonRow row, byte[] mdk) throws KeyGenException {
if (hasNoDictionary) {
currentNoDictionaryKey = WriteStepRowUtil.getNoDictAndComplexDimension(row);
}
if (rowId == 0) {
startKey = WriteStepRowUtil.getMdk(row, mdkGenerator);
noDictStartKey = currentNoDictionaryKey;
}
noDictEndKey = currentNoDictionaryKey;
if (rowId == pageSize - 1) {
endKey = WriteStepRowUtil.getMdk(row, mdkGenerator);
finalizeKeys();
}
}
{code}
https://github.com/apache/carbondata/blob/74226907990cdee41a6ccbd69e2a813077792f89/core/src/main/java/org/apache/carbondata/core/datastore/page/key/TablePageKey.java#L66--
This message was sent by Atlassian JIRA
(v6.4.14#64029)