Skip to content

Commit

Permalink
adapt to last
Browse files Browse the repository at this point in the history
  • Loading branch information
JackieTien97 committed Mar 30, 2020
1 parent 6d06e32 commit a54da14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,22 @@ private void deduplicate(QueryPlan queryPlan) throws MetadataException {
return;
}
RawDataQueryPlan rawDataQueryPlan = (RawDataQueryPlan) queryPlan;

Set<String> columnSet = new HashSet<>();
// if it's a last query, no need to sort by device
if (queryPlan instanceof LastQueryPlan) {
for (int i = 0; i < paths.size(); i++) {
Path path = paths.get(i);
String column = path.toString();
if (!columnSet.contains(column)) {
TSDataType seriesType = dataTypes.get(i);
rawDataQueryPlan.addDeduplicatedPaths(path);
rawDataQueryPlan.addDeduplicatedDataTypes(seriesType);
columnSet.add(column);
}
}
return;
}

int index = 0;
for (Pair<Path, Integer> indexedPath : indexedPaths) {
Path path = indexedPath.left;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@
*/
package org.apache.iotdb.db.service;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.sql.SQLException;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
import org.antlr.v4.runtime.misc.ParseCancellationException;
import org.apache.iotdb.db.auth.AuthException;
import org.apache.iotdb.db.auth.AuthorityChecker;
Expand Down

0 comments on commit a54da14

Please sign in to comment.