Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
import org.apache.iotdb.db.qp.physical.crud.RawDataQueryPlan;
import org.apache.iotdb.db.query.context.QueryContext;
import org.apache.iotdb.db.query.dataset.groupby.GroupByWithValueFilterDataSet;
import org.apache.iotdb.db.query.filter.TsFileFilter;
import org.apache.iotdb.db.query.reader.series.IReaderByTimestamp;
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.apache.iotdb.tsfile.read.query.timegenerator.TimeGenerator;

import java.util.ArrayList;
Expand Down Expand Up @@ -64,16 +62,12 @@ protected TimeGenerator getTimeGenerator(QueryContext context, RawDataQueryPlan

@Override
protected IReaderByTimestamp getReaderByTime(
PartialPath path,
RawDataQueryPlan dataQueryPlan,
TSDataType dataType,
QueryContext context,
TsFileFilter fileFilter)
PartialPath path, RawDataQueryPlan dataQueryPlan, QueryContext context)
throws StorageEngineException, QueryProcessException {
return readerFactory.getReaderByTimestamp(
path,
dataQueryPlan.getAllMeasurementsInDevice(path.getDevice()),
dataType,
path.getSeriesType(),
context,
dataQueryPlan.isAscending(),
null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
import java.sql.DriverManager;
import java.sql.Statement;

/**
* This class generates data for test cases in aligned time series scenarios.
*
* <p>You can comprehensively view the generated data in the following online doc:
*
* <p>https://docs.google.com/spreadsheets/d/1kfrSR1_paSd9B1Z0jnPBD3WQIMDslDuNm4R0mpWx9Ms/edit?usp=sharing
*/
public class AlignedWriteUtil {

private static final String[] sqls =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.iotdb.db.integration.aligned;

import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.utils.EnvironmentUtils;
import org.apache.iotdb.integration.env.ConfigFactory;
import org.apache.iotdb.integration.env.EnvFactory;
import org.apache.iotdb.itbase.category.LocalStandaloneTest;
import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.experimental.categories.Category;

@Category({LocalStandaloneTest.class})
public class IoTDBGroupByQueryWithValueFilter2IT extends IoTDBGroupByQueryWithValueFilterIT {

private static int numOfPointsPerPage;

@BeforeClass
public static void setUp() throws Exception {
EnvFactory.getEnv().initBeforeClass();
// TODO When the aligned time series support compaction, we need to set compaction to true
enableSeqSpaceCompaction =
IoTDBDescriptor.getInstance().getConfig().isEnableSeqSpaceCompaction();
enableUnseqSpaceCompaction =
IoTDBDescriptor.getInstance().getConfig().isEnableUnseqSpaceCompaction();
enableCrossSpaceCompaction =
IoTDBDescriptor.getInstance().getConfig().isEnableCrossSpaceCompaction();
prevPartitionInterval = IoTDBDescriptor.getInstance().getConfig().getPartitionInterval();
numOfPointsPerPage = TSFileDescriptor.getInstance().getConfig().getMaxNumberOfPointsInPage();
ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
TSFileDescriptor.getInstance().getConfig().setMaxNumberOfPointsInPage(3);
AlignedWriteUtil.insertData();
}

@AfterClass
public static void tearDown() throws Exception {
ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
TSFileDescriptor.getInstance().getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
EnvironmentUtils.cleanEnv();
}
}
Loading