qiaojialin commented on a change in pull request #1731:
URL: https://github.com/apache/incubator-iotdb/pull/1731#discussion_r491293164
##########
File path: server/src/main/java/org/apache/iotdb/db/utils/QueryUtils.java
##########
@@ -112,36 +122,16 @@ public static void filterQueryDataSource(QueryDataSource
queryDataSource,
unseqResources.removeIf(fileFilter::fileNotSatisfy);
}
- public static void constructPathAndDataTypes(List<PartialPath> paths,
List<TSDataType> dataTypes,
- List<ShowTimeSeriesResult> timeseriesList) {
- paths.add(new PartialPath(COLUMN_TIMESERIES, false));
- dataTypes.add(TSDataType.TEXT);
- paths.add(new PartialPath(COLUMN_TIMESERIES_ALIAS, false));
- dataTypes.add(TSDataType.TEXT);
- paths.add(new PartialPath(COLUMN_STORAGE_GROUP, false));
- dataTypes.add(TSDataType.TEXT);
- paths.add(new PartialPath(COLUMN_TIMESERIES_DATATYPE, false));
- dataTypes.add(TSDataType.TEXT);
- paths.add(new PartialPath(COLUMN_TIMESERIES_ENCODING, false));
- dataTypes.add(TSDataType.TEXT);
- paths.add(new PartialPath(COLUMN_TIMESERIES_COMPRESSION, false));
- dataTypes.add(TSDataType.TEXT);
-
- Set<String> tagAndAttributeName = new TreeSet<>();
- for (ShowTimeSeriesResult result : timeseriesList) {
- tagAndAttributeName.addAll(result.getTagAndAttribute().keySet());
- }
- for (String key : tagAndAttributeName) {
- paths.add(new PartialPath(key, false));
- dataTypes.add(TSDataType.TEXT);
- }
+ public static void constructPathAndDataTypes(List<PartialPath> paths,
List<TSDataType> dataTypes) {
+ Collections.addAll(paths, resourcePaths);
+ Collections.addAll(dataTypes, resourceTypes);
}
public static QueryDataSet getQueryDataSet(List<ShowTimeSeriesResult>
timeseriesList,
ShowTimeSeriesPlan showTimeSeriesPlan, QueryContext context) {
List<PartialPath> paths = new ArrayList<>();
List<TSDataType> dataTypes = new ArrayList<>();
- constructPathAndDataTypes(paths, dataTypes, timeseriesList);
+ constructPathAndDataTypes(paths, dataTypes);
Review comment:
It seems that the constructPathAndDataTypes is only used for
ShowTimeseries, so moving it to ShowTimeseriesDataSet is ok.
----------------------------------------------------------------
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]