finalSelect = flagAggregation.qualify(connectorTables.getPredecessor(ConceptCteStep.AGGREGATION_FILTER));
+ ExtractingSqlSelect> finalSelect = flagAggregation.qualify(connectorTables.getPredecessor(ConceptCteStep.AGGREGATION_FILTER));
return ConnectorSqlSelects.builder()
.preprocessingSelects(rootSelects.values())
diff --git a/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/ClickhouseDistinctSelectConverter.java b/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/ClickhouseDistinctSelectConverter.java
new file mode 100644
index 0000000000..2bd0a0adea
--- /dev/null
+++ b/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/ClickhouseDistinctSelectConverter.java
@@ -0,0 +1,67 @@
+package com.bakdata.conquery.sql.conversion.model.select;
+
+import static org.jooq.impl.DSL.field;
+
+import com.bakdata.conquery.models.datasets.concepts.select.connector.DistinctSelect;
+import com.bakdata.conquery.models.datasets.concepts.select.connector.specific.MappableSingleColumnSelect;
+import com.bakdata.conquery.sql.conversion.cqelement.concept.ConceptCteStep;
+import com.bakdata.conquery.sql.conversion.cqelement.concept.ConnectorSqlTables;
+import com.bakdata.conquery.sql.conversion.model.Selects;
+import com.bakdata.conquery.sql.conversion.model.SqlIdColumns;
+
+/**
+ *
+ * The two additional CTEs this aggregator creates:
+ *
+ * -
+ * Select distinct values of a column.
+ * {@code
+ * "distinct" as (
+ * select distinct "pid", "column"
+ * from "event_filter"
+ * )
+ * }
+ *
+ * -
+ * String agg all distinct values of the column.
+ * {@code
+ * "aggregated" as (
+ * select
+ * "select-1-distinct"."pid",
+ * string_agg(cast("column" as varchar), cast(' ' as varchar) ) as "select-1"
+ * from "distinct"
+ * group by "pid"
+ * )
+ * }
+ *
+ *
+ *
+ */
+public class ClickhouseDistinctSelectConverter implements SelectConverter {
+
+
+ @Override
+ public ConnectorSqlSelects connectorSelect(DistinctSelect distinctSelect, SelectContext selectContext) {
+
+ String alias = selectContext.getNameGenerator().selectName(distinctSelect);
+
+ ConnectorSqlTables tables = selectContext.getTables();
+ SingleColumnSqlSelect preprocessingSelect =
+ MappableSingleColumnSelect.getSubstringSelect(distinctSelect.getColumn().get(), distinctSelect.getSubstringRange(), selectContext, alias);
+
+ String eventFilterTable = selectContext.getTables().cteName(ConceptCteStep.EVENT_FILTER);
+ SingleColumnSqlSelect qualified = preprocessingSelect.qualify(eventFilterTable);
+
+ FieldWrapper> grouped = new FieldWrapper<>(field("arrayFilter(x -> x <> '' and x is not null, groupUniqArray({0}))", Object.class, qualified.select()).as(alias), qualified.select().getName());
+
+ SingleColumnSqlSelect finalSelect = grouped.qualify(tables.cteName(ConceptCteStep.AGGREGATION_SELECT));
+
+ return ConnectorSqlSelects.builder()
+ .preprocessingSelect(preprocessingSelect)
+ .aggregationSelect(grouped)
+ .finalSelect(finalSelect)
+ .build();
+ }
+
+
+}
diff --git a/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/DaterangeSelectUtil.java b/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/DaterangeSelectUtil.java
index c8fecc732b..69922694b3 100644
--- a/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/DaterangeSelectUtil.java
+++ b/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/DaterangeSelectUtil.java
@@ -135,8 +135,8 @@ public static FieldWrapper createDurationSumSqlSelect(String alias,
}
private static Condition containsInfinityDate(ColumnDateRange validityDate, SqlFunctionProvider functionProvider) {
- Field negativeInfinity = functionProvider.toDateField(functionProvider.getMinDateExpression());
- Field positiveInfinity = functionProvider.toDateField(functionProvider.getMaxDateExpression());
+ Field negativeInfinity = (functionProvider.getMinDateExpression());
+ Field positiveInfinity = (functionProvider.getMaxDateExpression());
return validityDate.getStart().eq(negativeInfinity).or(validityDate.getEnd().eq(positiveInfinity));
}
diff --git a/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/EventDurationSumSelectConverter.java b/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/EventDurationSumSelectConverter.java
index e7e8bbd88d..7a9b21307b 100644
--- a/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/EventDurationSumSelectConverter.java
+++ b/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/EventDurationSumSelectConverter.java
@@ -60,8 +60,8 @@ private FieldWrapper createEventDurationSumAggregation(EventDuration
}
private static Condition containsInfinityDate(ColumnDateRange validityDate, SqlFunctionProvider functionProvider) {
- Field negativeInfinity = functionProvider.toDateField(functionProvider.getMinDateExpression());
- Field positiveInfinity = functionProvider.toDateField(functionProvider.getMaxDateExpression());
+ Field negativeInfinity = functionProvider.getMinDateExpression();
+ Field positiveInfinity = functionProvider.getMaxDateExpression();
return validityDate.getStart().eq(negativeInfinity).or(validityDate.getEnd().eq(positiveInfinity));
}
diff --git a/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/ValueSelectUtil.java b/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/ValueSelectUtil.java
index fce8fb56be..572958fd25 100644
--- a/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/ValueSelectUtil.java
+++ b/backend/src/main/java/com/bakdata/conquery/sql/conversion/model/select/ValueSelectUtil.java
@@ -60,6 +60,8 @@ private static QueryStep buildRowNumberStep(
SingleColumnSqlSelect rootSelect, Function, ? extends SortField>> ordering, String alias,
SelectContext selectContext) {
+ SqlFunctionProvider functionProvider = selectContext.getFunctionProvider();
+
String predecessor = selectContext.getTables().getPredecessor(ConceptCteStep.AGGREGATION_SELECT);
Field> qualifiedRootSelect = rootSelect.qualify(predecessor).select();
@@ -70,12 +72,12 @@ private static QueryStep buildRowNumberStep(
new FieldWrapper<>(qualifiedRootSelect.as(alias), qualifiedRootSelect.getName()),
rowNumberField(predecessor, selectContext.getValidityDate(), ordering,
selectContext.getIds(),
- selectContext.getFunctionProvider()
+ functionProvider
)
))
.build())
.cteName(ValueSelectCteStep.ROW_NUMBER_STEP.cteName(alias))
- .conditions(List.of(qualifiedRootSelect.isNotNull(), selectContext.getValidityDate().map(ColumnDateRange::isNotEmpty).orElse(noCondition())))
+ .conditions(List.of(qualifiedRootSelect.isNotNull(), selectContext.getValidityDate().map(functionProvider::isNotEmptyDateRange).orElse(noCondition())))
.fromTable(table(name(predecessor)))
.build();
}
diff --git a/backend/src/main/java/com/bakdata/conquery/sql/conversion/query/FormConversionHelper.java b/backend/src/main/java/com/bakdata/conquery/sql/conversion/query/FormConversionHelper.java
index d9977af200..05876ea091 100644
--- a/backend/src/main/java/com/bakdata/conquery/sql/conversion/query/FormConversionHelper.java
+++ b/backend/src/main/java/com/bakdata/conquery/sql/conversion/query/FormConversionHelper.java
@@ -68,7 +68,7 @@ public QueryStep convertPrerequisite(Query query, ConversionContext context) {
Condition dateNotNullCondition;
if (columnDateRange.isPresent()) {
- dateNotNullCondition = columnDateRange.get().isNotNull();
+ dateNotNullCondition = context.getFunctionProvider().isNotEmptyDateRange(columnDateRange.get());
}
else {
dateNotNullCondition = falseCondition();
diff --git a/backend/src/main/java/com/bakdata/conquery/sql/execution/HanaSqlCDateSetParser.java b/backend/src/main/java/com/bakdata/conquery/sql/execution/HanaSqlCDateSetParser.java
index 6f8912b556..81fe66563e 100644
--- a/backend/src/main/java/com/bakdata/conquery/sql/execution/HanaSqlCDateSetParser.java
+++ b/backend/src/main/java/com/bakdata/conquery/sql/execution/HanaSqlCDateSetParser.java
@@ -1,11 +1,11 @@
package com.bakdata.conquery.sql.execution;
-import static com.bakdata.conquery.sql.conversion.dialect.HanaSqlFunctionProvider.DATE_SET_SEPARATOR;
+import static com.bakdata.conquery.sql.conversion.dialect.hana.HanaSqlFunctionProvider.DATE_SET_SEPARATOR;
import java.util.Collections;
import java.util.Set;
-import com.bakdata.conquery.sql.conversion.dialect.HanaSqlFunctionProvider;
+import com.bakdata.conquery.sql.conversion.dialect.hana.HanaSqlFunctionProvider;
import com.bakdata.conquery.util.DateReader;
public class HanaSqlCDateSetParser extends DefaultCDateSetParser {
diff --git a/backend/src/main/java/com/bakdata/conquery/sql/execution/PgSqlCDateSetParser.java b/backend/src/main/java/com/bakdata/conquery/sql/execution/PgSqlCDateSetParser.java
index 253a7db001..4046e4e262 100644
--- a/backend/src/main/java/com/bakdata/conquery/sql/execution/PgSqlCDateSetParser.java
+++ b/backend/src/main/java/com/bakdata/conquery/sql/execution/PgSqlCDateSetParser.java
@@ -3,7 +3,7 @@
import java.util.Collections;
import java.util.Set;
-import com.bakdata.conquery.sql.conversion.dialect.PostgreSqlFunctionProvider;
+import com.bakdata.conquery.sql.conversion.dialect.pg.PostgreSqlFunctionProvider;
import com.bakdata.conquery.util.DateReader;
public class PgSqlCDateSetParser extends DefaultCDateSetParser {
diff --git a/backend/src/test/java/com/bakdata/conquery/integration/IntegrationTests.java b/backend/src/test/java/com/bakdata/conquery/integration/IntegrationTests.java
index fc3773a5c7..8b9fbc2a6e 100644
--- a/backend/src/test/java/com/bakdata/conquery/integration/IntegrationTests.java
+++ b/backend/src/test/java/com/bakdata/conquery/integration/IntegrationTests.java
@@ -17,6 +17,7 @@
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import javax.annotation.CheckForNull;
import com.bakdata.conquery.TestTags;
import com.bakdata.conquery.integration.json.ConqueryTestSpec;
@@ -68,7 +69,7 @@ public class IntegrationTests {
}
@Getter
- public final ConqueryConfig config = new ConqueryConfig();
+ public final ConqueryConfig config = new ConqueryConfig();
private final Map reusedInstances = new HashMap<>();
private final String defaultTestRoot;
private final String defaultTestRootPackage;
@@ -182,25 +183,34 @@ private List collectTestTree(ResourceTree tree, String testRoot, Te
final ResourceTree reduced = tree.reduce();
if (reduced.getChildren().isEmpty()) {
- return Collections.singletonList(collectTests(reduced, testImporter, sqlDialect));
+ return collectTests(reduced, testImporter, sqlDialect)
+ .map(List::of)
+ .orElse(Collections.emptyList());
}
return reduced.getChildren().values().stream()
.map(currentDir -> collectTests(currentDir, testImporter, sqlDialect))
+ .flatMap(Optional::stream)
.collect(Collectors.toList());
}
- private DynamicNode collectTests(ResourceTree currentDir, TestDataImporter testImporter, Dialect sqlDialect) {
+ private Optional collectTests(ResourceTree currentDir, TestDataImporter testImporter, Dialect sqlDialect) {
if (currentDir.getValue() != null) {
Optional dynamicTest = readTest(currentDir.getValue(), currentDir.getName(), testImporter, sqlDialect);
if (dynamicTest.isPresent()) {
- return dynamicTest.get();
+ return Optional.of(dynamicTest.get());
}
}
List list = new ArrayList<>();
for (ResourceTree child : currentDir.getChildren().values()) {
- list.add(collectTests(child, testImporter, sqlDialect));
+ collectTests(child, testImporter, sqlDialect)
+ .ifPresent(list::add);
}
- return toDynamicContainer(currentDir, list);
+
+ if (list.isEmpty()) {
+ return Optional.empty();
+ }
+
+ return Optional.of(toDynamicContainer(currentDir, list));
}
private Optional readTest(Resource resource, String name, TestDataImporter testImporter, Dialect sqlDialect) {
diff --git a/backend/src/test/java/com/bakdata/conquery/integration/sql/CsvTableImporter.java b/backend/src/test/java/com/bakdata/conquery/integration/sql/CsvTableImporter.java
index 7b9af73b18..3c54aed42e 100644
--- a/backend/src/test/java/com/bakdata/conquery/integration/sql/CsvTableImporter.java
+++ b/backend/src/test/java/com/bakdata/conquery/integration/sql/CsvTableImporter.java
@@ -140,7 +140,7 @@ private void dropTable(Table table, Statement statement) {
private void createTable(Table table, List> columns, Statement statement) throws SQLException {
String createTableStatement = testSqlDialect.getTestFunctionProvider().createTableStatement(table, columns, dslContext);
- log.debug("Creating table: {}", createTableStatement);
+ log.info("Creating table: {}", createTableStatement);
statement.execute(createTableStatement);
}
@@ -152,7 +152,7 @@ private Field> createField(RequiredColumn requiredColumn) {
case BOOLEAN -> SQLDataType.BOOLEAN;
// TODO (ja) how do we handle REAL and DECIMAL properly?
case REAL, DECIMAL, MONEY -> SQLDataType.DECIMAL(10, 2);
- case DATE -> SQLDataType.DATE;
+ case DATE -> SQLDataType.DATE.nullable(true);
case DATE_RANGE -> new BuiltInDataType<>(DateRange.class, "daterange");
};
diff --git a/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/ClickhouseSqlIntegrationTests.java b/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/ClickhouseSqlIntegrationTests.java
new file mode 100644
index 0000000000..86abcb6afb
--- /dev/null
+++ b/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/ClickhouseSqlIntegrationTests.java
@@ -0,0 +1,179 @@
+package com.bakdata.conquery.integration.sql.dialect;
+
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+import com.bakdata.conquery.TestTags;
+import com.bakdata.conquery.integration.ConqueryIntegrationTests;
+import com.bakdata.conquery.integration.IntegrationTests;
+import com.bakdata.conquery.integration.json.SqlTestDataImporter;
+import com.bakdata.conquery.integration.json.TestDataImporter;
+import com.bakdata.conquery.integration.sql.CsvTableImporter;
+import com.bakdata.conquery.mode.local.ManagedConnection;
+import com.bakdata.conquery.models.config.DatabaseConnectionConfig;
+import com.bakdata.conquery.models.config.Dialect;
+import com.bakdata.conquery.sql.conversion.dialect.clickhouse.ClickhouseDialectBundle;
+import com.google.common.base.Strings;
+import lombok.Getter;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.jooq.DSLContext;
+import org.jooq.Field;
+import org.jooq.InsertValuesStepN;
+import org.jooq.Record;
+import org.jooq.RowN;
+import org.jooq.Table;
+import org.jooq.conf.ParamType;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.DynamicNode;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.TestFactory;
+import org.testcontainers.clickhouse.ClickHouseContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.utility.DockerImageName;
+
+@Slf4j
+public class ClickhouseSqlIntegrationTests extends IntegrationTests {
+
+ // SAP does not provide more than 1 image and on an update, the earlier image is deleted from dockerhub, thus latest tag is fine
+ private final static DockerImageName IMAGE_TAGE = DockerImageName.parse("clickhouse/clickhouse-server");
+ private static boolean useLocal = true;
+ private static DSLContext dslContext;
+ private static ManagedConnection managedConnection;
+
+ static {
+ final String raw = System.getenv("USE_LOCAL_CH_DB");
+ if (!Strings.isNullOrEmpty(raw)) {
+ useLocal = Boolean.parseBoolean(raw);
+ }
+ }
+
+ public ClickhouseSqlIntegrationTests() {
+ super(ConqueryIntegrationTests.DEFAULT_SQL_TEST_ROOT, "com.bakdata.conquery.integration");
+ }
+
+
+ @SneakyThrows
+ @AfterAll
+ public static void tearDownClass() {
+
+ }
+
+ @BeforeAll
+ static void before() throws Exception {
+ TestContextProvider provider = useLocal
+ ? new ClickhouseTestContainerContextProvider()
+ : new RemoteClickhouseContextProvider();
+
+ log.info("Running Clickhouse tests with {}.", provider.getClass().getSimpleName());
+
+ managedConnection = new ManagedConnection("test", provider.getSqlConnectorConfig(), provider.getDatabaseConfig(), null);
+ managedConnection.start();
+
+ dslContext = managedConnection.connect();
+ }
+
+ @AfterAll
+ static void after() throws Exception {
+ managedConnection.stop();
+ }
+
+ @TestFactory
+ @Tag(TestTags.INTEGRATION_SQL_BACKEND)
+ public Stream sqlBackendTests() {
+
+ DatabaseConnectionConfig databaseConfig = managedConnection.getConnection();
+ TestDialectBundle testHanaDialect = new TestClickhouseDialectBundle();
+ TestDataImporter testDataImporter = new SqlTestDataImporter(new CsvTableImporter(dslContext, testHanaDialect, databaseConfig));
+
+
+ return Stream.concat(
+ super.sqlProgrammaticTests(databaseConfig, managedConnection.getConfig(), testDataImporter),
+ super.sqlQueryTests(databaseConfig, managedConnection.getConfig(), testDataImporter).stream()
+ );
+ }
+
+ public static class TestClickhouseDialectBundle extends ClickhouseDialectBundle implements TestDialectBundle {
+
+ public TestFunctionProvider getTestFunctionProvider() {
+ return new ClickhouseTestFunctionProvider();
+ }
+
+ }
+
+ private static class ClickhouseTestFunctionProvider implements TestFunctionProvider {
+
+ @Override
+ public void insertValuesIntoTable(Table table, List> columns, List content, Statement statement, DSLContext dslContext) {
+
+ List statements = new ArrayList<>();
+ for (RowN rowN : content) {
+ InsertValuesStepN values = dslContext.insertInto(table, columns)
+ .values(rowN);
+ statements.add(values);
+ }
+
+ dslContext.batch(statements)
+ .execute();
+ }
+
+ @Override
+ public String createDropTableStatement(Table table, DSLContext dslContext) {
+ return dslContext.dropTable(table)
+ .getSQL(ParamType.INLINED);
+ }
+
+ }
+
+ @Getter
+ private static class ClickhouseTestContainerContextProvider implements TestContextProvider {
+
+ private final DatabaseConnectionConfig databaseConfig;
+ private final TestSqlConnectorConfig sqlConnectorConfig;
+
+ @Container
+ private final ClickHouseContainer container;
+
+ public ClickhouseTestContainerContextProvider() {
+ this.container = new ClickHouseContainer(IMAGE_TAGE);
+ this.container.start();
+
+ this.databaseConfig = DatabaseConnectionConfig.builder()
+ .dialect(Dialect.CLICKHOUSE)
+ .jdbcConnectionUrl(container.getJdbcUrl())
+ .databaseUsername(container.getUsername())
+ .databasePassword(container.getPassword())
+ .build();
+ this.sqlConnectorConfig = new TestSqlConnectorConfig(databaseConfig);
+ }
+ }
+
+ @Getter
+ private static class RemoteClickhouseContextProvider implements TestContextProvider {
+
+ private final static String PORT = Objects.requireNonNullElse(System.getenv("CONQUERY_SQL_PORT"), "8123");
+ private final static String HOST = System.getenv("CONQUERY_SQL_HOST");
+ private final static String CONNECTION_URL = "jdbc:clickhouse://%s:%s/".formatted(HOST, PORT);
+ private final static String USERNAME = Objects.requireNonNullElse(System.getenv("CONQUERY_SQL_USER"), "default");
+ private final static String PASSWORD = System.getenv("CONQUERY_SQL_PASSWORD");
+
+ private final DatabaseConnectionConfig databaseConfig;
+ private final TestSqlConnectorConfig sqlConnectorConfig;
+
+ public RemoteClickhouseContextProvider() {
+ this.databaseConfig = DatabaseConnectionConfig.builder()
+ .dialect(Dialect.CLICKHOUSE)
+ .jdbcConnectionUrl(CONNECTION_URL)
+ .databaseUsername(USERNAME)
+ .databasePassword(PASSWORD)
+ .build();
+ this.sqlConnectorConfig = new TestSqlConnectorConfig(databaseConfig);
+ }
+
+ }
+
+}
diff --git a/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/HanaSqlIntegrationTests.java b/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/HanaSqlIntegrationTests.java
index 04f52676a7..2ddb45dc1e 100644
--- a/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/HanaSqlIntegrationTests.java
+++ b/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/HanaSqlIntegrationTests.java
@@ -24,7 +24,7 @@
import com.bakdata.conquery.mode.local.ManagedConnection;
import com.bakdata.conquery.models.config.DatabaseConnectionConfig;
import com.bakdata.conquery.models.config.Dialect;
-import com.bakdata.conquery.sql.conversion.dialect.HanaDialectBundle;
+import com.bakdata.conquery.sql.conversion.dialect.hana.HanaDialectBundle;
import com.google.common.base.Strings;
import lombok.Getter;
import lombok.SneakyThrows;
diff --git a/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/PostgreSqlIntegrationTests.java b/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/PostgreSqlIntegrationTests.java
index 0675bd21f7..537a00c3e9 100644
--- a/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/PostgreSqlIntegrationTests.java
+++ b/backend/src/test/java/com/bakdata/conquery/integration/sql/dialect/PostgreSqlIntegrationTests.java
@@ -13,7 +13,7 @@
import com.bakdata.conquery.models.config.Dialect;
import com.bakdata.conquery.models.error.ConqueryError;
import com.bakdata.conquery.models.i18n.I18n;
-import com.bakdata.conquery.sql.conversion.dialect.PostgreDialectBundle;
+import com.bakdata.conquery.sql.conversion.dialect.pg.PostgreDialectBundle;
import com.bakdata.conquery.sql.conversion.model.SqlQuery;
import com.bakdata.conquery.sql.execution.ResultSetProcessor;
import com.bakdata.conquery.sql.execution.SqlExecutionService;
diff --git a/backend/src/test/java/com/bakdata/conquery/integration/tests/SqlSchemaValidationTest.java b/backend/src/test/java/com/bakdata/conquery/integration/tests/SqlSchemaValidationTest.java
index 4606c2a22a..d822f84c29 100644
--- a/backend/src/test/java/com/bakdata/conquery/integration/tests/SqlSchemaValidationTest.java
+++ b/backend/src/test/java/com/bakdata/conquery/integration/tests/SqlSchemaValidationTest.java
@@ -13,6 +13,7 @@
import com.bakdata.conquery.integration.common.RequiredTable;
import com.bakdata.conquery.integration.json.SqlTestDataImporter;
import com.bakdata.conquery.integration.sql.CsvTableImporter;
+import com.bakdata.conquery.models.config.Dialect;
import com.bakdata.conquery.models.datasets.Column;
import com.bakdata.conquery.models.datasets.Table;
import com.bakdata.conquery.models.events.MajorTypeId;
@@ -29,6 +30,7 @@
*/
@Slf4j
public class SqlSchemaValidationTest implements ProgrammaticIntegrationTest {
+
@Override
public Set forModes() {
return Set.of(StandaloneSupport.Mode.SQL);
@@ -39,6 +41,12 @@ public void execute(String name, TestConquery testConquery) throws Exception {
StandaloneSupport support = testConquery.getSupport("dataset");
+ if (support.getConfig().getSqlConnectorConfig().getDatabaseConfigs().values()
+ .stream().allMatch(dbconf -> dbconf.getDialect().equals(Dialect.CLICKHOUSE))) {
+ log.info("Clickhouse validation does not work.");
+ return;
+ }
+
CsvTableImporter importer = ((SqlTestDataImporter) testConquery.getTestDataImporter()).getCsvTableImporter();
String tableName = "test_table";
diff --git a/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json b/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
index 955fa02f2f..539eecd6ea 100644
--- a/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/COUNT_QUARTERS_AGGREGATOR/expected.csv",
@@ -36,7 +37,8 @@
"table": "table",
"validityDates": {
"label": "datum",
- "column": "table.datum"
+ "startColumn": "table.start",
+ "endColumn": "table.ende"
},
"selects": {
"name" : "select",
@@ -62,8 +64,12 @@
"type": "DATE"
},
{
- "name": "datum",
- "type": "DATE_RANGE"
+ "name": "start",
+ "type": "DATE"
+ },
+ {
+ "name": "ende",
+ "type": "DATE"
}
]
}
diff --git a/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_AGGREGATOR/content.csv b/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_AGGREGATOR/content.csv
index 083de65dfc..7e533f9896 100644
--- a/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_AGGREGATOR/content.csv
+++ b/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_AGGREGATOR/content.csv
@@ -1,13 +1,13 @@
-pid,behandlungsdatum,datum
-1,2015-03-16,"2015-01-01/2016-12-31"
-1,2015-03-17,"2015-01-01/2016-12-31"
-2,2015-03-31,"2015-01-01/2016-12-31"
-2,2015-04-01,"2015-01-01/2016-12-31"
-3,2015-02-01,"2015-01-01/2016-12-31"
-3,2015-04-01,"2015-01-01/2016-12-31"
-3,2015-07-01,"2015-01-01/2016-12-31"
-3,2015-11-01,"2015-01-01/2016-12-31"
-4,2015-03-31,"2015-01-01/2016-12-31"
-4,2015-04-01,"2015-01-01/2016-12-31"
-4,2015-07-01,"2015-01-01/2016-12-31"
-5,,"2015-01-01/2016-12-31"
\ No newline at end of file
+pid,behandlungsdatum,start,ende
+1,2015-03-16,"2015-01-01","2016-12-31"
+1,2015-03-17,"2015-01-01","2016-12-31"
+2,2015-03-31,"2015-01-01","2016-12-31"
+2,2015-04-01,"2015-01-01","2016-12-31"
+3,2015-02-01,"2015-01-01","2016-12-31"
+3,2015-04-01,"2015-01-01","2016-12-31"
+3,2015-07-01,"2015-01-01","2016-12-31"
+3,2015-11-01,"2015-01-01","2016-12-31"
+4,2015-03-31,"2015-01-01","2016-12-31"
+4,2015-04-01,"2015-01-01","2016-12-31"
+4,2015-07-01,"2015-01-01","2016-12-31"
+5,,"2015-01-01","2016-12-31"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_RANGE/SIMPLE_VIRTUAL_CONCEPT_Query.test.json b/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_RANGE/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
new file mode 100644
index 0000000000..23b967c1e5
--- /dev/null
+++ b/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_RANGE/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
@@ -0,0 +1,72 @@
+{
+ "type": "QUERY_TEST",
+ "label": "COUNT_QUARTERS_AGGREGATOR Test",
+ "sqlSpec": {
+ "isEnabled": true,
+ "supportedDialects": [
+ "POSTGRESQL"
+ ]
+ },
+ "expectedCsv": "tests/aggregator/COUNT_QUARTERS_RANGE/expected.csv",
+ "query": {
+ "type": "CONCEPT_QUERY",
+ "root": {
+ "ids": [
+ "concept"
+ ],
+ "type": "CONCEPT",
+ "tables": [
+ {
+ "id": "concept.connector",
+ "selects": [
+ "concept.connector.select"
+ ]
+ }
+ ]
+
+ }
+ },
+ "concepts": [
+ {
+ "name": "concept",
+ "type": "TREE",
+ "connectors": [
+ {
+ "label": "connector",
+ "table": "table",
+ "validityDates": {
+ "label": "datum",
+ "column": "table.datum"
+ },
+ "selects": {
+ "name" : "select",
+ "type": "COUNT_QUARTERS",
+ "column": "table.behandlungsdatum"
+ }
+ }
+ ]
+ }
+ ],
+ "content": {
+ "tables": [
+ {
+ "csv": "tests/aggregator/COUNT_QUARTERS_RANGE/content.csv",
+ "name": "table",
+ "primaryColumn": {
+ "name": "pid",
+ "type": "STRING"
+ },
+ "columns": [
+ {
+ "name": "behandlungsdatum",
+ "type": "DATE"
+ },
+ {
+ "name": "datum",
+ "type": "DATE_RANGE"
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_RANGE/content.csv b/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_RANGE/content.csv
new file mode 100644
index 0000000000..083de65dfc
--- /dev/null
+++ b/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_RANGE/content.csv
@@ -0,0 +1,13 @@
+pid,behandlungsdatum,datum
+1,2015-03-16,"2015-01-01/2016-12-31"
+1,2015-03-17,"2015-01-01/2016-12-31"
+2,2015-03-31,"2015-01-01/2016-12-31"
+2,2015-04-01,"2015-01-01/2016-12-31"
+3,2015-02-01,"2015-01-01/2016-12-31"
+3,2015-04-01,"2015-01-01/2016-12-31"
+3,2015-07-01,"2015-01-01/2016-12-31"
+3,2015-11-01,"2015-01-01/2016-12-31"
+4,2015-03-31,"2015-01-01/2016-12-31"
+4,2015-04-01,"2015-01-01/2016-12-31"
+4,2015-07-01,"2015-01-01/2016-12-31"
+5,,"2015-01-01/2016-12-31"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_RANGE/expected.csv b/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_RANGE/expected.csv
new file mode 100644
index 0000000000..dd76afa65c
--- /dev/null
+++ b/backend/src/test/resources/tests/aggregator/COUNT_QUARTERS_RANGE/expected.csv
@@ -0,0 +1,6 @@
+result,dates,concept select
+1,{2015-01-01/2016-12-31},1
+2,{2015-01-01/2016-12-31},2
+3,{2015-01-01/2016-12-31},4
+4,{2015-01-01/2016-12-31},3
+5,{2015-01-01/2016-12-31},
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/DURATION_SUM_AGGREGATOR/DURATION_SUM.test.json b/backend/src/test/resources/tests/aggregator/DURATION_SUM_AGGREGATOR/DURATION_SUM.test.json
index 3a54197372..35ec814fdd 100644
--- a/backend/src/test/resources/tests/aggregator/DURATION_SUM_AGGREGATOR/DURATION_SUM.test.json
+++ b/backend/src/test/resources/tests/aggregator/DURATION_SUM_AGGREGATOR/DURATION_SUM.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/DURATION_SUM_AGGREGATOR/expected.csv",
@@ -35,12 +36,14 @@
"table": "table",
"validityDates": {
"label": "datum",
- "column": "table.datum"
+ "startColumn": "table.start",
+ "endColumn": "table.ende"
},
"selects": {
"type": "DURATION_SUM",
"name": "select",
- "column": "table.datum"
+ "startColumn": "table.start",
+ "endColumn": "table.ende"
}
}
]
@@ -57,8 +60,12 @@
},
"columns": [
{
- "name": "datum",
- "type": "DATE_RANGE"
+ "name": "start",
+ "type": "DATE"
+ },
+ {
+ "name": "ende",
+ "type": "DATE"
}
]
}
diff --git a/backend/src/test/resources/tests/aggregator/DURATION_SUM_AGGREGATOR/content.csv b/backend/src/test/resources/tests/aggregator/DURATION_SUM_AGGREGATOR/content.csv
index 4eb17469e2..cdfeaa7675 100644
--- a/backend/src/test/resources/tests/aggregator/DURATION_SUM_AGGREGATOR/content.csv
+++ b/backend/src/test/resources/tests/aggregator/DURATION_SUM_AGGREGATOR/content.csv
@@ -1,8 +1,8 @@
-pid,datum
-1,"2010-01-01/2010-01-31"
-3,"2013-08-10/2013-08-11"
-4,"2010-06-15/2010-06-20"
-4,"2010-06-16/2010-06-18"
-5,"2011-03-02/2011-03-10"
-5,"2011-03-05/2011-03-13"
-6,"/2011-03-13"
\ No newline at end of file
+pid,start,ende
+1,"2010-01-01","2010-01-31"
+3,"2013-08-10","2013-08-11"
+4,"2010-06-15","2010-06-20"
+4,"2010-06-16","2010-06-18"
+5,"2011-03-02","2011-03-10"
+5,"2011-03-05","2011-03-13"
+6,,"2011-03-13"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/DURATION_SUM_DISTINCT_AGGREGATOR/DURATION_SUM.test.json b/backend/src/test/resources/tests/aggregator/DURATION_SUM_DISTINCT_AGGREGATOR/DURATION_SUM.test.json
index 51b3429c18..c7247a6fc8 100644
--- a/backend/src/test/resources/tests/aggregator/DURATION_SUM_DISTINCT_AGGREGATOR/DURATION_SUM.test.json
+++ b/backend/src/test/resources/tests/aggregator/DURATION_SUM_DISTINCT_AGGREGATOR/DURATION_SUM.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": false,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/DURATION_SUM_DISTINCT_AGGREGATOR/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/EVENT_DATE_AGGREGATOR_NO_RESTRICTION.test.json b/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/EVENT_DATE_AGGREGATOR_NO_RESTRICTION.test.json
index 692fcca436..9bcb107b3c 100644
--- a/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/EVENT_DATE_AGGREGATOR_NO_RESTRICTION.test.json
+++ b/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/EVENT_DATE_AGGREGATOR_NO_RESTRICTION.test.json
@@ -1,10 +1,11 @@
{
"type": "QUERY_TEST",
"label": "EVENT_DATE_AGGREGATOR_NO_RESTRICTION Test",
- "sqlSpec": {
+ "sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/EVENT_DATE_AGGREGATOR/expected_no_restriction.csv",
@@ -18,7 +19,9 @@
"tables": [
{
"id": "concept.connector",
- "selects": "concept.connector.event-date"
+ "selects": [
+ "concept.connector.event-date"
+ ]
}
],
"selects": "concept.event-date"
@@ -34,18 +37,23 @@
"table": "table",
"validityDates": {
"label": "indexdatum",
- "column": "table.indexdatum"
+ "startColumn": "table.start",
+ "endColumn": "table.ende"
},
- "selects": {
- "type": "EVENT_DATE_UNION",
- "name": "event-date"
- }
+ "selects": [
+ {
+ "type": "EVENT_DATE_UNION",
+ "name": "event-date"
+ }
+ ]
}
],
- "selects": {
- "type": "EVENT_DATE_UNION",
- "name": "event-date"
- }
+ "selects": [
+ {
+ "type": "EVENT_DATE_UNION",
+ "name": "event-date"
+ }
+ ]
}
],
"content": {
@@ -59,8 +67,12 @@
},
"columns": [
{
- "name": "indexdatum",
- "type": "DATE_RANGE"
+ "name": "start",
+ "type": "DATE"
+ },
+ {
+ "name": "ende",
+ "type": "DATE"
},
{
"name": "geburtsdatum",
diff --git a/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/EVENT_DATE_AGGREGATOR_RESTRICTION.test.json b/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/EVENT_DATE_AGGREGATOR_RESTRICTION.test.json
index e420c4fc6b..3f36d2ee76 100644
--- a/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/EVENT_DATE_AGGREGATOR_RESTRICTION.test.json
+++ b/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/EVENT_DATE_AGGREGATOR_RESTRICTION.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/EVENT_DATE_AGGREGATOR/expected_restriction.csv",
@@ -37,11 +38,12 @@
"type": "TREE",
"connectors": [
{
- "label": "connector",
+ "name": "connector",
"table": "table",
"validityDates": {
- "label": "indexdatum",
- "column": "table.indexdatum"
+ "name": "indexdatum",
+ "startColumn": "table.start",
+ "endColumn": "table.ende"
},
"selects": {
"type": "EVENT_DATE_UNION",
@@ -66,8 +68,12 @@
},
"columns": [
{
- "name": "indexdatum",
- "type": "DATE_RANGE"
+ "name": "start",
+ "type": "DATE"
+ },
+ {
+ "name": "ende",
+ "type": "DATE"
},
{
"name": "geburtsdatum",
diff --git a/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/content.csv b/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/content.csv
index ddfdc58317..1006a5430b 100644
--- a/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/content.csv
+++ b/backend/src/test/resources/tests/aggregator/EVENT_DATE_AGGREGATOR/content.csv
@@ -1,11 +1,11 @@
-pid,indexdatum,geburtsdatum
-1,"2010-01-01/2010-03-31",2010-01-31
-2,"2010-01-01/2010-03-31",1998-01-01
-3,"2010-01-01/2010-03-31",1997-12-31
-4,"2010-01-01/2010-03-31",
-5,"2010-01-01/2010-03-31",2011-01-01
-6,"2010-01-01/2010-03-31",1998-03-01
-7,"2010-01-01/2010-03-31",2010-01-31
-8,"2010-01-01/2010-03-31",1998-03-01
-9,"2010-01-01/2010-03-31",1998-04-01
-10,"2010-01-01/2010-03-31",2012-01-01
\ No newline at end of file
+pid,start,ende,geburtsdatum
+1,"2010-01-01","2010-03-31",2010-01-31
+2,"2010-01-01","2010-03-31",1998-01-01
+3,"2010-01-01","2010-03-31",1997-12-31
+4,"2010-01-01","2010-03-31",
+5,"2010-01-01","2010-03-31",2011-01-01
+6,"2010-01-01","2010-03-31",1998-03-01
+7,"2010-01-01","2010-03-31",2010-01-31
+8,"2010-01-01","2010-03-31",1998-03-01
+9,"2010-01-01","2010-03-31",1998-04-01
+10,"2010-01-01","2010-03-31",2012-01-01
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR/NUMBER.test.json b/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR/NUMBER.test.json
index 85e69af173..be5d99f1f5 100644
--- a/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR/NUMBER.test.json
+++ b/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR/NUMBER.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/EXISTS_AGGREGATOR/expected.csv",
@@ -47,7 +48,8 @@
"table": "table",
"validityDates": {
"label": "datum",
- "column": "table.datum"
+ "startColumn": "table.start",
+ "endColumn": "table.ende"
},
"filters": {
"label": "filter",
@@ -73,8 +75,12 @@
"type": "REAL"
},
{
- "name": "datum",
- "type": "DATE_RANGE"
+ "name": "start",
+ "type": "DATE"
+ },
+ {
+ "name": "ende",
+ "type": "DATE"
}
]
}
diff --git a/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR/content.csv b/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR/content.csv
index 24556a3454..1babf7262e 100644
--- a/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR/content.csv
+++ b/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR/content.csv
@@ -1,8 +1,8 @@
-pid,value,datum
-1,1,"2014-06-30/2015-06-30"
-2,1,"2014-06-30/2015-06-30"
-2,2,"2014-06-30/2015-06-30"
-3,3,"2014-06-30/2015-06-30"
-4,,"2014-06-30/2015-06-30"
-5,1,"2014-06-30/2015-06-30"
-5,,"2014-06-30/2015-06-30"
+pid,value,start,ende
+1,1,"2014-06-30","2015-06-30"
+2,1,"2014-06-30","2015-06-30"
+2,2,"2014-06-30","2015-06-30"
+3,3,"2014-06-30","2015-06-30"
+4,,"2014-06-30","2015-06-30"
+5,1,"2014-06-30","2015-06-30"
+5,,"2014-06-30","2015-06-30"
diff --git a/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_OR/NUMBER.test.json b/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_OR/NUMBER.test.json
index 28c87d6bf5..47657c0410 100644
--- a/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_OR/NUMBER.test.json
+++ b/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_OR/NUMBER.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/EXISTS_AGGREGATOR_OR/expected.csv",
@@ -74,7 +75,8 @@
"table": "table",
"validityDates": {
"label": "datum",
- "column": "table.datum"
+ "startColumn": "table.start",
+ "endColumn": "table.ende"
},
"filters": {
"label": "value",
@@ -101,8 +103,12 @@
"type": "REAL"
},
{
- "name": "datum",
- "type": "DATE_RANGE"
+ "name": "start",
+ "type": "DATE"
+ },
+ {
+ "name": "ende",
+ "type": "DATE"
}
]
}
diff --git a/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_OR/content.csv b/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_OR/content.csv
index 24556a3454..1babf7262e 100644
--- a/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_OR/content.csv
+++ b/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_OR/content.csv
@@ -1,8 +1,8 @@
-pid,value,datum
-1,1,"2014-06-30/2015-06-30"
-2,1,"2014-06-30/2015-06-30"
-2,2,"2014-06-30/2015-06-30"
-3,3,"2014-06-30/2015-06-30"
-4,,"2014-06-30/2015-06-30"
-5,1,"2014-06-30/2015-06-30"
-5,,"2014-06-30/2015-06-30"
+pid,value,start,ende
+1,1,"2014-06-30","2015-06-30"
+2,1,"2014-06-30","2015-06-30"
+2,2,"2014-06-30","2015-06-30"
+3,3,"2014-06-30","2015-06-30"
+4,,"2014-06-30","2015-06-30"
+5,1,"2014-06-30","2015-06-30"
+5,,"2014-06-30","2015-06-30"
diff --git a/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json b/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
index fba3354bf6..236b8c26d4 100644
--- a/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/FIRST_AGGREGATOR/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/content.csv b/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/content.csv
index c1de39e465..76dcc14bb1 100644
--- a/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/content.csv
+++ b/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/content.csv
@@ -8,4 +8,3 @@ pid,datum,value
5,2012-01-01,"m"
5,,"f"
6,2012-01-01,"m"
-6,2012-01-01,"f"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/FLAGS_AGGREGATOR/FLAGS_AGGREGATOR.test.json b/backend/src/test/resources/tests/aggregator/FLAGS_AGGREGATOR/FLAGS_AGGREGATOR.test.json
index 02364f081b..6834d251ff 100644
--- a/backend/src/test/resources/tests/aggregator/FLAGS_AGGREGATOR/FLAGS_AGGREGATOR.test.json
+++ b/backend/src/test/resources/tests/aggregator/FLAGS_AGGREGATOR/FLAGS_AGGREGATOR.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/FLAGS_AGGREGATOR/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json b/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
index c08a548044..442b52fc33 100644
--- a/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/LAST_AGGREGATOR/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/content.csv b/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/content.csv
index bb1adca9de..3a33a7f81f 100644
--- a/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/content.csv
+++ b/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/content.csv
@@ -9,5 +9,3 @@ pid,datum,value
4,,"f"
5,2012-01-01,"m"
5,,"f"
-6,2012-01-01,"m"
-6,2012-01-01,"f"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/expected.csv
index 018d2a35a4..440b512dcd 100644
--- a/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/expected.csv
+++ b/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/expected.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},f
5,{2012-01-01/2012-01-01},m
-6,{2012-01-01/2012-01-01},m
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT/SIMPLE_VIRTUAL_CONCEPT_Query.test.json b/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
index ecc5110997..17064c082c 100644
--- a/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/MAPPED/DISTINCT/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT/expected.csv b/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT/expected.csv
index c8cd2026db..b328490919 100644
--- a/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT/expected.csv
+++ b/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT/expected.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},{hello}
5,{2012-01-01/2012-01-01},{int2}
-6,{2012-01-01/2012-01-01},"{int2,hello}"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT_MULTI/SIMPLE_VIRTUAL_CONCEPT_Query.test.json b/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT_MULTI/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
index 19bcea3b42..a1b4909aed 100644
--- a/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT_MULTI/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT_MULTI/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/MAPPED/DISTINCT_MULTI/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT_MULTI/expected.csv b/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT_MULTI/expected.csv
index 85c148ff89..0b2f2987c2 100644
--- a/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT_MULTI/expected.csv
+++ b/backend/src/test/resources/tests/aggregator/MAPPED/DISTINCT_MULTI/expected.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},"{goodbye,hello}"
5,{2012-01-01/2012-01-01},{int2}
-6,{2012-01-01/2012-01-01},"{int2,goodbye,hello}"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/MAPPED/FIRST/SIMPLE_VIRTUAL_CONCEPT_Query.test.json b/backend/src/test/resources/tests/aggregator/MAPPED/FIRST/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
index 86ed03ad78..2ef50af243 100644
--- a/backend/src/test/resources/tests/aggregator/MAPPED/FIRST/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/aggregator/MAPPED/FIRST/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/MAPPED/FIRST/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/MAPPED/FIRST/expected.csv b/backend/src/test/resources/tests/aggregator/MAPPED/FIRST/expected.csv
index a391f52733..f7eba07a90 100644
--- a/backend/src/test/resources/tests/aggregator/MAPPED/FIRST/expected.csv
+++ b/backend/src/test/resources/tests/aggregator/MAPPED/FIRST/expected.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},External: hello world
5,{2012-01-01/2012-01-01},External: ext2
-6,{2012-01-01/2012-01-01},External: ext2
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/MAPPED/FIRST_MULTI/SIMPLE_VIRTUAL_CONCEPT_Query.test.json b/backend/src/test/resources/tests/aggregator/MAPPED/FIRST_MULTI/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
index 9ef8481673..bfbfcb8165 100644
--- a/backend/src/test/resources/tests/aggregator/MAPPED/FIRST_MULTI/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/aggregator/MAPPED/FIRST_MULTI/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/MAPPED/FIRST_MULTI/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/MAPPED/FIRST_MULTI/expected.csv b/backend/src/test/resources/tests/aggregator/MAPPED/FIRST_MULTI/expected.csv
index e7b1b0541d..8fb8073097 100644
--- a/backend/src/test/resources/tests/aggregator/MAPPED/FIRST_MULTI/expected.csv
+++ b/backend/src/test/resources/tests/aggregator/MAPPED/FIRST_MULTI/expected.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},"{External: hello world,External: goodbye moon}"
5,{2012-01-01/2012-01-01},{External: ext2}
-6,{2012-01-01/2012-01-01},{External: ext2}
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/MAPPED/content.csv b/backend/src/test/resources/tests/aggregator/MAPPED/content.csv
index 7c4c553b55..cd9314b52a 100644
--- a/backend/src/test/resources/tests/aggregator/MAPPED/content.csv
+++ b/backend/src/test/resources/tests/aggregator/MAPPED/content.csv
@@ -9,5 +9,3 @@ pid,datum,value
4,,int1
5,2012-01-01,int2
5,,int1
-6,2012-01-01,int2
-6,2012-01-01,int1
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/QUARTER_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json b/backend/src/test/resources/tests/aggregator/QUARTER_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
index e1b97554f2..9e45f8c522 100644
--- a/backend/src/test/resources/tests/aggregator/QUARTER_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/aggregator/QUARTER_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": false,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/QUARTER_AGGREGATOR/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json b/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
index f7472b1d89..ea7977786f 100644
--- a/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/SIMPLE_VIRTUAL_CONCEPT_Query.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/RANDOM_AGGREGATOR/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/content.csv b/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/content.csv
index 6d99b9f9e5..0566d5ffd9 100644
--- a/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/content.csv
+++ b/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/content.csv
@@ -5,4 +5,3 @@ pid,datum,value
5,2012-01-01,"m"
5,,"f"
6,2012-01-01,"m"
-6,2012-01-01,"f"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/MAPPED.test.json b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/MAPPED.test.json
index 2bc93f414f..d15c8fd121 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/MAPPED.test.json
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/MAPPED.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/SUBSTRING/DISTINCT/expected-mapped.csv",
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/SIMPLE.test.json b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/SIMPLE.test.json
index 88a8bcf908..72a32bc888 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/SIMPLE.test.json
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/SIMPLE.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/SUBSTRING/DISTINCT/expected-simple.csv",
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/expected-mapped.csv b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/expected-mapped.csv
index 9716ddef9d..167f4b7492 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/expected-mapped.csv
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/expected-mapped.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},
5,{2012-01-01/2012-01-01},{in}
-6,{2012-01-01/2012-01-01},"{hello,t2}"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/expected-simple.csv b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/expected-simple.csv
index e4f3864d9e..0a4e5f3af1 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/expected-simple.csv
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT/expected-simple.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},
5,{2012-01-01/2012-01-01},{in}
-6,{2012-01-01/2012-01-01},"{t1,t2}"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT_MULTI/MAPPED.test.json b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT_MULTI/MAPPED.test.json
index e04a99cee2..92f9332bbe 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT_MULTI/MAPPED.test.json
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT_MULTI/MAPPED.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/SUBSTRING/DISTINCT_MULTI/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT_MULTI/expected.csv b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT_MULTI/expected.csv
index 23b2e9a8a6..e1a75a04f2 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT_MULTI/expected.csv
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/DISTINCT_MULTI/expected.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},
5,{2012-01-01/2012-01-01},{in}
-6,{2012-01-01/2012-01-01},"{goodbye,hello,t2}"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/MAPPED.test.json b/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/MAPPED.test.json
index bd867a63b0..f9ea853755 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/MAPPED.test.json
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/MAPPED.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/SUBSTRING/FIRST/expected-mapped.csv",
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/SIMPLE.test.json b/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/SIMPLE.test.json
index a1f6e3452f..be542f9b10 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/SIMPLE.test.json
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/SIMPLE.test.json
@@ -4,7 +4,8 @@
"sqlSpec": {
"isEnabled": true,
"supportedDialects": [
- "POSTGRESQL"
+ "POSTGRESQL",
+ "CLICKHOUSE"
]
},
"expectedCsv": "tests/aggregator/SUBSTRING/FIRST/expected.csv",
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected-mapped.csv b/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected-mapped.csv
index bc061d9ce0..e8e2e3e547 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected-mapped.csv
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected-mapped.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},
5,{2012-01-01/2012-01-01},in
-6,{2012-01-01/2012-01-01},External: ext2
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected-multi.csv b/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected-multi.csv
index 31a9728df9..58b6047f9e 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected-multi.csv
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected-multi.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},{}
5,{2012-01-01/2012-01-01},{in}
-6,{2012-01-01/2012-01-01},{t2}
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected.csv b/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected.csv
index f3004ccea8..612667a777 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected.csv
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/FIRST/expected.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},
5,{2012-01-01/2012-01-01},in
-6,{2012-01-01/2012-01-01},t2
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/aggregator/SUBSTRING/content.csv b/backend/src/test/resources/tests/aggregator/SUBSTRING/content.csv
index d5cbb1b238..f72b94d6b3 100644
--- a/backend/src/test/resources/tests/aggregator/SUBSTRING/content.csv
+++ b/backend/src/test/resources/tests/aggregator/SUBSTRING/content.csv
@@ -9,5 +9,3 @@ pid,datum,value
4,,int1
5,2012-01-01,__int2
5,,int1__
-6,2012-01-01,int2
-6,2012-01-01,int1
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/filter/COUNT_QUARTERS/COUNT_QUARTERS.test.json b/backend/src/test/resources/tests/filter/COUNT_QUARTERS/COUNT_QUARTERS.test.json
index 3a4589ec32..a66b6de389 100644
--- a/backend/src/test/resources/tests/filter/COUNT_QUARTERS/COUNT_QUARTERS.test.json
+++ b/backend/src/test/resources/tests/filter/COUNT_QUARTERS/COUNT_QUARTERS.test.json
@@ -1,10 +1,10 @@
{
"type": "FILTER_TEST",
"label": "COUNT_QUARTERS Test",
- "expectedCsv": "tests/filter/COUNT_QUARTERS/expected_COUNT_QUARTERS_Filter.csv",
+ "expectedCsv": "tests/filter/COUNT_QUARTERS/expected.csv",
"content": {
"tables": {
- "csv": "tests/filter/COUNT_QUARTERS/content_COUNT_QUARTERS_Filter.csv",
+ "csv": "tests/filter/COUNT_QUARTERS/content.csv",
"primaryColumn": {
"name": "pid",
"type": "STRING"
diff --git a/backend/src/test/resources/tests/filter/COUNT_QUARTERS/content_COUNT_QUARTERS_Filter.csv b/backend/src/test/resources/tests/filter/COUNT_QUARTERS/content.csv
similarity index 100%
rename from backend/src/test/resources/tests/filter/COUNT_QUARTERS/content_COUNT_QUARTERS_Filter.csv
rename to backend/src/test/resources/tests/filter/COUNT_QUARTERS/content.csv
diff --git a/backend/src/test/resources/tests/filter/COUNT_QUARTERS/expected_COUNT_QUARTERS_Filter.csv b/backend/src/test/resources/tests/filter/COUNT_QUARTERS/expected.csv
similarity index 100%
rename from backend/src/test/resources/tests/filter/COUNT_QUARTERS/expected_COUNT_QUARTERS_Filter.csv
rename to backend/src/test/resources/tests/filter/COUNT_QUARTERS/expected.csv
diff --git a/backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/COUNT_QUARTERS.test.json b/backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/COUNT_QUARTERS.test.json
index 570455eaea..36f5f640f7 100644
--- a/backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/COUNT_QUARTERS.test.json
+++ b/backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/COUNT_QUARTERS.test.json
@@ -7,10 +7,10 @@
"POSTGRESQL"
]
},
- "expectedCsv": "tests/filter/COUNT_QUARTERS_RANGE/expected_COUNT_QUARTERS_Filter.csv",
+ "expectedCsv": "tests/filter/COUNT_QUARTERS_RANGE/expected.csv",
"content": {
"tables": {
- "csv": "tests/filter/COUNT_QUARTERS_RANGE/content_COUNT_QUARTERS_Filter.csv",
+ "csv": "tests/filter/COUNT_QUARTERS_RANGE/content.csv",
"primaryColumn": {
"name": "pid",
"type": "STRING"
diff --git a/backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/content_COUNT_QUARTERS_Filter.csv b/backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/content.csv
similarity index 100%
rename from backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/content_COUNT_QUARTERS_Filter.csv
rename to backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/content.csv
diff --git a/backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/expected_COUNT_QUARTERS_Filter.csv b/backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/expected.csv
similarity index 100%
rename from backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/expected_COUNT_QUARTERS_Filter.csv
rename to backend/src/test/resources/tests/filter/COUNT_QUARTERS_RANGE/expected.csv
diff --git a/backend/src/test/resources/tests/query/ABS_EXPORT/ABS_EXPORT_Query.test.json b/backend/src/test/resources/tests/query/ABS_EXPORT/ABS_EXPORT_Query.test.json
index 9646f65b66..4a35ead38e 100644
--- a/backend/src/test/resources/tests/query/ABS_EXPORT/ABS_EXPORT_Query.test.json
+++ b/backend/src/test/resources/tests/query/ABS_EXPORT/ABS_EXPORT_Query.test.json
@@ -2,6 +2,14 @@
"type": "QUERY_TEST",
"label": "ABS_EXPORT Test",
"expectedCsv": "tests/query/ABS_EXPORT/expected.csv",
+ "sqlSpec": {
+ "isEnabled": true,
+ "comment": "Clickhouse does not have Lateral joins at the moment. But fix is hopefully coming.",
+ "supportedDialects": [
+ "POSTGRESQL",
+ "HANA"
+ ]
+ },
"query": {
"type": "ABSOLUTE_FORM_QUERY",
"dateRange": {
diff --git a/backend/src/test/resources/tests/query/LOGICAL/NEGATION_LOGICAL/SIMPLE_TREECONCEPT_Query.test.json b/backend/src/test/resources/tests/query/LOGICAL/NEGATION_LOGICAL/SIMPLE_TREECONCEPT_Query.test.json
index 330015c9b1..687ec4efd9 100644
--- a/backend/src/test/resources/tests/query/LOGICAL/NEGATION_LOGICAL/SIMPLE_TREECONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/query/LOGICAL/NEGATION_LOGICAL/SIMPLE_TREECONCEPT_Query.test.json
@@ -2,6 +2,14 @@
"type": "QUERY_TEST",
"label": "AND NEGATION DATE LOGIC Test",
"expectedCsv": "tests/query/LOGICAL/NEGATION_LOGICAL/expected.csv",
+ "sqlSpec": {
+ "isEnabled": true,
+ "comment": "Logical will hopefully be kicked.",
+ "supportedDialects": [
+ "POSTGRESQL",
+ "HANA"
+ ]
+ },
"query": {
"type": "CONCEPT_QUERY",
"dateAggregationMode": "LOGICAL",
diff --git a/backend/src/test/resources/tests/query/LOGICAL/OR/SIMPLE_TREECONCEPT_Query.test.json b/backend/src/test/resources/tests/query/LOGICAL/OR/SIMPLE_TREECONCEPT_Query.test.json
index baf0352180..e306d957c6 100644
--- a/backend/src/test/resources/tests/query/LOGICAL/OR/SIMPLE_TREECONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/query/LOGICAL/OR/SIMPLE_TREECONCEPT_Query.test.json
@@ -2,6 +2,14 @@
"type": "QUERY_TEST",
"label": "OR Test",
"expectedCsv": "tests/query/LOGICAL/OR/expected.csv",
+ "sqlSpec": {
+ "isEnabled": true,
+ "comment": "Logical will hopefully be kicked.",
+ "supportedDialects": [
+ "POSTGRESQL",
+ "HANA"
+ ]
+ },
"query": {
"type": "CONCEPT_QUERY",
"root": {
diff --git a/backend/src/test/resources/tests/query/LOGICAL/OR_AND/SIMPLE_TREECONCEPT_Query.test.json b/backend/src/test/resources/tests/query/LOGICAL/OR_AND/SIMPLE_TREECONCEPT_Query.test.json
index 3ec600da44..e20dcbb384 100644
--- a/backend/src/test/resources/tests/query/LOGICAL/OR_AND/SIMPLE_TREECONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/query/LOGICAL/OR_AND/SIMPLE_TREECONCEPT_Query.test.json
@@ -2,6 +2,14 @@
"type": "QUERY_TEST",
"label": "OR_AND Select test",
"expectedCsv": "tests/query/LOGICAL/OR_AND/expected.csv",
+ "sqlSpec": {
+ "isEnabled": true,
+ "comment": "Logical will hopefully be kicked.",
+ "supportedDialects": [
+ "POSTGRESQL",
+ "HANA"
+ ]
+ },
"query": {
"type": "CONCEPT_QUERY",
"root": {
diff --git a/backend/src/test/resources/tests/query/LOGICAL/OR_DATE_LOGICAL/SIMPLE_TREECONCEPT_Query.test.json b/backend/src/test/resources/tests/query/LOGICAL/OR_DATE_LOGICAL/SIMPLE_TREECONCEPT_Query.test.json
index c4c151df1c..e17fa70e18 100644
--- a/backend/src/test/resources/tests/query/LOGICAL/OR_DATE_LOGICAL/SIMPLE_TREECONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/query/LOGICAL/OR_DATE_LOGICAL/SIMPLE_TREECONCEPT_Query.test.json
@@ -2,6 +2,14 @@
"type": "QUERY_TEST",
"label": "OR DATE LOGIC Test",
"expectedCsv": "tests/query/LOGICAL/OR_DATE_LOGICAL/expected.csv",
+ "sqlSpec": {
+ "isEnabled": true,
+ "comment": "Logical will hopefully be kicked.",
+ "supportedDialects": [
+ "POSTGRESQL",
+ "HANA"
+ ]
+ },
"query": {
"type": "CONCEPT_QUERY",
"dateAggregationMode" : "LOGICAL",
diff --git a/backend/src/test/resources/tests/query/MERGE/OR_EVENT_DATE_EXCLUDED/SIMPLE_TREECONCEPT_Query.test.json b/backend/src/test/resources/tests/query/MERGE/OR_EVENT_DATE_EXCLUDED/SIMPLE_TREECONCEPT_Query.test.json
index 4e62f1935c..fcd5a10ae0 100644
--- a/backend/src/test/resources/tests/query/MERGE/OR_EVENT_DATE_EXCLUDED/SIMPLE_TREECONCEPT_Query.test.json
+++ b/backend/src/test/resources/tests/query/MERGE/OR_EVENT_DATE_EXCLUDED/SIMPLE_TREECONCEPT_Query.test.json
@@ -4,13 +4,13 @@
"expectedCsv": "tests/query/MERGE/OR_EVENT_DATE_EXCLUDED/expected.csv",
"query": {
"type": "CONCEPT_QUERY",
- "dateAggregationMode" : "MERGE",
+ "dateAggregationMode": "MERGE",
"root": {
"type": "OR",
"children": [
{
"type": "CONCEPT",
- "excludeFromTimeAggregation" : true,
+ "excludeFromTimeAggregation": true,
"ids": [
"tree.a"
],
@@ -44,9 +44,9 @@
"connectors": {
"name": "connector",
"column": "table.column",
- "selects" : {
- "type" : "EVENT_DATE_UNION",
- "name" : "date_union"
+ "selects": {
+ "type": "EVENT_DATE_UNION",
+ "name": "date_union"
},
"validityDates": {
"name": "datum",
@@ -57,16 +57,16 @@
{
"name": "a",
"condition": {
- "type": "PREFIX_LIST",
- "prefixes": "A"
+ "type": "EQUAL",
+ "values": "A"
},
"children": []
},
{
"name": "b",
"condition": {
- "type": "PREFIX_LIST",
- "prefixes": "B"
+ "type": "EQUAL",
+ "values": "B"
},
"children": []
}
diff --git a/backend/src/test/resources/tests/query/MULTI_SELECT_NEGATION_DATE_RESTRICTION_OR_CONCEPT_QUERY2/MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY.test.json b/backend/src/test/resources/tests/query/MULTI_SELECT_NEGATION_DATE_RESTRICTION_OR_CONCEPT_QUERY2/MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY.test.json
index 1fabb7fd07..f0dbfd0f5f 100644
--- a/backend/src/test/resources/tests/query/MULTI_SELECT_NEGATION_DATE_RESTRICTION_OR_CONCEPT_QUERY2/MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY.test.json
+++ b/backend/src/test/resources/tests/query/MULTI_SELECT_NEGATION_DATE_RESTRICTION_OR_CONCEPT_QUERY2/MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY.test.json
@@ -13,24 +13,19 @@
"max": "2012-11-11"
},
"child": {
- "type": "OR",
- "children": [
+ "ids": [
+ "geschlecht_select"
+ ],
+ "type": "CONCEPT",
+ "tables": [
{
- "ids": [
- "geschlecht_select"
- ],
- "type": "CONCEPT",
- "tables": [
+ "id": "geschlecht_select.geschlecht_connector",
+ "filters": [
{
- "id": "geschlecht_select.geschlecht_connector",
- "filters": [
- {
- "filter": "geschlecht_select.geschlecht_connector.geschlecht",
- "type": "MULTI_SELECT",
- "value": [
- "f"
- ]
- }
+ "filter": "geschlecht_select.geschlecht_connector.geschlecht",
+ "type": "MULTI_SELECT",
+ "value": [
+ "f"
]
}
]
diff --git a/backend/src/test/resources/tests/query/REL_EXPORT/PREREQUISITE_WITH_DATES/REL_EXPORT_Query.test.json b/backend/src/test/resources/tests/query/REL_EXPORT/PREREQUISITE_WITH_DATES/REL_EXPORT_Query.test.json
index e6893f6ab8..6ef36b7970 100644
--- a/backend/src/test/resources/tests/query/REL_EXPORT/PREREQUISITE_WITH_DATES/REL_EXPORT_Query.test.json
+++ b/backend/src/test/resources/tests/query/REL_EXPORT/PREREQUISITE_WITH_DATES/REL_EXPORT_Query.test.json
@@ -1,122 +1,130 @@
{
- "type": "QUERY_TEST",
- "label": "REL_EXPORT WITH DATES Test",
- "expectedCsv": "tests/query/REL_EXPORT/PREREQUISITE_WITH_DATES/expected.csv",
+ "type": "QUERY_TEST",
+ "label": "REL_EXPORT WITH DATES Test",
+ "sqlSpec": {
+ "isEnabled": true,
+ "comment": "Lateral JOINS are not possible with Clickhouse yet.",
+ "supportedDialects": [
+ "POSTGRESQL",
+ "HANA"
+ ]
+ },
+ "expectedCsv": "tests/query/REL_EXPORT/PREREQUISITE_WITH_DATES/expected.csv",
+ "query": {
+ "type": "RELATIVE_FORM_QUERY",
+ "resolutionsAndAlignmentMap": [
+ {
+ "resolution": "COMPLETE",
+ "alignment": "NO_ALIGN"
+ },
+ {
+ "resolution": "QUARTERS",
+ "alignment": "QUARTER"
+ }
+ ],
"query": {
- "type": "RELATIVE_FORM_QUERY",
- "resolutionsAndAlignmentMap": [
- {
- "resolution": "COMPLETE",
- "alignment": "NO_ALIGN"
- },
- {
- "resolution": "QUARTERS",
- "alignment": "QUARTER"
- }
+ "type": "CONCEPT_QUERY",
+ "root": {
+ "type": "CONCEPT",
+ "ids": [
+ "test_tree.test_child1"
],
- "query": {
- "type": "CONCEPT_QUERY",
- "root": {
- "type": "CONCEPT",
- "ids": [
- "test_tree.test_child1"
- ],
- "tables": [
- {
- "id": "test_tree.test_column",
- "filters": []
- }
- ]
- }
- },
- "features": {
- "type": "ARRAY_CONCEPT_QUERY",
- "childQueries": {
- "type": "CONCEPT_QUERY",
- "root": {
- "type": "CONCEPT",
- "ids": [
- "test_tree.test_child1"
- ],
- "selects": [
- "test_tree.exists"
- ],
- "tables": [
- {
- "id": "test_tree.test_column",
- "filters": []
- }
- ]
- }
+ "tables": [
+ {
+ "id": "test_tree.test_column",
+ "filters": []
+ }
+ ]
+ }
+ },
+ "features": {
+ "type": "ARRAY_CONCEPT_QUERY",
+ "childQueries": {
+ "type": "CONCEPT_QUERY",
+ "root": {
+ "type": "CONCEPT",
+ "ids": [
+ "test_tree.test_child1"
+ ],
+ "selects": [
+ "test_tree.exists"
+ ],
+ "tables": [
+ {
+ "id": "test_tree.test_column",
+ "filters": []
}
- },
- "indexSelector": "EARLIEST",
- "indexPlacement": "BEFORE",
- "timeCountBefore": 4,
- "timeCountAfter": 4,
- "timeUnit": "QUARTERS"
+ ]
+ }
+ }
},
- "concepts": [
+ "indexSelector": "EARLIEST",
+ "indexPlacement": "BEFORE",
+ "timeCountBefore": 4,
+ "timeCountAfter": 4,
+ "timeUnit": "QUARTERS"
+ },
+ "concepts": [
+ {
+ "label": "test_tree",
+ "type": "TREE",
+ "connectors": {
+ "label": "tree_label",
+ "name": "test_column",
+ "column": "test_table.test_column",
+ "validityDates": {
+ "label": "datum",
+ "column": "test_table.datum"
+ }
+ },
+ "selects": [
{
- "label": "test_tree",
- "type": "TREE",
- "connectors": {
- "label": "tree_label",
- "name": "test_column",
- "column": "test_table.test_column",
- "validityDates": {
- "label": "datum",
- "column": "test_table.datum"
- }
- },
- "selects": [
- {
- "type": "EXISTS",
- "name": "exists"
- }
- ],
- "children": [
- {
- "label": "test_child1",
- "description": " ",
- "condition": {
- "type": "PREFIX_LIST",
- "prefixes": "A1"
- },
- "children": []
- },
- {
- "label": "test_child2",
- "description": " ",
- "condition": {
- "type": "PREFIX_LIST",
- "prefixes": "B2"
- },
- "children": []
- }
- ]
+ "type": "EXISTS",
+ "name": "exists"
}
- ],
- "content": {
- "tables": [
- {
- "csv": "tests/query/REL_EXPORT/PREREQUISITE_WITH_DATES/content.csv",
- "name": "test_table",
- "primaryColumn": {
- "name": "pid",
- "type": "STRING"
- },
- "columns": [
- {
- "name": "datum",
- "type": "DATE"
- },
- {
- "name": "test_column",
- "type": "STRING"
- }
- ]
- }
- ]
+ ],
+ "children": [
+ {
+ "label": "test_child1",
+ "description": " ",
+ "condition": {
+ "type": "PREFIX_LIST",
+ "prefixes": "A1"
+ },
+ "children": []
+ },
+ {
+ "label": "test_child2",
+ "description": " ",
+ "condition": {
+ "type": "PREFIX_LIST",
+ "prefixes": "B2"
+ },
+ "children": []
+ }
+ ]
}
+ ],
+ "content": {
+ "tables": [
+ {
+ "csv": "tests/query/REL_EXPORT/PREREQUISITE_WITH_DATES/content.csv",
+ "name": "test_table",
+ "primaryColumn": {
+ "name": "pid",
+ "type": "STRING"
+ },
+ "columns": [
+ {
+ "name": "datum",
+ "type": "DATE"
+ },
+ {
+ "name": "test_column",
+ "type": "STRING"
+ }
+ ]
+ }
+ ]
+ }
}
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/sql/selects/first/LAST_AGGREGATOR/content.csv b/backend/src/test/resources/tests/sql/selects/first/LAST_AGGREGATOR/content.csv
index bb1adca9de..3a33a7f81f 100644
--- a/backend/src/test/resources/tests/sql/selects/first/LAST_AGGREGATOR/content.csv
+++ b/backend/src/test/resources/tests/sql/selects/first/LAST_AGGREGATOR/content.csv
@@ -9,5 +9,3 @@ pid,datum,value
4,,"f"
5,2012-01-01,"m"
5,,"f"
-6,2012-01-01,"m"
-6,2012-01-01,"f"
\ No newline at end of file
diff --git a/backend/src/test/resources/tests/sql/selects/first/LAST_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/sql/selects/first/LAST_AGGREGATOR/expected.csv
index 018d2a35a4..440b512dcd 100644
--- a/backend/src/test/resources/tests/sql/selects/first/LAST_AGGREGATOR/expected.csv
+++ b/backend/src/test/resources/tests/sql/selects/first/LAST_AGGREGATOR/expected.csv
@@ -3,4 +3,3 @@ result,dates,concept select
2,{2010-07-15/2010-07-15},
3,{2012-01-01/2012-01-02},f
5,{2012-01-01/2012-01-01},m
-6,{2012-01-01/2012-01-01},m
\ No newline at end of file