From 3e85d24de1b9ebda69f1689dd3da862f4a0fbb22 Mon Sep 17 00:00:00 2001 From: Thonagel <12283268+thoniTUB@users.noreply.github.com> Date: Thu, 26 Aug 2021 15:29:06 +0200 Subject: [PATCH 1/3] support single dates for date set --- .../serializer/CDateRangeDeserializer.java | 2 +- .../models/externalservice/ResultType.java | 13 +++++++++-- .../parser/specific/DateRangeParser.java | 17 +------------- .../com/bakdata/conquery/util/DateReader.java | 18 ++++++++++----- .../integration/common/CDateSetTest.java | 18 +++++++++++++++ .../aggregator/COUNT_AGGREGATOR/expected.csv | 6 ++--- .../COUNT_DISTINCT_AGGREGATOR/expected.csv | 4 ++-- .../EXISTS_AGGREGATOR_AGGREGATED/expected.csv | 6 ++--- .../aggregator/FIRST_AGGREGATOR/expected.csv | 6 ++--- .../aggregator/LAST_AGGREGATOR/expected.csv | 6 ++--- .../MULTI_SELECT_AGGREGATOR/expected.csv | 10 ++++----- .../aggregator/PREFIX_AGGREGATOR/expected.csv | 6 ++--- .../QUARTER_AGGREGATOR/expected.csv | 4 ++-- .../aggregator/RANDOM_AGGREGATOR/expected.csv | 8 +++---- .../aggregator/SELECT_AGGREGATOR/expected.csv | 6 ++--- .../aggregator/SUM_AGGREGATOR/expected.csv | 6 ++--- .../SUM_DIFF_AGGREGATOR/expected.csv | 6 ++--- .../aggregator/VALUES_AGGREGATOR/expected.csv | 2 +- .../expected_BIG_MULTI_SELECT_Filter.csv | 4 ++-- .../expected_BIG_MULTI_SELECT_Filter.csv | 6 ++--- .../expected_BIG_MULTI_SELECT_Filter.csv | 4 ++-- .../expected_BIG_MULTI_SELECT_Filter.csv | 2 +- .../expected_BIG_MULTI_SELECT_Filter.csv | 2 +- .../expected_COUNT_QUARTERS_Filter.csv | 4 ++-- .../DATE_DISTANCE/expected_NUMBER_Filter.csv | 2 +- .../DIFFSUM_INTEGER/expected_SUM_Filter.csv | 8 +++---- .../DIFFSUM_REAL/expected_SUM_Filter.csv | 8 +++---- .../content_DURATION_SUM_2_Filter.csv | 2 +- .../expected_DURATION_SUM_2_Filter.csv | 2 +- .../MULTI_SELECT/expected_SELECT_Filter.csv | 6 ++--- .../NUMBER_DECIMAL/expected_NUMBER_Filter.csv | 8 +++---- .../NUMBER_INTEGER/expected_NUMBER_Filter.csv | 6 ++--- .../NUMBER_MONEY/expected_NUMBER_Filter.csv | 8 +++---- .../NUMBER_REAL/expected_NUMBER_Filter.csv | 8 +++---- .../filter/PREFIX/expected_SELECT_Filter.csv | 6 ++--- .../filter/SELECT/expected_SELECT_Filter.csv | 4 ++-- .../expected_SINGLE_SELECT_Filter.csv | 4 ++-- .../expected_SINGLE_SELECT_Filter.csv | 2 +- .../expected_SINGLE_SELECT_Filter.csv | 2 +- .../expected_SINGLE_SELECT_Filter2.csv | 2 +- .../SUM_DECIMAL/expected_SUM_Filter.csv | 4 ++-- .../SUM_INTEGER/expected_SUM_Filter.csv | 4 ++-- .../ENTITY_DATE/LOGICAL/expected.csv | 12 +++++----- .../LOGICAL_WITH_EXCLUDE/expected.csv | 6 ++--- .../ENTITY_DATE/SECONDARY_ID/expected.csv | 6 ++--- .../tests/form/FULL_EXPORT_FORM/expected.csv | 14 ++++++------ .../query/ARRAY_CONCEPT_QUERY/expected.csv | 6 ++--- .../expected.csv | 2 +- .../COMMON_CONCEPT_ICD_QUERY/expected-kh.csv | 4 ++-- .../CONCEPT_RESTRICTION_QUERY/expected-kh.csv | 2 +- .../query/CONNECTOR_CONDITION/expected.csv | 4 ++-- .../query/DATE_DISTANCE/expected-erster.csv | 4 ++-- .../query/DATE_DISTANCE/expected-letzter.csv | 4 ++-- .../expected-versichertenzeit.csv | 8 +++---- .../expected-erster.csv | 8 +++---- .../expected-letzter.csv | 8 +++---- .../expected-versichertenzeit.csv | 16 +++++++------- .../query/DELETE_IMPORT_TESTS/expected.csv | 4 ++-- .../content.csv | 2 +- .../tests/query/LOGICAL/AND/expected.csv | 4 ++-- .../LOGICAL/AND_DATE_LOGICAL/expected.csv | 6 ++--- .../LOGICAL/AND_DURATION_SUM/expected.csv | 4 ++-- .../expected.csv | 2 +- .../query/LOGICAL/AND_NEGATION/expected.csv | 4 ++-- .../AND_NEGATION_DATE_LOGICAL/expected.csv | 4 ++-- .../expected.csv | 4 ++-- .../tests/query/LOGICAL/OR/expected.csv | 8 +++---- .../tests/query/LOGICAL/OR_AND/expected.csv | 8 +++---- .../LOGICAL/OR_DATE_LOGICAL/expected.csv | 6 ++--- .../query/MERGE/AND_DURATION_SUM/expected.csv | 2 +- .../AND_EVENT_DATE_EXCLUDED/expected.csv | 6 ++--- .../MERGE/OR_EVENT_DATE_EXCLUDED/expected.csv | 8 +++---- .../MULTIPLE_CONNECTORS_QUERY/expected.csv | 2 +- .../MULTIPLE_TABLES_ICD_QUERY2/expected.csv | 14 ++++++------ .../expected.csv | 4 ++-- .../expected.csv | 4 ++-- .../expected.csv | 2 +- .../query/RESTART_TEST_DATA/expected.csv | 4 ++-- .../tests/query/REUSED_QUERY/expected.csv | 22 +++++++++---------- .../query/REUSED_QUERY/query_results_1.csv | 22 +++++++++---------- .../query/REUSED_QUERY/query_results_2.csv | 20 ++++++++--------- .../tests/query/SECONDARY_ID/content.csv | 4 ++-- .../tests/query/SECONDARY_ID/content2.csv | 4 ++-- .../tests/query/SECONDARY_ID/expected.csv | 4 ++-- .../SECONDARY_ID_DATEMODE_LOGICAL/content.csv | 2 +- .../content2.csv | 4 ++-- .../expected.csv | 2 +- .../query/SECONDARY_ID_EXCLUDED/expected.csv | 10 ++++----- .../query/SECONDARY_ID_MIXED/content.csv | 4 ++-- .../query/SECONDARY_ID_MIXED/content2.csv | 4 ++-- .../query/SECONDARY_ID_MIXED/expected.csv | 6 ++--- .../SIMPLE_CQEXTERNAL_QUERY/expected.csv | 4 ++-- .../expected.csv | 4 ++-- .../expected.csv | 2 +- .../expected.csv | 4 ++-- .../SIMPLE_TREECONCEPT_QUERY/expected.csv | 4 ++-- .../expected.csv | 4 ++-- .../SIMPLE_VIRTUAL_CONCEPT_QUERY/expected.csv | 4 ++-- .../expected.csv | 2 +- .../SUM_EMPTY_DATE_CONCEPT_QUERY/expected.csv | 4 ++-- .../tests/query/TABLE_EXPORT/content.csv | 4 ++-- .../tests/query/TABLE_EXPORT/content2.csv | 4 ++-- .../tests/query/TABLE_EXPORT/expected.csv | 6 ++--- .../expected.csv | 2 +- .../expected.csv | 6 ++--- .../expected.csv | 2 +- .../expected.csv | 4 ++-- .../TEMPORAL_SAME_CONCEPT_QUERY/expected.csv | 4 ++-- .../query/UPDATE_CONCEPT_TESTS/expected.csv | 6 ++--- .../query/VALIDITY_DATE_QUERY/expected.csv | 4 ++-- .../VIRTUAL_CONCEPT_REUSED_QUERY/expected.csv | 8 +++---- .../query_results.csv | 8 +++---- frontend/src/localization/de.json | 6 ++--- frontend/src/localization/en.json | 10 ++++----- 114 files changed, 345 insertions(+), 327 deletions(-) diff --git a/backend/src/main/java/com/bakdata/conquery/io/jackson/serializer/CDateRangeDeserializer.java b/backend/src/main/java/com/bakdata/conquery/io/jackson/serializer/CDateRangeDeserializer.java index 4d445ad9c4..d7531f7ccd 100644 --- a/backend/src/main/java/com/bakdata/conquery/io/jackson/serializer/CDateRangeDeserializer.java +++ b/backend/src/main/java/com/bakdata/conquery/io/jackson/serializer/CDateRangeDeserializer.java @@ -23,6 +23,6 @@ protected CDateRangeDeserializer(DateReader dateReader) { @SneakyThrows @Override public CDateRange deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { - return DateRangeParser.parseISORange(p.getText(), dateReader); + return dateReader.parseToCDateRange(p.getText()); } } diff --git a/backend/src/main/java/com/bakdata/conquery/models/externalservice/ResultType.java b/backend/src/main/java/com/bakdata/conquery/models/externalservice/ResultType.java index edb15ae7e3..542b2ece3a 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/externalservice/ResultType.java +++ b/backend/src/main/java/com/bakdata/conquery/models/externalservice/ResultType.java @@ -15,6 +15,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; import java.math.BigDecimal; import java.time.LocalDate; @@ -24,6 +25,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, property = "type") @CPSBase +@Slf4j public abstract class ResultType { public String printNullable(PrintSettings cfg, Object f) { @@ -198,8 +200,15 @@ public String print(PrintSettings cfg, @NonNull Object f) { final DateTimeFormatter dateFormat = cfg.getDateFormatter(); final Integer min = (Integer) list.get(0); final Integer max = (Integer) list.get(1); - String minString = min == Integer.MIN_VALUE ? "-∞" : ResultType.DateT.print(min, dateFormat); - String maxString = max == Integer.MAX_VALUE ? "+∞" : ResultType.DateT.print(max, dateFormat); + if (min == null || max == null) { + log.warn("Encountered incomplete range, treating it as an open range. Either min or max was null: {}", list); + } + String minString = min == null || min == Integer.MIN_VALUE ? "-∞" : ResultType.DateT.print(min, dateFormat); + String maxString = max == null || max == Integer.MAX_VALUE ? "+∞" : ResultType.DateT.print(max, dateFormat); + if (min != null && min.equals(max)){ + // If the min and max are the same we print it like a singe date, not a range + return minString; + } return minString + cfg.getDateRangeSeparator() + maxString; } } diff --git a/backend/src/main/java/com/bakdata/conquery/models/preproc/parser/specific/DateRangeParser.java b/backend/src/main/java/com/bakdata/conquery/models/preproc/parser/specific/DateRangeParser.java index 9afb72abf4..19098952ff 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/preproc/parser/specific/DateRangeParser.java +++ b/backend/src/main/java/com/bakdata/conquery/models/preproc/parser/specific/DateRangeParser.java @@ -38,22 +38,7 @@ public DateRangeParser(ConqueryConfig config) { @Override protected CDateRange parseValue(@Nonnull String value) { - return DateRangeParser.parseISORange(value, dateReader); - } - - public static CDateRange parseISORange(String value, DateReader dateReader) { - if (value == null) { - return null; - } - String[] parts = StringUtils.split(value, '/'); - if (parts.length != 2) { - throw ParsingException.of(value, "daterange"); - } - - return CDateRange.of( - dateReader.parseToLocalDate(parts[0]), - dateReader.parseToLocalDate(parts[1]) - ); + return dateReader.parseToCDateRange(value); } @Override diff --git a/backend/src/main/java/com/bakdata/conquery/util/DateReader.java b/backend/src/main/java/com/bakdata/conquery/util/DateReader.java index 9a16eafb1d..92e5a57ef5 100644 --- a/backend/src/main/java/com/bakdata/conquery/util/DateReader.java +++ b/backend/src/main/java/com/bakdata/conquery/util/DateReader.java @@ -129,14 +129,20 @@ public CDateRange parseToCDateRange(String value) { private CDateRange parseToCDateRange(String value, String sep) { String[] parts = StringUtils.split(value, sep); - if (parts.length != 2) { - throw ParsingException.of(value, "daterange"); + + if (parts.length == 1) { + // If it looks like a single date, try to parse it at one + return CDateRange.exactly(parseToLocalDate(parts[0])); + } + + if (parts.length == 2) { + return CDateRange.of( + parseToLocalDate(parts[0]), + parseToLocalDate(parts[1]) + ); } - return CDateRange.of( - parseToLocalDate(parts[0]), - parseToLocalDate(parts[1]) - ); + throw ParsingException.of(value, "daterange"); } public CDateSet parseToCDateSet(String value) { diff --git a/backend/src/test/java/com/bakdata/conquery/integration/common/CDateSetTest.java b/backend/src/test/java/com/bakdata/conquery/integration/common/CDateSetTest.java index c74f720ed6..3203cfacb0 100644 --- a/backend/src/test/java/com/bakdata/conquery/integration/common/CDateSetTest.java +++ b/backend/src/test/java/com/bakdata/conquery/integration/common/CDateSetTest.java @@ -226,6 +226,24 @@ public static Stream argumentsParsing() { CDateRange.of(LocalDate.of(2000,01,01), LocalDate.of(2000,01,01)), CDateRange.of(LocalDate.of(2001,01,01), LocalDate.of(2001,01,01))) ) + ), + Arguments.of( + "{2000-05-01, 2000-01-01/2000-01-01, 2001-01-01/2001-01-01}", + CDateSet.create( + List.of( + CDateRange.exactly(LocalDate.of(2000,05,01)), + CDateRange.of(LocalDate.of(2000,01,01), LocalDate.of(2000,01,01)), + CDateRange.of(LocalDate.of(2001,01,01), LocalDate.of(2001,01,01))) + ) + ), + Arguments.of( + "01.05.2000, 01.01.2000-01.01.2000, 01.01.2001-01.01.2001", + CDateSet.create( + List.of( + CDateRange.exactly(LocalDate.of(2000,05,01)), + CDateRange.of(LocalDate.of(2000,01,01), LocalDate.of(2000,01,01)), + CDateRange.of(LocalDate.of(2001,01,01), LocalDate.of(2001,01,01))) + ) ) ); } diff --git a/backend/src/test/resources/tests/aggregator/COUNT_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/COUNT_AGGREGATOR/expected.csv index 2980ada756..69b15c00e4 100644 --- a/backend/src/test/resources/tests/aggregator/COUNT_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/COUNT_AGGREGATOR/expected.csv @@ -1,5 +1,5 @@ result,dates,concept - select 1,2012-01-01/2012-01-02,2 -2,2010-07-15/2010-07-15, -3,2013-11-10/2013-11-10,1 -4,2012-11-11/2012-11-11,1 \ No newline at end of file +2,2010-07-15, +3,2013-11-10,1 +4,2012-11-11,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/COUNT_DISTINCT_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/COUNT_DISTINCT_AGGREGATOR/expected.csv index 66588601bb..bd4c4a7a8d 100644 --- a/backend/src/test/resources/tests/aggregator/COUNT_DISTINCT_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/COUNT_DISTINCT_AGGREGATOR/expected.csv @@ -1,5 +1,5 @@ result,dates,concept - select 1,2012-01-01/2012-01-02,1 -2,2010-07-15/2010-07-15, -3,2013-11-10/2013-11-10,1 +2,2010-07-15, +3,2013-11-10,1 4,2012-11-11/2012-11-12,2 \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_AGGREGATED/expected.csv b/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_AGGREGATED/expected.csv index 1afcf20d5f..e6add16057 100644 --- a/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_AGGREGATED/expected.csv +++ b/backend/src/test/resources/tests/aggregator/EXISTS_AGGREGATOR_AGGREGATED/expected.csv @@ -1,4 +1,4 @@ result,dates,concept - 1 - exists,concept - 2 - exists,AND,concept - 1 - exists_1,concept - 2 - exists_1,OR -1,2020-01-01/2020-01-01,1,0,0,1,0,1 -2,2020-01-01/2020-01-01,0,1,0,0,1,1 -3,2020-01-01/2020-01-01,1,1,1,1,1,1 \ No newline at end of file +1,2020-01-01,1,0,0,1,0,1 +2,2020-01-01,0,1,0,0,1,1 +3,2020-01-01,1,1,1,1,1,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/expected.csv index c19c558617..607cb50c89 100644 --- a/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/FIRST_AGGREGATOR/expected.csv @@ -1,6 +1,6 @@ result,dates,concept - select 1,2012-01-01/2012-01-02,f -2,2010-07-15/2010-07-15, +2,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 +5,2012-01-01,m +6,2012-01-01,m \ 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 65debd8e64..05bbbd4cb9 100644 --- a/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/LAST_AGGREGATOR/expected.csv @@ -1,6 +1,6 @@ result,dates,concept - select 1,2012-01-01/2012-01-02,m -2,2010-07-15/2010-07-15, +2,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 +5,2012-01-01,m +6,2012-01-01,m \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/MULTI_SELECT_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/MULTI_SELECT_AGGREGATOR/expected.csv index 218231cfac..85abfe3e28 100644 --- a/backend/src/test/resources/tests/aggregator/MULTI_SELECT_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/MULTI_SELECT_AGGREGATOR/expected.csv @@ -1,7 +1,7 @@ result,dates,concept - select -2,2010-07-15/2010-07-15, -3,2013-11-10/2013-11-10,{f=1} -6,2012-11-11/2012-11-11,"{f=1, m=1}" +2,2010-07-15, +3,2013-11-10,{f=1} +6,2012-11-11,"{f=1, m=1}" 1,2012-01-01/2012-01-02,{f=2} -4,2012-11-11/2012-11-11,{m=1} -5,2012-11-11/2012-11-11,{f=1} \ No newline at end of file +4,2012-11-11,{m=1} +5,2012-11-11,{f=1} \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/PREFIX_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/PREFIX_AGGREGATOR/expected.csv index d7a66069eb..001f0641c4 100644 --- a/backend/src/test/resources/tests/aggregator/PREFIX_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/PREFIX_AGGREGATOR/expected.csv @@ -1,5 +1,5 @@ result,dates,concept - select 1,2012-01-01/2012-01-02,"[fa, fb]" -2,2010-07-15/2010-07-15, -3,2013-11-10/2013-11-10,[f] -4,2012-11-11/2012-11-11, \ No newline at end of file +2,2010-07-15, +3,2013-11-10,[f] +4,2012-11-11, \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/QUARTER_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/QUARTER_AGGREGATOR/expected.csv index 47b2f2a65a..b08b460e37 100644 --- a/backend/src/test/resources/tests/aggregator/QUARTER_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/QUARTER_AGGREGATOR/expected.csv @@ -1,3 +1,3 @@ result,dates,concept - select -1,2015-01-17/2015-01-17,2015-Q1 -2,"2015-03-31/2015-03-31, 2015-09-01/2015-09-01",2015-Q3 \ No newline at end of file +1,2015-01-17,2015-Q1 +2,"2015-03-31, 2015-09-01",2015-Q3 \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/expected.csv index 45b4350abc..a6f333db09 100644 --- a/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/RANDOM_AGGREGATOR/expected.csv @@ -1,5 +1,5 @@ result,dates,concept - select -1,2012-01-01/2012-01-01,f -2,2010-07-15/2010-07-15, -5,2012-01-01/2012-01-01,m -6,2012-01-01/2012-01-01,m \ No newline at end of file +1,2012-01-01,f +2,2010-07-15, +5,2012-01-01,m +6,2012-01-01,m \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/SELECT_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/SELECT_AGGREGATOR/expected.csv index 2631695c79..ff2ceff81f 100644 --- a/backend/src/test/resources/tests/aggregator/SELECT_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/SELECT_AGGREGATOR/expected.csv @@ -1,5 +1,5 @@ result,dates,concept - select 1,2012-01-01/2012-01-02,2 -2,2010-07-15/2010-07-15, -3,2013-11-10/2013-11-10,1 -4,2012-11-11/2012-11-11, \ No newline at end of file +2,2010-07-15, +3,2013-11-10,1 +4,2012-11-11, \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/SUM_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/SUM_AGGREGATOR/expected.csv index 531c3fb0a1..c2a22b030c 100644 --- a/backend/src/test/resources/tests/aggregator/SUM_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/SUM_AGGREGATOR/expected.csv @@ -1,5 +1,5 @@ result,dates,concept - select 1,2012-01-01/2012-01-02,2 -2,2010-07-15/2010-07-15, -3,2013-11-10/2013-11-10,1 -4,2012-11-11/2012-11-11,-1 \ No newline at end of file +2,2010-07-15, +3,2013-11-10,1 +4,2012-11-11,-1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/SUM_DIFF_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/SUM_DIFF_AGGREGATOR/expected.csv index ce044e4c7b..925e24cb4a 100644 --- a/backend/src/test/resources/tests/aggregator/SUM_DIFF_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/SUM_DIFF_AGGREGATOR/expected.csv @@ -1,5 +1,5 @@ result,dates,concept - select 1,2012-01-01/2012-01-02,2 -2,2010-07-15/2010-07-15, -3,2013-11-10/2013-11-10,0 -4,2012-11-11/2012-11-11,-2 \ No newline at end of file +2,2010-07-15, +3,2013-11-10,0 +4,2012-11-11,-2 \ No newline at end of file diff --git a/backend/src/test/resources/tests/aggregator/VALUES_AGGREGATOR/expected.csv b/backend/src/test/resources/tests/aggregator/VALUES_AGGREGATOR/expected.csv index ebcca298cf..cde7ea7cb6 100644 --- a/backend/src/test/resources/tests/aggregator/VALUES_AGGREGATOR/expected.csv +++ b/backend/src/test/resources/tests/aggregator/VALUES_AGGREGATOR/expected.csv @@ -1,6 +1,6 @@ result,dates,concept - select 1,2012-01-01/2012-01-02,f -2,2010-07-15/2010-07-15, +2,2010-07-15, 3,2012-01-01/2012-01-02,"f, m" 4,2012-01-01/2012-01-04,"f, m" 5,2012-01-01/2012-01-04,"m , f, f , m" \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT/expected_BIG_MULTI_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT/expected_BIG_MULTI_SELECT_Filter.csv index 6ae7d52095..17ea328c88 100644 --- a/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT/expected_BIG_MULTI_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT/expected_BIG_MULTI_SELECT_Filter.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -2,2010-07-15/2010-07-15 \ No newline at end of file +1,2012-01-01 +2,2010-07-15 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_2VALUES/expected_BIG_MULTI_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_2VALUES/expected_BIG_MULTI_SELECT_Filter.csv index 88a34c57b1..09a9fcf2db 100644 --- a/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_2VALUES/expected_BIG_MULTI_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_2VALUES/expected_BIG_MULTI_SELECT_Filter.csv @@ -1,4 +1,4 @@ result,dates -1,"2012-01-01/2012-01-01, 2012-02-01/2012-02-01" -2,2010-07-15/2010-07-15 -3,2013-11-10/2013-11-10 \ No newline at end of file +1,"2012-01-01, 2012-02-01" +2,2010-07-15 +3,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_EMPTY_VALUES/expected_BIG_MULTI_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_EMPTY_VALUES/expected_BIG_MULTI_SELECT_Filter.csv index 6ae7d52095..17ea328c88 100644 --- a/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_EMPTY_VALUES/expected_BIG_MULTI_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_EMPTY_VALUES/expected_BIG_MULTI_SELECT_Filter.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -2,2010-07-15/2010-07-15 \ No newline at end of file +1,2012-01-01 +2,2010-07-15 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_SPEZIAL_CHARACTER/expected_BIG_MULTI_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_SPEZIAL_CHARACTER/expected_BIG_MULTI_SELECT_Filter.csv index ec2f5318ca..68c4f99b5b 100644 --- a/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_SPEZIAL_CHARACTER/expected_BIG_MULTI_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_SPEZIAL_CHARACTER/expected_BIG_MULTI_SELECT_Filter.csv @@ -1,2 +1,2 @@ result,dates -2,2010-07-15/2010-07-15 \ No newline at end of file +2,2010-07-15 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_SPEZIAL_CHARACTER2/expected_BIG_MULTI_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_SPEZIAL_CHARACTER2/expected_BIG_MULTI_SELECT_Filter.csv index ec2f5318ca..68c4f99b5b 100644 --- a/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_SPEZIAL_CHARACTER2/expected_BIG_MULTI_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/BIG_MULTI_SELECT_SPEZIAL_CHARACTER2/expected_BIG_MULTI_SELECT_Filter.csv @@ -1,2 +1,2 @@ result,dates -2,2010-07-15/2010-07-15 \ No newline at end of file +2,2010-07-15 \ No newline at end of file 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_COUNT_QUARTERS_Filter.csv index d3bfa2943c..1e9af03b97 100644 --- 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_COUNT_QUARTERS_Filter.csv @@ -1,3 +1,3 @@ result,dates -3,2015-01-01/2015-01-01 -4,2015-01-01/2015-01-01 \ No newline at end of file +3,2015-01-01 +4,2015-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/DATE_DISTANCE/expected_NUMBER_Filter.csv b/backend/src/test/resources/tests/filter/DATE_DISTANCE/expected_NUMBER_Filter.csv index 1790401bf1..e1f7f4bf51 100644 --- a/backend/src/test/resources/tests/filter/DATE_DISTANCE/expected_NUMBER_Filter.csv +++ b/backend/src/test/resources/tests/filter/DATE_DISTANCE/expected_NUMBER_Filter.csv @@ -1,3 +1,3 @@ result,dates 1,2000-01-31/2000-02-01 -2,2000-01-31/2000-01-31 \ No newline at end of file +2,2000-01-31 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/DIFFSUM_INTEGER/expected_SUM_Filter.csv b/backend/src/test/resources/tests/filter/DIFFSUM_INTEGER/expected_SUM_Filter.csv index 92e95e61ff..51abf0d0d2 100644 --- a/backend/src/test/resources/tests/filter/DIFFSUM_INTEGER/expected_SUM_Filter.csv +++ b/backend/src/test/resources/tests/filter/DIFFSUM_INTEGER/expected_SUM_Filter.csv @@ -1,8 +1,8 @@ result,dates -2,2017-05-06/2017-05-06 -3,2012-05-29/2012-05-29 -4,2010-08-14/2010-08-14 -7,2016-06-23/2016-06-23 +2,2017-05-06 +3,2012-05-29 +4,2010-08-14 +7,2016-06-23 9,2018-03-22/2018-03-24 10,2011-02-07/2011-02-08 11,2013-03-09/2013-03-11 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/DIFFSUM_REAL/expected_SUM_Filter.csv b/backend/src/test/resources/tests/filter/DIFFSUM_REAL/expected_SUM_Filter.csv index 92e95e61ff..51abf0d0d2 100644 --- a/backend/src/test/resources/tests/filter/DIFFSUM_REAL/expected_SUM_Filter.csv +++ b/backend/src/test/resources/tests/filter/DIFFSUM_REAL/expected_SUM_Filter.csv @@ -1,8 +1,8 @@ result,dates -2,2017-05-06/2017-05-06 -3,2012-05-29/2012-05-29 -4,2010-08-14/2010-08-14 -7,2016-06-23/2016-06-23 +2,2017-05-06 +3,2012-05-29 +4,2010-08-14 +7,2016-06-23 9,2018-03-22/2018-03-24 10,2011-02-07/2011-02-08 11,2013-03-09/2013-03-11 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/DURATION_SUM_2/content_DURATION_SUM_2_Filter.csv b/backend/src/test/resources/tests/filter/DURATION_SUM_2/content_DURATION_SUM_2_Filter.csv index e82488e056..a959deeedc 100644 --- a/backend/src/test/resources/tests/filter/DURATION_SUM_2/content_DURATION_SUM_2_Filter.csv +++ b/backend/src/test/resources/tests/filter/DURATION_SUM_2/content_DURATION_SUM_2_Filter.csv @@ -1,6 +1,6 @@ pid,datum 1,"2010-01-01/2010-01-31" -3,"2013-08-10/2013-08-10" +3,"2013-08-10" 4,"2010-06-15/2010-06-20" 4,"2010-06-16/2010-06-18" 5,"2011-03-02/2011-03-10" diff --git a/backend/src/test/resources/tests/filter/DURATION_SUM_2/expected_DURATION_SUM_2_Filter.csv b/backend/src/test/resources/tests/filter/DURATION_SUM_2/expected_DURATION_SUM_2_Filter.csv index 14916517d3..f48a7ab643 100644 --- a/backend/src/test/resources/tests/filter/DURATION_SUM_2/expected_DURATION_SUM_2_Filter.csv +++ b/backend/src/test/resources/tests/filter/DURATION_SUM_2/expected_DURATION_SUM_2_Filter.csv @@ -1,5 +1,5 @@ result,dates 1,2010-01-01/2010-01-31 -3,2013-08-10/2013-08-10 +3,2013-08-10 4,2010-06-15/2010-06-20 5,2011-03-02/2011-03-13 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/MULTI_SELECT/expected_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/MULTI_SELECT/expected_SELECT_Filter.csv index 24e12dd9d7..7c6705fdfb 100644 --- a/backend/src/test/resources/tests/filter/MULTI_SELECT/expected_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/MULTI_SELECT/expected_SELECT_Filter.csv @@ -1,4 +1,4 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 -5,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01 +3,2013-11-10 +5,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/NUMBER_DECIMAL/expected_NUMBER_Filter.csv b/backend/src/test/resources/tests/filter/NUMBER_DECIMAL/expected_NUMBER_Filter.csv index 96ceb912fc..fb19d7bf6c 100644 --- a/backend/src/test/resources/tests/filter/NUMBER_DECIMAL/expected_NUMBER_Filter.csv +++ b/backend/src/test/resources/tests/filter/NUMBER_DECIMAL/expected_NUMBER_Filter.csv @@ -1,6 +1,6 @@ result,dates 3,2012-05-29/2012-05-30 -4,2010-08-15/2010-08-15 -5,2017-03-14/2017-03-14 -7,2016-06-23/2016-06-23 -12,2012-05-29/2012-05-29 \ No newline at end of file +4,2010-08-15 +5,2017-03-14 +7,2016-06-23 +12,2012-05-29 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/NUMBER_INTEGER/expected_NUMBER_Filter.csv b/backend/src/test/resources/tests/filter/NUMBER_INTEGER/expected_NUMBER_Filter.csv index 8dab95b397..9b73c202b6 100644 --- a/backend/src/test/resources/tests/filter/NUMBER_INTEGER/expected_NUMBER_Filter.csv +++ b/backend/src/test/resources/tests/filter/NUMBER_INTEGER/expected_NUMBER_Filter.csv @@ -1,5 +1,5 @@ result,dates 3,2012-05-29/2012-05-30 -4,2010-08-15/2010-08-15 -5,2017-03-14/2017-03-14 -8,2012-05-29/2012-05-29 \ No newline at end of file +4,2010-08-15 +5,2017-03-14 +8,2012-05-29 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/NUMBER_MONEY/expected_NUMBER_Filter.csv b/backend/src/test/resources/tests/filter/NUMBER_MONEY/expected_NUMBER_Filter.csv index 96ceb912fc..fb19d7bf6c 100644 --- a/backend/src/test/resources/tests/filter/NUMBER_MONEY/expected_NUMBER_Filter.csv +++ b/backend/src/test/resources/tests/filter/NUMBER_MONEY/expected_NUMBER_Filter.csv @@ -1,6 +1,6 @@ result,dates 3,2012-05-29/2012-05-30 -4,2010-08-15/2010-08-15 -5,2017-03-14/2017-03-14 -7,2016-06-23/2016-06-23 -12,2012-05-29/2012-05-29 \ No newline at end of file +4,2010-08-15 +5,2017-03-14 +7,2016-06-23 +12,2012-05-29 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/NUMBER_REAL/expected_NUMBER_Filter.csv b/backend/src/test/resources/tests/filter/NUMBER_REAL/expected_NUMBER_Filter.csv index 96ceb912fc..fb19d7bf6c 100644 --- a/backend/src/test/resources/tests/filter/NUMBER_REAL/expected_NUMBER_Filter.csv +++ b/backend/src/test/resources/tests/filter/NUMBER_REAL/expected_NUMBER_Filter.csv @@ -1,6 +1,6 @@ result,dates 3,2012-05-29/2012-05-30 -4,2010-08-15/2010-08-15 -5,2017-03-14/2017-03-14 -7,2016-06-23/2016-06-23 -12,2012-05-29/2012-05-29 \ No newline at end of file +4,2010-08-15 +5,2017-03-14 +7,2016-06-23 +12,2012-05-29 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/PREFIX/expected_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/PREFIX/expected_SELECT_Filter.csv index 0e1f6aa20f..ddad5f4c37 100644 --- a/backend/src/test/resources/tests/filter/PREFIX/expected_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/PREFIX/expected_SELECT_Filter.csv @@ -1,4 +1,4 @@ result,dates -1,2012-01-01/2012-01-01 -2,2012-01-01/2012-01-01 -5,2012-01-01/2012-01-01 \ No newline at end of file +1,2012-01-01 +2,2012-01-01 +5,2012-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/SELECT/expected_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/SELECT/expected_SELECT_Filter.csv index 6ae7d52095..17ea328c88 100644 --- a/backend/src/test/resources/tests/filter/SELECT/expected_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/SELECT/expected_SELECT_Filter.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -2,2010-07-15/2010-07-15 \ No newline at end of file +1,2012-01-01 +2,2010-07-15 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/SINGLE_SELECT_EMPTY_VALUES/expected_SINGLE_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/SINGLE_SELECT_EMPTY_VALUES/expected_SINGLE_SELECT_Filter.csv index 6ae7d52095..17ea328c88 100644 --- a/backend/src/test/resources/tests/filter/SINGLE_SELECT_EMPTY_VALUES/expected_SINGLE_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/SINGLE_SELECT_EMPTY_VALUES/expected_SINGLE_SELECT_Filter.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -2,2010-07-15/2010-07-15 \ No newline at end of file +1,2012-01-01 +2,2010-07-15 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER/expected_SINGLE_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER/expected_SINGLE_SELECT_Filter.csv index ec2f5318ca..68c4f99b5b 100644 --- a/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER/expected_SINGLE_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER/expected_SINGLE_SELECT_Filter.csv @@ -1,2 +1,2 @@ result,dates -2,2010-07-15/2010-07-15 \ No newline at end of file +2,2010-07-15 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER2/expected_SINGLE_SELECT_Filter.csv b/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER2/expected_SINGLE_SELECT_Filter.csv index ec2f5318ca..68c4f99b5b 100644 --- a/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER2/expected_SINGLE_SELECT_Filter.csv +++ b/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER2/expected_SINGLE_SELECT_Filter.csv @@ -1,2 +1,2 @@ result,dates -2,2010-07-15/2010-07-15 \ No newline at end of file +2,2010-07-15 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER2/expected_SINGLE_SELECT_Filter2.csv b/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER2/expected_SINGLE_SELECT_Filter2.csv index 5b1d62939d..f896113434 100644 --- a/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER2/expected_SINGLE_SELECT_Filter2.csv +++ b/backend/src/test/resources/tests/filter/SINGLE_SELECT_SPEZIAL_CHARACTER2/expected_SINGLE_SELECT_Filter2.csv @@ -1,2 +1,2 @@ result,dates -5,2010-07-15/2010-07-15 \ No newline at end of file +5,2010-07-15 \ No newline at end of file diff --git a/backend/src/test/resources/tests/filter/SUM_DECIMAL/expected_SUM_Filter.csv b/backend/src/test/resources/tests/filter/SUM_DECIMAL/expected_SUM_Filter.csv index bcf50be069..f6070770cb 100644 --- a/backend/src/test/resources/tests/filter/SUM_DECIMAL/expected_SUM_Filter.csv +++ b/backend/src/test/resources/tests/filter/SUM_DECIMAL/expected_SUM_Filter.csv @@ -1,5 +1,5 @@ result,dates -1,2015-03-17/2015-03-17 -2,2015-03-17/2015-03-17 +1,2015-03-17 +2,2015-03-17 3,2015-03-17/2015-03-20 4,2015-03-17/2015-03-18 diff --git a/backend/src/test/resources/tests/filter/SUM_INTEGER/expected_SUM_Filter.csv b/backend/src/test/resources/tests/filter/SUM_INTEGER/expected_SUM_Filter.csv index bcf50be069..f6070770cb 100644 --- a/backend/src/test/resources/tests/filter/SUM_INTEGER/expected_SUM_Filter.csv +++ b/backend/src/test/resources/tests/filter/SUM_INTEGER/expected_SUM_Filter.csv @@ -1,5 +1,5 @@ result,dates -1,2015-03-17/2015-03-17 -2,2015-03-17/2015-03-17 +1,2015-03-17 +2,2015-03-17 3,2015-03-17/2015-03-20 4,2015-03-17/2015-03-18 diff --git a/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/LOGICAL/expected.csv b/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/LOGICAL/expected.csv index 480d25c5bf..f6e5d9e41b 100644 --- a/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/LOGICAL/expected.csv +++ b/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/LOGICAL/expected.csv @@ -1,7 +1,7 @@ result,resolution,index,date_range,Alter - Ausgabe Alter -1,complete,,2012-03-02/2012-03-02,55 -1,year,1,2012-03-02/2012-03-02,55 -1,quarter,1,2012-03-02/2012-03-02,55 -1,complete,,2012-03-04/2012-03-04,55 -1,year,1,2012-03-04/2012-03-04,55 -1,quarter,1,2012-03-04/2012-03-04,55 \ No newline at end of file +1,complete,,2012-03-02,55 +1,year,1,2012-03-02,55 +1,quarter,1,2012-03-02,55 +1,complete,,2012-03-04,55 +1,year,1,2012-03-04,55 +1,quarter,1,2012-03-04,55 \ No newline at end of file diff --git a/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/LOGICAL_WITH_EXCLUDE/expected.csv b/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/LOGICAL_WITH_EXCLUDE/expected.csv index db981c176b..b5161d241d 100644 --- a/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/LOGICAL_WITH_EXCLUDE/expected.csv +++ b/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/LOGICAL_WITH_EXCLUDE/expected.csv @@ -2,6 +2,6 @@ result,resolution,index,date_range,Alter - Ausgabe Alter 1,complete,,2012-03-01/2012-03-02,55 1,year,1,2012-03-01/2012-03-02,55 1,quarter,1,2012-03-01/2012-03-02,55 -1,complete,,2012-03-04/2012-03-04,55 -1,year,1,2012-03-04/2012-03-04,55 -1,quarter,1,2012-03-04/2012-03-04,55 \ No newline at end of file +1,complete,,2012-03-04,55 +1,year,1,2012-03-04,55 +1,quarter,1,2012-03-04,55 \ No newline at end of file diff --git a/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/SECONDARY_ID/expected.csv b/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/SECONDARY_ID/expected.csv index 7adf0e053c..566aaa9322 100644 --- a/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/SECONDARY_ID/expected.csv +++ b/backend/src/test/resources/tests/form/EXPORT_FORM/ENTITY_DATE/SECONDARY_ID/expected.csv @@ -2,6 +2,6 @@ result,resolution,index,date_range,explicitly set select - Table1 Ausgabe Alter 1,complete,,2012-03-01/2012-03-02,55 1,year,1,2012-03-01/2012-03-02,55 1,quarter,1,2012-03-01/2012-03-02,55 -1,complete,,2012-03-04/2012-03-04,55 -1,year,1,2012-03-04/2012-03-04,55 -1,quarter,1,2012-03-04/2012-03-04,55 \ No newline at end of file +1,complete,,2012-03-04,55 +1,year,1,2012-03-04,55 +1,quarter,1,2012-03-04,55 \ No newline at end of file diff --git a/backend/src/test/resources/tests/form/FULL_EXPORT_FORM/expected.csv b/backend/src/test/resources/tests/form/FULL_EXPORT_FORM/expected.csv index 2bb9da91c3..6bb65e6879 100644 --- a/backend/src/test/resources/tests/form/FULL_EXPORT_FORM/expected.csv +++ b/backend/src/test/resources/tests/form/FULL_EXPORT_FORM/expected.csv @@ -1,8 +1,8 @@ result,dates,secondary,table - column,vers_stamm - date,vers_stamm - date_end,vers_stamm - geburtsdatum,vers_stamm - geschlecht -1,2012-03-01/2012-03-01,1,A,,,, -1,2012-03-02/2012-03-02,1,A,,,, -1,2012-03-04/2012-03-04,2,A,,,, -1,2012-03-02/2012-03-02,1,B,,,, -1,2012-03-04/2012-03-04,2,B,,,, -1,2012-03-06/2012-03-06,3,B,,,, -1,2012-01-01/2012-01-01,,,2012-01-01/2012-12-31,2012-12-31,1957-01-01,1 \ No newline at end of file +1,2012-03-01,1,A,,,, +1,2012-03-02,1,A,,,, +1,2012-03-04,2,A,,,, +1,2012-03-02,1,B,,,, +1,2012-03-04,2,B,,,, +1,2012-03-06,3,B,,,, +1,2012-01-01,,,2012-01-01/2012-12-31,2012-12-31,1957-01-01,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/ARRAY_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/ARRAY_CONCEPT_QUERY/expected.csv index 9021e96edc..cac0cc13b9 100644 --- a/backend/src/test/resources/tests/query/ARRAY_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/ARRAY_CONCEPT_QUERY/expected.csv @@ -1,5 +1,5 @@ result,dates,select - count_genders,select - count_genders_1 1,"2012-01-01/2012-01-02, 2013-01-01/2013-01-02",4,4 -2,2010-07-15/2010-07-15,, -3,2013-11-10/2013-11-10,1, -4,2012-11-11/2012-11-11,1, \ No newline at end of file +2,2010-07-15,, +3,2013-11-10,1, +4,2012-11-11,1, \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/BIG_MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/BIG_MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv index 225e384fcd..f452317949 100644 --- a/backend/src/test/resources/tests/query/BIG_MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/BIG_MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv @@ -1,2 +1,2 @@ result,dates -1,2012-01-01/2012-01-01 \ No newline at end of file +1,2012-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/COMMON_CONCEPT_ICD_QUERY/expected-kh.csv b/backend/src/test/resources/tests/query/COMMON_CONCEPT_ICD_QUERY/expected-kh.csv index 0c535e30da..c748d9629a 100644 --- a/backend/src/test/resources/tests/query/COMMON_CONCEPT_ICD_QUERY/expected-kh.csv +++ b/backend/src/test/resources/tests/query/COMMON_CONCEPT_ICD_QUERY/expected-kh.csv @@ -1,3 +1,3 @@ result,dates -3,2017-03-31/2017-03-31 -15,2017-06-30/2017-06-30 \ No newline at end of file +3,2017-03-31 +15,2017-06-30 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/CONCEPT_RESTRICTION_QUERY/expected-kh.csv b/backend/src/test/resources/tests/query/CONCEPT_RESTRICTION_QUERY/expected-kh.csv index 9320e946da..f5df2d7d1f 100644 --- a/backend/src/test/resources/tests/query/CONCEPT_RESTRICTION_QUERY/expected-kh.csv +++ b/backend/src/test/resources/tests/query/CONCEPT_RESTRICTION_QUERY/expected-kh.csv @@ -1,2 +1,2 @@ result,dates -3,2017-03-31/2017-03-31 \ No newline at end of file +3,2017-03-31 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/CONNECTOR_CONDITION/expected.csv b/backend/src/test/resources/tests/query/CONNECTOR_CONDITION/expected.csv index ce93de1599..30b651eca6 100644 --- a/backend/src/test/resources/tests/query/CONNECTOR_CONDITION/expected.csv +++ b/backend/src/test/resources/tests/query/CONNECTOR_CONDITION/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 +1,2012-01-01 +3,2013-11-10 diff --git a/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-erster.csv b/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-erster.csv index 9cb121265a..bd1c47da10 100644 --- a/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-erster.csv +++ b/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-erster.csv @@ -1,3 +1,3 @@ result,dates -2,2011-01-01/2011-01-01 -5,2011-01-01/2011-01-01 \ No newline at end of file +2,2011-01-01 +5,2011-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-letzter.csv b/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-letzter.csv index 19fadaa3b2..4eb27e5428 100644 --- a/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-letzter.csv +++ b/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-letzter.csv @@ -1,3 +1,3 @@ result,dates -3,2011-12-31/2011-12-31 -5,2011-12-31/2011-12-31 \ No newline at end of file +3,2011-12-31 +5,2011-12-31 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-versichertenzeit.csv b/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-versichertenzeit.csv index 17c77636ce..471c5d63af 100644 --- a/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-versichertenzeit.csv +++ b/backend/src/test/resources/tests/query/DATE_DISTANCE/expected-versichertenzeit.csv @@ -1,5 +1,5 @@ result,dates -1,2011-01-01/2011-01-01 -2,2011-01-01/2011-01-01 -3,2011-01-01/2011-01-01 -5,2011-01-01/2011-01-01 \ No newline at end of file +1,2011-01-01 +2,2011-01-01 +3,2011-01-01 +5,2011-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-erster.csv b/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-erster.csv index c8f9763eb8..009b7b9744 100644 --- a/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-erster.csv +++ b/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-erster.csv @@ -1,5 +1,5 @@ result,dates -2,2011-01-01/2011-01-01 -5,2011-01-01/2011-01-01 -32,2011-01-01/2011-01-01 -35,2011-01-01/2011-01-01 \ No newline at end of file +2,2011-01-01 +5,2011-01-01 +32,2011-01-01 +35,2011-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-letzter.csv b/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-letzter.csv index b8c74b477d..29d2cc3f66 100644 --- a/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-letzter.csv +++ b/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-letzter.csv @@ -1,5 +1,5 @@ result,dates -3,2011-12-31/2011-12-31 -5,2011-12-31/2011-12-31 -33,2011-12-31/2011-12-31 -35,2011-12-31/2011-12-31 \ No newline at end of file +3,2011-12-31 +5,2011-12-31 +33,2011-12-31 +35,2011-12-31 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-versichertenzeit.csv b/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-versichertenzeit.csv index 2789096005..26ee8b39b9 100644 --- a/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-versichertenzeit.csv +++ b/backend/src/test/resources/tests/query/DATE_DISTANCE_AGE_SPAN/expected-versichertenzeit.csv @@ -1,9 +1,9 @@ result,dates -1,2011-01-01/2011-01-01 -2,2011-01-01/2011-01-01 -3,2011-01-01/2011-01-01 -5,2011-01-01/2011-01-01 -31,2011-01-01/2011-01-01 -32,2011-01-01/2011-01-01 -33,2011-01-01/2011-01-01 -35,2011-01-01/2011-01-01 \ No newline at end of file +1,2011-01-01 +2,2011-01-01 +3,2011-01-01 +5,2011-01-01 +31,2011-01-01 +32,2011-01-01 +33,2011-01-01 +35,2011-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/DELETE_IMPORT_TESTS/expected.csv b/backend/src/test/resources/tests/query/DELETE_IMPORT_TESTS/expected.csv index 443c6a4fd1..1c71038578 100644 --- a/backend/src/test/resources/tests/query/DELETE_IMPORT_TESTS/expected.csv +++ b/backend/src/test/resources/tests/query/DELETE_IMPORT_TESTS/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01 +3,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/DURATION_SUM_EMPTY_DATE_CONCEPT_QUERY/content.csv b/backend/src/test/resources/tests/query/DURATION_SUM_EMPTY_DATE_CONCEPT_QUERY/content.csv index 5f57090c2d..6507e340dc 100644 --- a/backend/src/test/resources/tests/query/DURATION_SUM_EMPTY_DATE_CONCEPT_QUERY/content.csv +++ b/backend/src/test/resources/tests/query/DURATION_SUM_EMPTY_DATE_CONCEPT_QUERY/content.csv @@ -1,5 +1,5 @@ pid,anfang,ende,datum -1,2009-12-30,2009-12-30,"2009-12-30/2009-12-30" +1,2009-12-30,2009-12-30,"2009-12-30" 4,2009-12-30,2010-01-02,"2009-12-30/2010-01-02" 10,2010-01-02,2010-01-07,"2010-01-02/2010-01-07" 31,2010-02-02,2010-02-04,"2010-02-02/2010-02-04" diff --git a/backend/src/test/resources/tests/query/LOGICAL/AND/expected.csv b/backend/src/test/resources/tests/query/LOGICAL/AND/expected.csv index 08750d360f..145d2d0bd5 100644 --- a/backend/src/test/resources/tests/query/LOGICAL/AND/expected.csv +++ b/backend/src/test/resources/tests/query/LOGICAL/AND/expected.csv @@ -1,3 +1,3 @@ result,dates,tree - a and tree - b -3,2012-01-01/2012-01-01,1 -4,2012-01-01/2012-01-01,1 \ No newline at end of file +3,2012-01-01,1 +4,2012-01-01,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/LOGICAL/AND_DATE_LOGICAL/expected.csv b/backend/src/test/resources/tests/query/LOGICAL/AND_DATE_LOGICAL/expected.csv index 8cbcef6ee8..4744238ba9 100644 --- a/backend/src/test/resources/tests/query/LOGICAL/AND_DATE_LOGICAL/expected.csv +++ b/backend/src/test/resources/tests/query/LOGICAL/AND_DATE_LOGICAL/expected.csv @@ -1,5 +1,5 @@ result,dates,tree - a and tree - b -2,2012-01-01/2012-01-01,1 +2,2012-01-01,1 3,,1 -4,2012-01-02/2012-01-02,1 -5,2012-01-03/2012-01-03,1 \ No newline at end of file +4,2012-01-02,1 +5,2012-01-03,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/LOGICAL/AND_DURATION_SUM/expected.csv b/backend/src/test/resources/tests/query/LOGICAL/AND_DURATION_SUM/expected.csv index 0a78e4b8af..949dfcda86 100644 --- a/backend/src/test/resources/tests/query/LOGICAL/AND_DURATION_SUM/expected.csv +++ b/backend/src/test/resources/tests/query/LOGICAL/AND_DURATION_SUM/expected.csv @@ -1,5 +1,5 @@ result,dates,tree - a - event_duration,tree - a and tree - b -2,2012-01-01/2012-01-01,1,1 +2,2012-01-01,1,1 3,,0,1 -4,2012-01-02/2012-01-02,1,1 +4,2012-01-02,1,1 5,2012-01-02/2012-01-04,3,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/LOGICAL/AND_DURATION_SUM_MULTI_CONCEPT/expected.csv b/backend/src/test/resources/tests/query/LOGICAL/AND_DURATION_SUM_MULTI_CONCEPT/expected.csv index 905c0e449d..9ed2727644 100644 --- a/backend/src/test/resources/tests/query/LOGICAL/AND_DURATION_SUM_MULTI_CONCEPT/expected.csv +++ b/backend/src/test/resources/tests/query/LOGICAL/AND_DURATION_SUM_MULTI_CONCEPT/expected.csv @@ -2,6 +2,6 @@ result,secondary,dates,tree1 - a - event_duration,tree1 - a and tree2 - b 1,1,,0,1 1,2,,0,1 1,3,,0,1 -1,4,2012-01-02/2012-01-02,1,1 +1,4,2012-01-02,1,1 1,5,2012-01-02/2012-01-04,3,1 2,1,,0,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION/expected.csv b/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION/expected.csv index 96d0a78d5e..04fb782bea 100644 --- a/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION/expected.csv +++ b/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION/expected.csv @@ -1,3 +1,3 @@ result,dates,another-name-for-and -2,2012-01-01/2012-01-01,1 -5,2012-01-01/2012-01-01,1 \ No newline at end of file +2,2012-01-01,1 +5,2012-01-01,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION_DATE_LOGICAL/expected.csv b/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION_DATE_LOGICAL/expected.csv index 6240469bca..df366b3c06 100644 --- a/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION_DATE_LOGICAL/expected.csv +++ b/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION_DATE_LOGICAL/expected.csv @@ -1,3 +1,3 @@ result,dates,NEGATION and tree - b -2,2012-01-01/2012-01-01,1 -5,"2012-01-03/2012-01-03, 2012-01-05/2012-01-05",1 \ No newline at end of file +2,2012-01-01,1 +5,"2012-01-03, 2012-01-05",1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION_RESTRICTION_DATE_LOGICAL/expected.csv b/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION_RESTRICTION_DATE_LOGICAL/expected.csv index 67c7c4644b..915fa75f32 100644 --- a/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION_RESTRICTION_DATE_LOGICAL/expected.csv +++ b/backend/src/test/resources/tests/query/LOGICAL/AND_NEGATION_RESTRICTION_DATE_LOGICAL/expected.csv @@ -1,3 +1,3 @@ result,dates,NEGATION and tree - b -2,2012-01-01/2012-01-01,1 -4,2012-01-02/2012-01-02,1 \ No newline at end of file +2,2012-01-01,1 +4,2012-01-02,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/LOGICAL/OR/expected.csv b/backend/src/test/resources/tests/query/LOGICAL/OR/expected.csv index afb48f0c4b..8eabded028 100644 --- a/backend/src/test/resources/tests/query/LOGICAL/OR/expected.csv +++ b/backend/src/test/resources/tests/query/LOGICAL/OR/expected.csv @@ -1,5 +1,5 @@ result,dates,tree - a or tree - b -1,2012-01-01/2012-01-01,1 -2,2012-01-01/2012-01-01,1 -3,2012-01-01/2012-01-01,1 -4,2012-01-01/2012-01-01,1 \ No newline at end of file +1,2012-01-01,1 +2,2012-01-01,1 +3,2012-01-01,1 +4,2012-01-01,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/LOGICAL/OR_AND/expected.csv b/backend/src/test/resources/tests/query/LOGICAL/OR_AND/expected.csv index eaf41bc526..e424a7e41f 100644 --- a/backend/src/test/resources/tests/query/LOGICAL/OR_AND/expected.csv +++ b/backend/src/test/resources/tests/query/LOGICAL/OR_AND/expected.csv @@ -1,5 +1,5 @@ result,dates,tree - a and tree - b,tree - a or tree - b -1,2012-01-01/2012-01-01,0,1 -2,2012-01-01/2012-01-01,0,1 -3,2012-01-01/2012-01-01,1,1 -4,2012-01-01/2012-01-01,1,1 \ No newline at end of file +1,2012-01-01,0,1 +2,2012-01-01,0,1 +3,2012-01-01,1,1 +4,2012-01-01,1,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/LOGICAL/OR_DATE_LOGICAL/expected.csv b/backend/src/test/resources/tests/query/LOGICAL/OR_DATE_LOGICAL/expected.csv index 64bc17cfeb..3bcfdb2c30 100644 --- a/backend/src/test/resources/tests/query/LOGICAL/OR_DATE_LOGICAL/expected.csv +++ b/backend/src/test/resources/tests/query/LOGICAL/OR_DATE_LOGICAL/expected.csv @@ -1,6 +1,6 @@ result,dates,tree - a or tree - b -1,2012-01-01/2012-01-01,1 -2,2012-01-01/2012-01-01,1 +1,2012-01-01,1 +2,2012-01-01,1 3,2012-01-01/2012-01-02,1 4,2012-01-01/2012-01-02,1 -5,"2012-01-01/2012-01-01, 2012-01-03/2012-01-03, 2012-01-05/2012-01-05",1 \ No newline at end of file +5,"2012-01-01, 2012-01-03, 2012-01-05",1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/MERGE/AND_DURATION_SUM/expected.csv b/backend/src/test/resources/tests/query/MERGE/AND_DURATION_SUM/expected.csv index 47a39a3ef6..39df8be135 100644 --- a/backend/src/test/resources/tests/query/MERGE/AND_DURATION_SUM/expected.csv +++ b/backend/src/test/resources/tests/query/MERGE/AND_DURATION_SUM/expected.csv @@ -1,5 +1,5 @@ result,dates,tree - a - event_duration,tree - a and tree - b -2,2012-01-01/2012-01-01,1,1 +2,2012-01-01,1,1 3,2012-01-01/2012-01-02,1,1 4,2012-01-01/2012-01-02,2,1 5,2012-01-01/2012-01-05,4,1 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/MERGE/AND_EVENT_DATE_EXCLUDED/expected.csv b/backend/src/test/resources/tests/query/MERGE/AND_EVENT_DATE_EXCLUDED/expected.csv index 37186d850c..53f9c012a3 100644 --- a/backend/src/test/resources/tests/query/MERGE/AND_EVENT_DATE_EXCLUDED/expected.csv +++ b/backend/src/test/resources/tests/query/MERGE/AND_EVENT_DATE_EXCLUDED/expected.csv @@ -1,5 +1,5 @@ result,dates,tree - a - dates -2,2012-01-01/2012-01-01,2012-01-01/2012-01-01 -3,2012-01-02/2012-01-02,2012-01-01/2012-01-01 -4,2012-01-02/2012-01-02,2012-01-01/2012-01-02 +2,2012-01-01,2012-01-01 +3,2012-01-02,2012-01-01 +4,2012-01-02,2012-01-01/2012-01-02 5,2012-01-02/2012-01-05,2012-01-01/2012-01-04 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/MERGE/OR_EVENT_DATE_EXCLUDED/expected.csv b/backend/src/test/resources/tests/query/MERGE/OR_EVENT_DATE_EXCLUDED/expected.csv index c38972f4af..84e05516b1 100644 --- a/backend/src/test/resources/tests/query/MERGE/OR_EVENT_DATE_EXCLUDED/expected.csv +++ b/backend/src/test/resources/tests/query/MERGE/OR_EVENT_DATE_EXCLUDED/expected.csv @@ -1,6 +1,6 @@ result,dates,tree - a - dates -1,,2012-01-01/2012-01-01 -2,2012-01-01/2012-01-01,2012-01-01/2012-01-01 -3,2012-01-02/2012-01-02,2012-01-01/2012-01-01 -4,2012-01-02/2012-01-02,2012-01-01/2012-01-02 +1,,2012-01-01 +2,2012-01-01,2012-01-01 +3,2012-01-02,2012-01-01 +4,2012-01-02,2012-01-01/2012-01-02 5,2012-01-02/2012-01-05,2012-01-01/2012-01-04 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/MULTIPLE_CONNECTORS_QUERY/expected.csv b/backend/src/test/resources/tests/query/MULTIPLE_CONNECTORS_QUERY/expected.csv index 225e384fcd..f452317949 100644 --- a/backend/src/test/resources/tests/query/MULTIPLE_CONNECTORS_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/MULTIPLE_CONNECTORS_QUERY/expected.csv @@ -1,2 +1,2 @@ result,dates -1,2012-01-01/2012-01-01 \ No newline at end of file +1,2012-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/MULTIPLE_TABLES_ICD_QUERY2/expected.csv b/backend/src/test/resources/tests/query/MULTIPLE_TABLES_ICD_QUERY2/expected.csv index f3afb60729..d296887bf5 100644 --- a/backend/src/test/resources/tests/query/MULTIPLE_TABLES_ICD_QUERY2/expected.csv +++ b/backend/src/test/resources/tests/query/MULTIPLE_TABLES_ICD_QUERY2/expected.csv @@ -1,8 +1,8 @@ result,dates -2,2017-06-01/2017-06-01 -3,2017-03-31/2017-03-31 -4,"2017-03-31/2017-03-31, 2017-06-01/2017-06-01" -5,2017-03-31/2017-03-31 -6,"2017-03-31/2017-03-31, 2017-05-31/2017-05-31" -7,"2017-03-31/2017-03-31, 2017-05-15/2017-05-15, 2017-06-01/2017-06-01, 2017-09-01/2017-09-01" -17,2017-06-01/2017-06-01 \ No newline at end of file +2,2017-06-01 +3,2017-03-31 +4,"2017-03-31, 2017-06-01" +5,2017-03-31 +6,"2017-03-31, 2017-05-31" +7,"2017-03-31, 2017-05-15, 2017-06-01, 2017-09-01" +17,2017-06-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/MULTI_CONCEPT_QUERY_SEPARATE_DATES/expected.csv b/backend/src/test/resources/tests/query/MULTI_CONCEPT_QUERY_SEPARATE_DATES/expected.csv index f1a509b449..022f906178 100644 --- a/backend/src/test/resources/tests/query/MULTI_CONCEPT_QUERY_SEPARATE_DATES/expected.csv +++ b/backend/src/test/resources/tests/query/MULTI_CONCEPT_QUERY_SEPARATE_DATES/expected.csv @@ -1,3 +1,3 @@ result,dates,test_tree - test_child1 - dates,test_tree2 - test_child1 - dates -1,2012-01-01/2012-01-02,2012-01-01/2012-01-01,2012-01-02/2012-01-02 -3,2013-11-10/2013-11-10,2013-11-10/2013-11-10,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01/2012-01-02,2012-01-01,2012-01-02 +3,2013-11-10,2013-11-10,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/MULTI_CONNECTOR_QUERY_SEPARATE_DATES/expected.csv b/backend/src/test/resources/tests/query/MULTI_CONNECTOR_QUERY_SEPARATE_DATES/expected.csv index 83ee2d2796..4a1c01cac5 100644 --- a/backend/src/test/resources/tests/query/MULTI_CONNECTOR_QUERY_SEPARATE_DATES/expected.csv +++ b/backend/src/test/resources/tests/query/MULTI_CONNECTOR_QUERY_SEPARATE_DATES/expected.csv @@ -1,3 +1,3 @@ result,dates,test_tree - test_child1 - tree_label dates -1,2012-01-01/2012-01-02,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01/2012-01-02,2012-01-01 +3,2013-11-10,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv index 225e384fcd..f452317949 100644 --- a/backend/src/test/resources/tests/query/MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/MULTI_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv @@ -1,2 +1,2 @@ result,dates -1,2012-01-01/2012-01-01 \ No newline at end of file +1,2012-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/RESTART_TEST_DATA/expected.csv b/backend/src/test/resources/tests/query/RESTART_TEST_DATA/expected.csv index 443c6a4fd1..1c71038578 100644 --- a/backend/src/test/resources/tests/query/RESTART_TEST_DATA/expected.csv +++ b/backend/src/test/resources/tests/query/RESTART_TEST_DATA/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01 +3,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/REUSED_QUERY/expected.csv b/backend/src/test/resources/tests/query/REUSED_QUERY/expected.csv index 0885ce7d18..8e8ea51ae9 100644 --- a/backend/src/test/resources/tests/query/REUSED_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/REUSED_QUERY/expected.csv @@ -1,12 +1,12 @@ result,dates -2,2009-12-01/2009-12-01 -5,2007-01-01/2007-01-01 -6,2007-01-01/2007-01-01 -15,"2012-01-01/2012-01-01, 2014-01-01/2014-01-01" -27,2014-01-01/2014-01-01 -31,2006-01-01/2006-01-01 -32,2014-01-01/2014-01-01 -40,2012-04-01/2012-04-01 -58,2010-01-01/2010-01-01 -64,2014-01-01/2014-01-01 -68,2006-01-01/2006-01-01 \ No newline at end of file +2,2009-12-01 +5,2007-01-01 +6,2007-01-01 +15,"2012-01-01, 2014-01-01" +27,2014-01-01 +31,2006-01-01 +32,2014-01-01 +40,2012-04-01 +58,2010-01-01 +64,2014-01-01 +68,2006-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/REUSED_QUERY/query_results_1.csv b/backend/src/test/resources/tests/query/REUSED_QUERY/query_results_1.csv index 96f20ab474..3517901008 100644 --- a/backend/src/test/resources/tests/query/REUSED_QUERY/query_results_1.csv +++ b/backend/src/test/resources/tests/query/REUSED_QUERY/query_results_1.csv @@ -1,12 +1,12 @@ "result","dates" -2,2009-12-01/2009-12-01 -5,2007-01-01/2007-01-01 -6,2007-01-01/2007-01-01 -15,"2012-01-01/2012-01-01, 2014-01-01/2014-01-01" -27,2014-01-01/2014-01-01 -31,2006-01-01/2006-01-01 -32,2014-01-01/2014-01-01 -40,2012-04-01/2012-04-01 -58,2010-01-01/2010-01-01 -64,2014-01-01/2014-01-01 -68,2006-01-01/2006-01-01 \ No newline at end of file +2,2009-12-01 +5,2007-01-01 +6,2007-01-01 +15,"2012-01-01, 2014-01-01" +27,2014-01-01 +31,2006-01-01 +32,2014-01-01 +40,2012-04-01 +58,2010-01-01 +64,2014-01-01 +68,2006-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/REUSED_QUERY/query_results_2.csv b/backend/src/test/resources/tests/query/REUSED_QUERY/query_results_2.csv index 835fb5472a..01d728e6db 100644 --- a/backend/src/test/resources/tests/query/REUSED_QUERY/query_results_2.csv +++ b/backend/src/test/resources/tests/query/REUSED_QUERY/query_results_2.csv @@ -1,11 +1,11 @@ "result","dates" -9978,2012-01-01/2012-01-01 -9977,2010-01-01/2010-01-01 -9974,2011-01-01/2011-01-01 -9969,2007-01-01/2007-01-01 -9962,2014-01-01/2014-01-01 -9944,2008-08-01/2008-08-01 -9926,2010-01-01/2010-01-01 -9896,2013-04-01/2013-04-01 -9893,2012-01-01/2012-01-01 -9886,2011-01-01/2011-01-01 \ No newline at end of file +9978,2012-01-01 +9977,2010-01-01 +9974,2011-01-01 +9969,2007-01-01 +9962,2014-01-01 +9944,2008-08-01 +9926,2010-01-01 +9896,2013-04-01 +9893,2012-01-01 +9886,2011-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SECONDARY_ID/content.csv b/backend/src/test/resources/tests/query/SECONDARY_ID/content.csv index adf8faca3b..760de129f4 100644 --- a/backend/src/test/resources/tests/query/SECONDARY_ID/content.csv +++ b/backend/src/test/resources/tests/query/SECONDARY_ID/content.csv @@ -1,7 +1,7 @@ pid,sid,value,datum a,f_a1,1,"2014-06-30/2015-06-30" -a,f_a1,1,"2016-06-30/2016-06-30" +a,f_a1,1,"2016-06-30" a,f_a2,1,"2014-06-30/2015-06-30" -a,,1,"2010-06-30/2010-06-30" +a,,1,"2010-06-30" a,f_a3,1.01,"2014-06-30/2015-06-30" b,f_b1,1,"2015-02-03/2015-06-30" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SECONDARY_ID/content2.csv b/backend/src/test/resources/tests/query/SECONDARY_ID/content2.csv index 341cac8290..e3daab5b15 100644 --- a/backend/src/test/resources/tests/query/SECONDARY_ID/content2.csv +++ b/backend/src/test/resources/tests/query/SECONDARY_ID/content2.csv @@ -1,7 +1,7 @@ pid,sid,value,datum a,f_a4,1,"2024-06-30/2025-06-30" -a,f_a4,1,"2026-06-30/2026-06-30" +a,f_a4,1,"2026-06-30" a,f_a4,1,"2024-06-30/2025-06-30" -a,,13,"2020-06-30/2020-06-30" +a,,13,"2020-06-30" a,f_a5,1.01,"2024-06-30/2025-06-30" b,f_b6,1,"2025-02-03/2025-06-30" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SECONDARY_ID/expected.csv b/backend/src/test/resources/tests/query/SECONDARY_ID/expected.csv index b2be405b8a..92c3dd39b1 100644 --- a/backend/src/test/resources/tests/query/SECONDARY_ID/expected.csv +++ b/backend/src/test/resources/tests/query/SECONDARY_ID/expected.csv @@ -1,6 +1,6 @@ result,secondary,dates -a,f_a1,"2014-06-30/2015-06-30, 2016-06-30/2016-06-30" +a,f_a1,"2014-06-30/2015-06-30, 2016-06-30" a,f_a2,2014-06-30/2015-06-30 b,f_b1,2015-02-03/2015-06-30 -a,f_a4,"2024-06-30/2025-06-30, 2026-06-30/2026-06-30" +a,f_a4,"2024-06-30/2025-06-30, 2026-06-30" b,f_b6,2025-02-03/2025-06-30 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/content.csv b/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/content.csv index af01f4ad60..60a239eff9 100644 --- a/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/content.csv +++ b/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/content.csv @@ -2,4 +2,4 @@ pid,sid,value,datum a,f_a1,1,"2014-06-30/2015-06-30" a,f_a1,1,"2016-06-30/2027-06-30" a,f_a2,1,"2014-06-30/2015-06-30" -a,,1,"2010-06-30/2010-06-30" \ No newline at end of file +a,,1,"2010-06-30" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/content2.csv b/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/content2.csv index 26b8b4c28f..3535673f2f 100644 --- a/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/content2.csv +++ b/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/content2.csv @@ -1,5 +1,5 @@ pid,sid,value,datum a,f_a1,1,"2024-06-30/2025-06-30" -a,f_a1,1,"2026-06-30/2026-06-30" +a,f_a1,1,"2026-06-30" a,f_a2,1,"2024-06-30/2025-06-30" -a,,13,"2020-06-30/2020-06-30" \ No newline at end of file +a,,13,"2020-06-30" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/expected.csv b/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/expected.csv index 60f5b83fc6..ba4ab8333a 100644 --- a/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/expected.csv +++ b/backend/src/test/resources/tests/query/SECONDARY_ID_DATEMODE_LOGICAL/expected.csv @@ -1,3 +1,3 @@ result,secondary,dates -a,f_a1,"2024-06-30/2025-06-30, 2026-06-30/2026-06-30" +a,f_a1,"2024-06-30/2025-06-30, 2026-06-30" a,f_a2, \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SECONDARY_ID_EXCLUDED/expected.csv b/backend/src/test/resources/tests/query/SECONDARY_ID_EXCLUDED/expected.csv index 24a7b15402..0f84d9f5cd 100644 --- a/backend/src/test/resources/tests/query/SECONDARY_ID_EXCLUDED/expected.csv +++ b/backend/src/test/resources/tests/query/SECONDARY_ID_EXCLUDED/expected.csv @@ -1,6 +1,6 @@ result,secondary,dates -p0,f0,2020-01-01/2020-01-01 -p0,f1,2020-01-01/2020-01-01 -p1,f1,2020-01-01/2020-01-01 -p2,f0,2020-01-01/2020-01-01 -p2,f1,2020-01-01/2020-01-01 \ No newline at end of file +p0,f0,2020-01-01 +p0,f1,2020-01-01 +p1,f1,2020-01-01 +p2,f0,2020-01-01 +p2,f1,2020-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/content.csv b/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/content.csv index 882b7b8cf5..b907dcd17b 100644 --- a/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/content.csv +++ b/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/content.csv @@ -1,7 +1,7 @@ pid,sid,value,datum,ignored a,f_a1,1,"2014-06-30/2015-06-30","a" -a,f_a1,1,"2016-06-30/2016-06-30","a" +a,f_a1,1,"2016-06-30","a" a,f_a2,1,"2014-06-30/2015-06-30","a" -a,,1,"2010-06-30/2010-06-30","a" +a,,1,"2010-06-30","a" a,f_a3,1.01,"2014-06-30/2015-06-30","a" b,f_b1,1,"2015-02-03/2015-06-30","a" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/content2.csv b/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/content2.csv index 341cac8290..e3daab5b15 100644 --- a/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/content2.csv +++ b/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/content2.csv @@ -1,7 +1,7 @@ pid,sid,value,datum a,f_a4,1,"2024-06-30/2025-06-30" -a,f_a4,1,"2026-06-30/2026-06-30" +a,f_a4,1,"2026-06-30" a,f_a4,1,"2024-06-30/2025-06-30" -a,,13,"2020-06-30/2020-06-30" +a,,13,"2020-06-30" a,f_a5,1.01,"2024-06-30/2025-06-30" b,f_b6,1,"2025-02-03/2025-06-30" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/expected.csv b/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/expected.csv index 27b854b94b..babec2ca68 100644 --- a/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/expected.csv +++ b/backend/src/test/resources/tests/query/SECONDARY_ID_MIXED/expected.csv @@ -1,5 +1,5 @@ result,secondary,dates -a,f_a3,"2024-06-30/2025-06-30, 2026-06-30/2026-06-30" -a,f_a2,"2014-06-30/2015-06-30, 2024-06-30/2025-06-30, 2026-06-30/2026-06-30" -a,f_a1,"2014-06-30/2015-06-30, 2016-06-30/2016-06-30, 2024-06-30/2025-06-30, 2026-06-30/2026-06-30" +a,f_a3,"2024-06-30/2025-06-30, 2026-06-30" +a,f_a2,"2014-06-30/2015-06-30, 2024-06-30/2025-06-30, 2026-06-30" +a,f_a1,"2014-06-30/2015-06-30, 2016-06-30, 2024-06-30/2025-06-30, 2026-06-30" b,f_b1,"2015-02-03/2015-06-30, 2025-02-03/2025-06-30" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SIMPLE_CQEXTERNAL_QUERY/expected.csv b/backend/src/test/resources/tests/query/SIMPLE_CQEXTERNAL_QUERY/expected.csv index 443c6a4fd1..1c71038578 100644 --- a/backend/src/test/resources/tests/query/SIMPLE_CQEXTERNAL_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/SIMPLE_CQEXTERNAL_QUERY/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01 +3,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_CONNECTOR_CONDITION_WITH_CHILDREN_QUERY/expected.csv b/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_CONNECTOR_CONDITION_WITH_CHILDREN_QUERY/expected.csv index ce93de1599..30b651eca6 100644 --- a/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_CONNECTOR_CONDITION_WITH_CHILDREN_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_CONNECTOR_CONDITION_WITH_CHILDREN_QUERY/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 +1,2012-01-01 +3,2013-11-10 diff --git a/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_GROOVY_QUERY/expected.csv b/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_GROOVY_QUERY/expected.csv index 8b14139022..013395e05e 100644 --- a/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_GROOVY_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_GROOVY_QUERY/expected.csv @@ -1,2 +1,2 @@ result,dates -3,2013-11-10/2013-11-10 \ No newline at end of file +3,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_PRESENT_CONDITION_QUERY/expected.csv b/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_PRESENT_CONDITION_QUERY/expected.csv index 443c6a4fd1..1c71038578 100644 --- a/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_PRESENT_CONDITION_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_PRESENT_CONDITION_QUERY/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01 +3,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_QUERY/expected.csv index 443c6a4fd1..1c71038578 100644 --- a/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_QUERY/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01 +3,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_QUERY_SPECIAL_CHAR_DATA/expected.csv b/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_QUERY_SPECIAL_CHAR_DATA/expected.csv index 443c6a4fd1..1c71038578 100644 --- a/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_QUERY_SPECIAL_CHAR_DATA/expected.csv +++ b/backend/src/test/resources/tests/query/SIMPLE_TREECONCEPT_QUERY_SPECIAL_CHAR_DATA/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01 +3,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SIMPLE_VIRTUAL_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/SIMPLE_VIRTUAL_CONCEPT_QUERY/expected.csv index 443c6a4fd1..1c71038578 100644 --- a/backend/src/test/resources/tests/query/SIMPLE_VIRTUAL_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/SIMPLE_VIRTUAL_CONCEPT_QUERY/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01 +3,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SINGLE_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/SINGLE_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv index 225e384fcd..f452317949 100644 --- a/backend/src/test/resources/tests/query/SINGLE_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/SINGLE_SELECT_DATE_RESTRICTION_OR_CONCEPT_QUERY/expected.csv @@ -1,2 +1,2 @@ result,dates -1,2012-01-01/2012-01-01 \ No newline at end of file +1,2012-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/SUM_EMPTY_DATE_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/SUM_EMPTY_DATE_CONCEPT_QUERY/expected.csv index 4d50fe2b6b..3cd343c426 100644 --- a/backend/src/test/resources/tests/query/SUM_EMPTY_DATE_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/SUM_EMPTY_DATE_CONCEPT_QUERY/expected.csv @@ -1,3 +1,3 @@ result,dates -4,"2010-01-02/2010-01-02, 2010-01-04/2010-01-04" -44,"2010-01-02/2010-01-02, 2010-01-04/2010-01-04" \ No newline at end of file +4,"2010-01-02, 2010-01-04" +44,"2010-01-02, 2010-01-04" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/TABLE_EXPORT/content.csv b/backend/src/test/resources/tests/query/TABLE_EXPORT/content.csv index adf8faca3b..760de129f4 100644 --- a/backend/src/test/resources/tests/query/TABLE_EXPORT/content.csv +++ b/backend/src/test/resources/tests/query/TABLE_EXPORT/content.csv @@ -1,7 +1,7 @@ pid,sid,value,datum a,f_a1,1,"2014-06-30/2015-06-30" -a,f_a1,1,"2016-06-30/2016-06-30" +a,f_a1,1,"2016-06-30" a,f_a2,1,"2014-06-30/2015-06-30" -a,,1,"2010-06-30/2010-06-30" +a,,1,"2010-06-30" a,f_a3,1.01,"2014-06-30/2015-06-30" b,f_b1,1,"2015-02-03/2015-06-30" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/TABLE_EXPORT/content2.csv b/backend/src/test/resources/tests/query/TABLE_EXPORT/content2.csv index 341cac8290..e3daab5b15 100644 --- a/backend/src/test/resources/tests/query/TABLE_EXPORT/content2.csv +++ b/backend/src/test/resources/tests/query/TABLE_EXPORT/content2.csv @@ -1,7 +1,7 @@ pid,sid,value,datum a,f_a4,1,"2024-06-30/2025-06-30" -a,f_a4,1,"2026-06-30/2026-06-30" +a,f_a4,1,"2026-06-30" a,f_a4,1,"2024-06-30/2025-06-30" -a,,13,"2020-06-30/2020-06-30" +a,,13,"2020-06-30" a,f_a5,1.01,"2024-06-30/2025-06-30" b,f_b6,1,"2025-02-03/2025-06-30" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/TABLE_EXPORT/expected.csv b/backend/src/test/resources/tests/query/TABLE_EXPORT/expected.csv index 6de95c07a7..694fb4f756 100644 --- a/backend/src/test/resources/tests/query/TABLE_EXPORT/expected.csv +++ b/backend/src/test/resources/tests/query/TABLE_EXPORT/expected.csv @@ -1,8 +1,8 @@ result,dates,SecondaryId,table1 - value,table2 - value a,2014-06-30/2015-06-30,f_a1,1.0, -a,2016-06-30/2016-06-30,f_a1,1.0, +a,2016-06-30,f_a1,1.0, a,2014-06-30/2015-06-30,f_a2,1.0, -a,2010-06-30/2010-06-30,,1.0, +a,2010-06-30,,1.0, a,2014-06-30/2015-06-30,f_a3,1.01, -a,2020-06-30/2020-06-30,,,13.0 +a,2020-06-30,,,13.0 b,2015-02-03/2015-06-30,f_b1,1.0, \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/TEMPORAL_BEFORE_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/TEMPORAL_BEFORE_CONCEPT_QUERY/expected.csv index 40acdeebbf..62e87ee5f4 100644 --- a/backend/src/test/resources/tests/query/TEMPORAL_BEFORE_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/TEMPORAL_BEFORE_CONCEPT_QUERY/expected.csv @@ -1,2 +1,2 @@ result,dates -4,2011-01-06/2011-01-06 \ No newline at end of file +4,2011-01-06 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/TEMPORAL_BEFORE_OR_SAME_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/TEMPORAL_BEFORE_OR_SAME_CONCEPT_QUERY/expected.csv index 714702dca1..fc7d9baaa2 100644 --- a/backend/src/test/resources/tests/query/TEMPORAL_BEFORE_OR_SAME_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/TEMPORAL_BEFORE_OR_SAME_CONCEPT_QUERY/expected.csv @@ -1,4 +1,4 @@ result,dates -1,2011-01-02/2011-01-02 -3,2011-01-01/2011-01-01 -5,"2011-01-01/2011-01-01, 2011-02-02/2011-02-02" \ No newline at end of file +1,2011-01-02 +3,2011-01-01 +5,"2011-01-01, 2011-02-02" \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/TEMPORAL_DAYS_BEFORE_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/TEMPORAL_DAYS_BEFORE_CONCEPT_QUERY/expected.csv index 40acdeebbf..62e87ee5f4 100644 --- a/backend/src/test/resources/tests/query/TEMPORAL_DAYS_BEFORE_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/TEMPORAL_DAYS_BEFORE_CONCEPT_QUERY/expected.csv @@ -1,2 +1,2 @@ result,dates -4,2011-01-06/2011-01-06 \ No newline at end of file +4,2011-01-06 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/TEMPORAL_DAYS_BEFORE_OR_NEVER_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/TEMPORAL_DAYS_BEFORE_OR_NEVER_CONCEPT_QUERY/expected.csv index fc3fb6fe0f..77002ad27d 100644 --- a/backend/src/test/resources/tests/query/TEMPORAL_DAYS_BEFORE_OR_NEVER_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/TEMPORAL_DAYS_BEFORE_OR_NEVER_CONCEPT_QUERY/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2012-01-01/2012-01-01 -3,2012-11-12/2012-11-12 \ No newline at end of file +1,2012-01-01 +3,2012-11-12 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/TEMPORAL_SAME_CONCEPT_QUERY/expected.csv b/backend/src/test/resources/tests/query/TEMPORAL_SAME_CONCEPT_QUERY/expected.csv index 145fcd42b1..498bc146b0 100644 --- a/backend/src/test/resources/tests/query/TEMPORAL_SAME_CONCEPT_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/TEMPORAL_SAME_CONCEPT_QUERY/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2011-01-01/2011-01-01 -3,2011-01-01/2011-01-01 +1,2011-01-01 +3,2011-01-01 diff --git a/backend/src/test/resources/tests/query/UPDATE_CONCEPT_TESTS/expected.csv b/backend/src/test/resources/tests/query/UPDATE_CONCEPT_TESTS/expected.csv index ede1879bc5..bb10a85659 100644 --- a/backend/src/test/resources/tests/query/UPDATE_CONCEPT_TESTS/expected.csv +++ b/backend/src/test/resources/tests/query/UPDATE_CONCEPT_TESTS/expected.csv @@ -1,4 +1,4 @@ result,dates -1,2012-01-01/2012-01-01 -3,2013-11-10/2013-11-10 -4,2013-11-10/2013-11-10 \ No newline at end of file +1,2012-01-01 +3,2013-11-10 +4,2013-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/VALIDITY_DATE_QUERY/expected.csv b/backend/src/test/resources/tests/query/VALIDITY_DATE_QUERY/expected.csv index 484f5086e5..63200a4650 100644 --- a/backend/src/test/resources/tests/query/VALIDITY_DATE_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/VALIDITY_DATE_QUERY/expected.csv @@ -1,3 +1,3 @@ result,dates -1,2013-01-01/2013-01-01 -3,2014-11-10/2014-11-10 \ No newline at end of file +1,2013-01-01 +3,2014-11-10 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/VIRTUAL_CONCEPT_REUSED_QUERY/expected.csv b/backend/src/test/resources/tests/query/VIRTUAL_CONCEPT_REUSED_QUERY/expected.csv index 7b493b16cc..1ccb5c6bb6 100644 --- a/backend/src/test/resources/tests/query/VIRTUAL_CONCEPT_REUSED_QUERY/expected.csv +++ b/backend/src/test/resources/tests/query/VIRTUAL_CONCEPT_REUSED_QUERY/expected.csv @@ -1,5 +1,5 @@ result,dates -5,2007-01-01/2007-01-01 -19,2012-01-01/2012-01-01 -32,2014-01-01/2014-01-01 -64,2014-01-01/2014-01-01 \ No newline at end of file +5,2007-01-01 +19,2012-01-01 +32,2014-01-01 +64,2014-01-01 \ No newline at end of file diff --git a/backend/src/test/resources/tests/query/VIRTUAL_CONCEPT_REUSED_QUERY/query_results.csv b/backend/src/test/resources/tests/query/VIRTUAL_CONCEPT_REUSED_QUERY/query_results.csv index aab90cac40..8c81ea00fa 100644 --- a/backend/src/test/resources/tests/query/VIRTUAL_CONCEPT_REUSED_QUERY/query_results.csv +++ b/backend/src/test/resources/tests/query/VIRTUAL_CONCEPT_REUSED_QUERY/query_results.csv @@ -1,5 +1,5 @@ result,"dates" -5,2007-01-01/2007-01-01 -19,2012-01-01/2012-01-01 -32,2014-01-01/2014-01-01 -64,2014-01-01/2014-01-01 \ No newline at end of file +5,2007-01-01 +19,2012-01-01 +32,2014-01-01 +64,2014-01-01 \ No newline at end of file diff --git a/frontend/src/localization/de.json b/frontend/src/localization/de.json index d974e2cd0f..23301a9f42 100644 --- a/frontend/src/localization/de.json +++ b/frontend/src/localization/de.json @@ -323,9 +323,9 @@ "colon": "Doppelpunkt", "comma": "Komma", "id": "ID", - "dateSet": "Datumsmenge", - "dateRange": "Datumsbereich", - "eventDate": "Einzeldatum", + "dateSet": "Datumswerte", + "dateRange": "Datumsbereich (REMOVE)", + "eventDate": "Einzeldatum (REMOVE)", "startDate": "Startdatum", "endDate": "Enddatum", "ignore": "Ignorieren", diff --git a/frontend/src/localization/en.json b/frontend/src/localization/en.json index be9e10c0cc..d54fd79b74 100644 --- a/frontend/src/localization/en.json +++ b/frontend/src/localization/en.json @@ -323,11 +323,11 @@ "colon": "Colon", "comma": "Comma", "id": "ID", - "dateSet": "Date set", - "dateRange": "Date range", - "eventDate": "Single date", - "startDate": "Start date", - "endDate": "End date", + "dateSet": "Date Set", + "dateRange": "Date Range (REMOVE)", + "eventDate": "Single Date (REMOVE)", + "startDate": "Start Date", + "endDate": "End Date", "ignore": "IGNORE", "partialSuccess": "Upload partially successful.", "resolved": "1 line resolved.", From c64bb743e47b7d5ec5c4eeb382461f0d62002cdc Mon Sep 17 00:00:00 2001 From: Thonagel <12283268+thoniTUB@users.noreply.github.com> Date: Thu, 26 Aug 2021 16:56:02 +0200 Subject: [PATCH 2/3] surround date range separator by spaces --- .../java/com/bakdata/conquery/models/config/LocaleConfig.java | 2 +- .../conquery/models/externalservice/ResultTypeTest.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/com/bakdata/conquery/models/config/LocaleConfig.java b/backend/src/main/java/com/bakdata/conquery/models/config/LocaleConfig.java index 0729f4be57..8841ff45e7 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/config/LocaleConfig.java +++ b/backend/src/main/java/com/bakdata/conquery/models/config/LocaleConfig.java @@ -45,7 +45,7 @@ public class LocaleConfig { */ @NotEmpty private Map localeRangeStartEndSeparators = Map.of( - Locale.GERMAN, "-", + Locale.GERMAN, " - ", Locale.ROOT, "/" ); diff --git a/backend/src/test/java/com/bakdata/conquery/models/externalservice/ResultTypeTest.java b/backend/src/test/java/com/bakdata/conquery/models/externalservice/ResultTypeTest.java index 40afdee927..da645ca8f1 100644 --- a/backend/src/test/java/com/bakdata/conquery/models/externalservice/ResultTypeTest.java +++ b/backend/src/test/java/com/bakdata/conquery/models/externalservice/ResultTypeTest.java @@ -48,6 +48,10 @@ public static List testData() { Arguments.of(PRETTY_DE, ResultType.ResolutionT.INSTANCE, DateContext.Resolution.COMPLETE.name(), "Gesamt"), Arguments.of(PRETTY, ResultType.DateT.INSTANCE, LocalDate.of(2013, 7, 12).toEpochDay(), "2013-07-12"), Arguments.of(PRETTY_DE, ResultType.DateT.INSTANCE, LocalDate.of(2013, 7, 12).toEpochDay(), "12.07.2013"), + Arguments.of(PRETTY, ResultType.DateRangeT.INSTANCE, List.of(Long.valueOf(LocalDate.of(2013, 7, 12).toEpochDay()).intValue(), Long.valueOf(LocalDate.of(2013, 7, 12).toEpochDay()).intValue()), "2013-07-12"), + Arguments.of(PRETTY_DE, ResultType.DateRangeT.INSTANCE, List.of(Long.valueOf(LocalDate.of(2013, 7, 12).toEpochDay()).intValue(), Long.valueOf(LocalDate.of(2013, 7, 12).toEpochDay()).intValue()), "12.07.2013"), + Arguments.of(PRETTY, ResultType.DateRangeT.INSTANCE, List.of(Long.valueOf(LocalDate.of(2013, 7, 12).toEpochDay()).intValue(), Long.valueOf(LocalDate.of(2014, 7, 12).toEpochDay()).intValue()), "2013-07-12/2014-07-12"), + Arguments.of(PRETTY_DE, ResultType.DateRangeT.INSTANCE, List.of(Long.valueOf(LocalDate.of(2013, 7, 12).toEpochDay()).intValue(), Long.valueOf(LocalDate.of(2014, 7, 12).toEpochDay()).intValue()), "12.07.2013 - 12.07.2014"), Arguments.of(PRETTY, ResultType.IntegerT.INSTANCE, 51839274, "51,839,274"), Arguments.of(PRETTY_DE, ResultType.IntegerT.INSTANCE, 51839274, "51.839.274"), Arguments.of(PRETTY, ResultType.MoneyT.INSTANCE, 51839274L, "518,392.74"), From 1b904757779b0cad36a727927fe96d273d10e6d5 Mon Sep 17 00:00:00 2001 From: "Max.Thonagel" <12283268+thoniTUB@users.noreply.github.com> Date: Thu, 26 Aug 2021 17:10:12 +0200 Subject: [PATCH 3/3] small performance improvement --- .../models/externalservice/ResultType.java | 567 +++++++++--------- 1 file changed, 285 insertions(+), 282 deletions(-) diff --git a/backend/src/main/java/com/bakdata/conquery/models/externalservice/ResultType.java b/backend/src/main/java/com/bakdata/conquery/models/externalservice/ResultType.java index 542b2ece3a..6d667b420b 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/externalservice/ResultType.java +++ b/backend/src/main/java/com/bakdata/conquery/models/externalservice/ResultType.java @@ -1,282 +1,285 @@ -package com.bakdata.conquery.models.externalservice; - -import c10n.C10N; -import com.bakdata.conquery.internationalization.Results; -import com.bakdata.conquery.io.cps.CPSBase; -import com.bakdata.conquery.io.cps.CPSType; -import com.bakdata.conquery.models.common.CDate; -import com.bakdata.conquery.models.events.MajorTypeId; -import com.bakdata.conquery.models.forms.util.DateContext; -import com.bakdata.conquery.models.query.PrintSettings; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.base.Preconditions; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.StringJoiner; - -@JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, property = "type") -@CPSBase -@Slf4j -public abstract class ResultType { - - public String printNullable(PrintSettings cfg, Object f) { - if (f == null) { - return ""; - } - return print(cfg, f); - } - - protected String print(PrintSettings cfg, @NonNull Object f) { - return f.toString(); - } - - public abstract String typeInfo(); - - public static ResultType resolveResultType(MajorTypeId majorTypeId) { - switch (majorTypeId) { - case STRING: - return StringT.INSTANCE; - case BOOLEAN: - return BooleanT.INSTANCE; - case DATE: - return DateT.INSTANCE; - case DATE_RANGE: - return DateRangeT.INSTANCE; - case INTEGER: - return IntegerT.INSTANCE; - case MONEY: - return MoneyT.INSTANCE; - case DECIMAL: - case REAL: - return NumericT.INSTANCE; - default: - throw new IllegalStateException(String.format("Invalid column type '%s'", majorTypeId)); - } - } - - abstract static class PrimitiveResultType extends ResultType { - @Override - public String typeInfo() { - return this.getClass().getAnnotation(CPSType.class).id(); - } - - @Override - public String toString() { - return typeInfo(); - } - } - - @CPSType(id = "BOOLEAN", base = ResultType.class) - @NoArgsConstructor(access = AccessLevel.PRIVATE) - public static class BooleanT extends PrimitiveResultType { - @Getter(onMethod_ = @JsonCreator) - public static final BooleanT INSTANCE = new BooleanT(); - - @Override - public String print(PrintSettings cfg, Object f) { - Preconditions.checkArgument(f instanceof Boolean, "Expected boolean value, but got %s", f.getClass().getName()); - - if(cfg.isPrettyPrint()) { - //TODO this might be incredibly slow, probably better to cache this in the instance but we need to not use Singletons for that - return (Boolean) f ? C10N.get(Results.class, cfg.getLocale()).True() : C10N.get(Results.class, cfg.getLocale()).False(); - } - - return (Boolean) f ? "1" : "0"; - } - } - - - @CPSType(id = "INTEGER", base = ResultType.class) - @NoArgsConstructor(access = AccessLevel.PRIVATE) - public static class IntegerT extends PrimitiveResultType { - @Getter(onMethod_ = @JsonCreator) - public static final IntegerT INSTANCE = new IntegerT(); - - @Override - public String print(PrintSettings cfg, Object f) { - if (cfg.isPrettyPrint()) { - return cfg.getIntegerFormat().format(((Number) f).longValue()); - } - return f.toString(); - } - } - - @CPSType(id = "NUMERIC", base = ResultType.class) - @NoArgsConstructor(access = AccessLevel.PRIVATE) - public static class NumericT extends PrimitiveResultType { - @Getter(onMethod_ = @JsonCreator) - public static final NumericT INSTANCE = new NumericT(); - - @Override - public String print(PrintSettings cfg, Object f) { - if(cfg.isPrettyPrint()) { - return cfg.getDecimalFormat().format(f); - } - return f.toString(); - } - } - - @CPSType(id = "CATEGORICAL", base = ResultType.class) - @NoArgsConstructor(access = AccessLevel.PRIVATE) - public static class CategoricalT extends PrimitiveResultType { - @Getter(onMethod_ = @JsonCreator) - public static final CategoricalT INSTANCE = new CategoricalT(); - } - - @CPSType(id = "RESOLUTION", base = ResultType.class) - @NoArgsConstructor(access = AccessLevel.PRIVATE) - public static class ResolutionT extends PrimitiveResultType { - @Getter(onMethod_ = @JsonCreator) - public static final ResolutionT INSTANCE = new ResolutionT(); - - @Override - public String print(PrintSettings cfg, Object f) { - if (f instanceof DateContext.Resolution) { - return ((DateContext.Resolution) f).toString(cfg.getLocale()); - } - try { - // If the object was parsed as a simple string, try to convert it to a - // DateContextMode to get Internationalization - return DateContext.Resolution.valueOf(f.toString()).toString(cfg.getLocale()); - } catch (Exception e) { - throw new IllegalArgumentException(f + " is not a valid resolution.", e); - } - } - } - - @CPSType(id = "DATE", base = ResultType.class) - @NoArgsConstructor(access = AccessLevel.PRIVATE) - public static class DateT extends PrimitiveResultType { - @Getter(onMethod_ = @JsonCreator) - public static final DateT INSTANCE = new DateT(); - - @Override - public String print(PrintSettings cfg, @NonNull Object f) { - if(!(f instanceof Number)) { - throw new IllegalStateException("Expected an Number but got an '" + f.getClass().getName() + "' with the value: " + f); - } - final Number number = (Number) f; - if (cfg.isPrettyPrint()) { - return print(number, cfg.getDateFormatter()); - } - return CDate.toLocalDate(number.intValue()).toString(); - } - - public static String print(Number num, DateTimeFormatter formatter) { - return formatter.format(LocalDate.ofEpochDay(num.intValue())); - } - - - } - - /** - * A DateRange is provided by in a query result as two ints in a list, both standing for an epoch day (see {@link LocalDate#toEpochDay()}). - * The first int describes the included lower bound of the range. The second int descibes the included upper bound. - */ - @CPSType(id = "DATE_RANGE", base = ResultType.class) - @NoArgsConstructor(access = AccessLevel.PRIVATE) - public static class DateRangeT extends PrimitiveResultType { - @Getter(onMethod_ = @JsonCreator) - public static final DateRangeT INSTANCE = new DateRangeT(); - - @Override - public String print(PrintSettings cfg, @NonNull Object f) { - if(!(f instanceof List)) { - throw new IllegalStateException(String.format("Expected a List got %s (Type: %s, as string: %s)", f, f.getClass().getName(), f)); - } - List list = (List) f; - if(list.size() != 2) { - throw new IllegalStateException("Expected a list with 2 elements, one min, one max. The list was: " + list); - } - final DateTimeFormatter dateFormat = cfg.getDateFormatter(); - final Integer min = (Integer) list.get(0); - final Integer max = (Integer) list.get(1); - if (min == null || max == null) { - log.warn("Encountered incomplete range, treating it as an open range. Either min or max was null: {}", list); - } - String minString = min == null || min == Integer.MIN_VALUE ? "-∞" : ResultType.DateT.print(min, dateFormat); - String maxString = max == null || max == Integer.MAX_VALUE ? "+∞" : ResultType.DateT.print(max, dateFormat); - if (min != null && min.equals(max)){ - // If the min and max are the same we print it like a singe date, not a range - return minString; - } - return minString + cfg.getDateRangeSeparator() + maxString; - } - } - - @CPSType(id = "STRING", base = ResultType.class) - @NoArgsConstructor(access = AccessLevel.PRIVATE) - public static class StringT extends PrimitiveResultType { - @Getter(onMethod_ = @JsonCreator) - public static final StringT INSTANCE = new StringT(); - } - - @CPSType(id = "ID", base = ResultType.class) - @NoArgsConstructor(access = AccessLevel.PRIVATE) - public static class IdT extends PrimitiveResultType { - @Getter(onMethod_ = @JsonCreator) - public static final IdT INSTANCE = new IdT(); - } - - @CPSType(id = "MONEY", base = ResultType.class) - @NoArgsConstructor(access = AccessLevel.PRIVATE) - public static class MoneyT extends PrimitiveResultType { - - @Getter(onMethod_ = @JsonCreator) - public static final MoneyT INSTANCE = new MoneyT(); - - @Override - public String print(PrintSettings cfg, Object f) { - if (cfg.isPrettyPrint()) { - return cfg.getDecimalFormat().format(new BigDecimal(((Number) f).longValue()).movePointLeft(cfg.getCurrency().getDefaultFractionDigits())); - } - return IntegerT.INSTANCE.print(cfg, f); - } - } - - @CPSType(id = "LIST", base = ResultType.class) - @Getter - public static class ListT extends ResultType { - @NonNull - private final ResultType elementType; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - public ListT(@NonNull ResultType elementType) { - this.elementType = elementType; - } - - @Override - public String print(PrintSettings cfg, @NonNull Object f) { - // Jackson deserializes collections as lists instead of an array, if the type is not given - if(!(f instanceof List)) { - throw new IllegalStateException(String.format("Expected a List got %s (Type: %s, as string: %s)", f, f.getClass().getName(), f)); - } - // Not sure if this escaping is enough - String listDelimEscape = cfg.getListElementEscaper() + cfg.getListFormat().getSeparator(); - StringJoiner joiner = new StringJoiner(cfg.getListFormat().getSeparator(), cfg.getListFormat().getStart(),cfg.getListFormat().getEnd()); - for(Object obj : (List) f) { - joiner.add(elementType.print(cfg,obj).replace(cfg.getListFormat().getSeparator(), listDelimEscape)); - } - return joiner.toString(); - } - - @Override - public String typeInfo() { - return this.getClass().getAnnotation(CPSType.class).id() + "[" + elementType.typeInfo() + "]"; - } - - @Override - public String toString() { - return typeInfo(); - } - } -} +package com.bakdata.conquery.models.externalservice; + +import c10n.C10N; +import com.bakdata.conquery.internationalization.Results; +import com.bakdata.conquery.io.cps.CPSBase; +import com.bakdata.conquery.io.cps.CPSType; +import com.bakdata.conquery.models.common.CDate; +import com.bakdata.conquery.models.events.MajorTypeId; +import com.bakdata.conquery.models.forms.util.DateContext; +import com.bakdata.conquery.models.query.PrintSettings; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.base.Preconditions; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.StringJoiner; + +@JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, property = "type") +@CPSBase +@Slf4j +public abstract class ResultType { + + public String printNullable(PrintSettings cfg, Object f) { + if (f == null) { + return ""; + } + return print(cfg, f); + } + + protected String print(PrintSettings cfg, @NonNull Object f) { + return f.toString(); + } + + public abstract String typeInfo(); + + public static ResultType resolveResultType(MajorTypeId majorTypeId) { + switch (majorTypeId) { + case STRING: + return StringT.INSTANCE; + case BOOLEAN: + return BooleanT.INSTANCE; + case DATE: + return DateT.INSTANCE; + case DATE_RANGE: + return DateRangeT.INSTANCE; + case INTEGER: + return IntegerT.INSTANCE; + case MONEY: + return MoneyT.INSTANCE; + case DECIMAL: + case REAL: + return NumericT.INSTANCE; + default: + throw new IllegalStateException(String.format("Invalid column type '%s'", majorTypeId)); + } + } + + abstract static class PrimitiveResultType extends ResultType { + @Override + public String typeInfo() { + return this.getClass().getAnnotation(CPSType.class).id(); + } + + @Override + public String toString() { + return typeInfo(); + } + } + + @CPSType(id = "BOOLEAN", base = ResultType.class) + @NoArgsConstructor(access = AccessLevel.PRIVATE) + public static class BooleanT extends PrimitiveResultType { + @Getter(onMethod_ = @JsonCreator) + public static final BooleanT INSTANCE = new BooleanT(); + + @Override + public String print(PrintSettings cfg, Object f) { + Preconditions.checkArgument(f instanceof Boolean, "Expected boolean value, but got %s", f.getClass().getName()); + + if(cfg.isPrettyPrint()) { + //TODO this might be incredibly slow, probably better to cache this in the instance but we need to not use Singletons for that + return (Boolean) f ? C10N.get(Results.class, cfg.getLocale()).True() : C10N.get(Results.class, cfg.getLocale()).False(); + } + + return (Boolean) f ? "1" : "0"; + } + } + + + @CPSType(id = "INTEGER", base = ResultType.class) + @NoArgsConstructor(access = AccessLevel.PRIVATE) + public static class IntegerT extends PrimitiveResultType { + @Getter(onMethod_ = @JsonCreator) + public static final IntegerT INSTANCE = new IntegerT(); + + @Override + public String print(PrintSettings cfg, Object f) { + if (cfg.isPrettyPrint()) { + return cfg.getIntegerFormat().format(((Number) f).longValue()); + } + return f.toString(); + } + } + + @CPSType(id = "NUMERIC", base = ResultType.class) + @NoArgsConstructor(access = AccessLevel.PRIVATE) + public static class NumericT extends PrimitiveResultType { + @Getter(onMethod_ = @JsonCreator) + public static final NumericT INSTANCE = new NumericT(); + + @Override + public String print(PrintSettings cfg, Object f) { + if(cfg.isPrettyPrint()) { + return cfg.getDecimalFormat().format(f); + } + return f.toString(); + } + } + + @CPSType(id = "CATEGORICAL", base = ResultType.class) + @NoArgsConstructor(access = AccessLevel.PRIVATE) + public static class CategoricalT extends PrimitiveResultType { + @Getter(onMethod_ = @JsonCreator) + public static final CategoricalT INSTANCE = new CategoricalT(); + } + + @CPSType(id = "RESOLUTION", base = ResultType.class) + @NoArgsConstructor(access = AccessLevel.PRIVATE) + public static class ResolutionT extends PrimitiveResultType { + @Getter(onMethod_ = @JsonCreator) + public static final ResolutionT INSTANCE = new ResolutionT(); + + @Override + public String print(PrintSettings cfg, Object f) { + if (f instanceof DateContext.Resolution) { + return ((DateContext.Resolution) f).toString(cfg.getLocale()); + } + try { + // If the object was parsed as a simple string, try to convert it to a + // DateContextMode to get Internationalization + return DateContext.Resolution.valueOf(f.toString()).toString(cfg.getLocale()); + } catch (Exception e) { + throw new IllegalArgumentException(f + " is not a valid resolution.", e); + } + } + } + + @CPSType(id = "DATE", base = ResultType.class) + @NoArgsConstructor(access = AccessLevel.PRIVATE) + public static class DateT extends PrimitiveResultType { + @Getter(onMethod_ = @JsonCreator) + public static final DateT INSTANCE = new DateT(); + + @Override + public String print(PrintSettings cfg, @NonNull Object f) { + if(!(f instanceof Number)) { + throw new IllegalStateException("Expected an Number but got an '" + f.getClass().getName() + "' with the value: " + f); + } + final Number number = (Number) f; + if (cfg.isPrettyPrint()) { + return print(number, cfg.getDateFormatter()); + } + return CDate.toLocalDate(number.intValue()).toString(); + } + + public static String print(Number num, DateTimeFormatter formatter) { + return formatter.format(LocalDate.ofEpochDay(num.intValue())); + } + + + } + + /** + * A DateRange is provided by in a query result as two ints in a list, both standing for an epoch day (see {@link LocalDate#toEpochDay()}). + * The first int describes the included lower bound of the range. The second int descibes the included upper bound. + */ + @CPSType(id = "DATE_RANGE", base = ResultType.class) + @NoArgsConstructor(access = AccessLevel.PRIVATE) + public static class DateRangeT extends PrimitiveResultType { + @Getter(onMethod_ = @JsonCreator) + public static final DateRangeT INSTANCE = new DateRangeT(); + + @Override + public String print(PrintSettings cfg, @NonNull Object f) { + if(!(f instanceof List)) { + throw new IllegalStateException(String.format("Expected a List got %s (Type: %s, as string: %s)", f, f.getClass().getName(), f)); + } + List list = (List) f; + if(list.size() != 2) { + throw new IllegalStateException("Expected a list with 2 elements, one min, one max. The list was: " + list); + } + final DateTimeFormatter dateFormat = cfg.getDateFormatter(); + final Integer min = (Integer) list.get(0); + final Integer max = (Integer) list.get(1); + if (min == null || max == null) { + log.warn("Encountered incomplete range, treating it as an open range. Either min or max was null: {}", list); + } + // Compute minString first because we need it either way + String minString = min == null || min == Integer.MIN_VALUE ? "-∞" : ResultType.DateT.print(min, dateFormat); + + if (min != null && min.equals(max)){ + // If the min and max are the same we print it like a singe date, not a range + return minString; + } + String maxString = max == null || max == Integer.MAX_VALUE ? "+∞" : ResultType.DateT.print(max, dateFormat); + + return minString + cfg.getDateRangeSeparator() + maxString; + } + } + + @CPSType(id = "STRING", base = ResultType.class) + @NoArgsConstructor(access = AccessLevel.PRIVATE) + public static class StringT extends PrimitiveResultType { + @Getter(onMethod_ = @JsonCreator) + public static final StringT INSTANCE = new StringT(); + } + + @CPSType(id = "ID", base = ResultType.class) + @NoArgsConstructor(access = AccessLevel.PRIVATE) + public static class IdT extends PrimitiveResultType { + @Getter(onMethod_ = @JsonCreator) + public static final IdT INSTANCE = new IdT(); + } + + @CPSType(id = "MONEY", base = ResultType.class) + @NoArgsConstructor(access = AccessLevel.PRIVATE) + public static class MoneyT extends PrimitiveResultType { + + @Getter(onMethod_ = @JsonCreator) + public static final MoneyT INSTANCE = new MoneyT(); + + @Override + public String print(PrintSettings cfg, Object f) { + if (cfg.isPrettyPrint()) { + return cfg.getDecimalFormat().format(new BigDecimal(((Number) f).longValue()).movePointLeft(cfg.getCurrency().getDefaultFractionDigits())); + } + return IntegerT.INSTANCE.print(cfg, f); + } + } + + @CPSType(id = "LIST", base = ResultType.class) + @Getter + public static class ListT extends ResultType { + @NonNull + private final ResultType elementType; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + public ListT(@NonNull ResultType elementType) { + this.elementType = elementType; + } + + @Override + public String print(PrintSettings cfg, @NonNull Object f) { + // Jackson deserializes collections as lists instead of an array, if the type is not given + if(!(f instanceof List)) { + throw new IllegalStateException(String.format("Expected a List got %s (Type: %s, as string: %s)", f, f.getClass().getName(), f)); + } + // Not sure if this escaping is enough + String listDelimEscape = cfg.getListElementEscaper() + cfg.getListFormat().getSeparator(); + StringJoiner joiner = new StringJoiner(cfg.getListFormat().getSeparator(), cfg.getListFormat().getStart(),cfg.getListFormat().getEnd()); + for(Object obj : (List) f) { + joiner.add(elementType.print(cfg,obj).replace(cfg.getListFormat().getSeparator(), listDelimEscape)); + } + return joiner.toString(); + } + + @Override + public String typeInfo() { + return this.getClass().getAnnotation(CPSType.class).id() + "[" + elementType.typeInfo() + "]"; + } + + @Override + public String toString() { + return typeInfo(); + } + } +}