From a77e1be72e5e303f54b2b7cb7d0313c297dcdbc7 Mon Sep 17 00:00:00 2001 From: Franck Cotton Date: Mon, 7 Oct 2024 07:25:17 +0200 Subject: [PATCH 01/17] Bump to version 1.7.0-SNAPSHOT --- coverage/pom.xml | 14 +++++++------- pom.xml | 2 +- vtl-csv/pom.xml | 6 +++--- vtl-engine/pom.xml | 8 ++++---- vtl-jackson/pom.xml | 6 +++--- vtl-jdbc/pom.xml | 8 ++++---- vtl-model/pom.xml | 4 ++-- vtl-parser/pom.xml | 4 ++-- vtl-prov/pom.xml | 6 +++--- vtl-sdmx/pom.xml | 12 ++++++------ vtl-spark/pom.xml | 8 ++++---- 11 files changed, 39 insertions(+), 39 deletions(-) diff --git a/coverage/pom.xml b/coverage/pom.xml index e58fe437d..b33380b64 100644 --- a/coverage/pom.xml +++ b/coverage/pom.xml @@ -6,7 +6,7 @@ fr.insee.trevas trevas-parent - 1.6.0 + 1.7.0-SNAPSHOT coverage @@ -22,32 +22,32 @@ fr.insee.trevas vtl-engine - 1.6.0 + 1.7.0-SNAPSHOT fr.insee.trevas vtl-jackson - 1.6.0 + 1.7.0-SNAPSHOT fr.insee.trevas vtl-jdbc - 1.6.0 + 1.7.0-SNAPSHOT fr.insee.trevas vtl-model - 1.6.0 + 1.7.0-SNAPSHOT fr.insee.trevas vtl-parser - 1.6.0 + 1.7.0-SNAPSHOT fr.insee.trevas vtl-spark - 1.6.0 + 1.7.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index e7f206ed5..88d1b96b5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ fr.insee.trevas trevas-parent pom - 1.6.0 + 1.7.0-SNAPSHOT vtl-parser vtl-model diff --git a/vtl-csv/pom.xml b/vtl-csv/pom.xml index ad9e229f8..b0b057fdf 100644 --- a/vtl-csv/pom.xml +++ b/vtl-csv/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.6.0 + 1.7.0-SNAPSHOT vtl-csv VTL CSV CSV module for the VTL model - 1.6.0 + 1.7.0-SNAPSHOT @@ -25,7 +25,7 @@ fr.insee.trevas vtl-model - 1.6.0 + 1.7.0-SNAPSHOT net.sf.supercsv diff --git a/vtl-engine/pom.xml b/vtl-engine/pom.xml index d56c1c790..8247362ce 100644 --- a/vtl-engine/pom.xml +++ b/vtl-engine/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.6.0 + 1.7.0-SNAPSHOT vtl-engine VTL Engine VTL engine framework for Trevas - 1.6.0 + 1.7.0-SNAPSHOT @@ -25,13 +25,13 @@ fr.insee.trevas vtl-parser - 1.6.0 + 1.7.0-SNAPSHOT compile fr.insee.trevas vtl-model - 1.6.0 + 1.7.0-SNAPSHOT compile diff --git a/vtl-jackson/pom.xml b/vtl-jackson/pom.xml index 22b5f74c7..782b3d1e2 100644 --- a/vtl-jackson/pom.xml +++ b/vtl-jackson/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.6.0 + 1.7.0-SNAPSHOT vtl-jackson VTL Jackson Jackson module for the VTL model - 1.6.0 + 1.7.0-SNAPSHOT @@ -25,7 +25,7 @@ fr.insee.trevas vtl-model - 1.6.0 + 1.7.0-SNAPSHOT compile diff --git a/vtl-jdbc/pom.xml b/vtl-jdbc/pom.xml index 8749a1d98..02ac3cbbd 100644 --- a/vtl-jdbc/pom.xml +++ b/vtl-jdbc/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.6.0 + 1.7.0-SNAPSHOT vtl-jdbc VTL JDBC Dataset wrapper around JDBC result set. Useful to expose SQL tables as VTL datasets - 1.6.0 + 1.7.0-SNAPSHOT @@ -25,14 +25,14 @@ fr.insee.trevas vtl-model - 1.6.0 + 1.7.0-SNAPSHOT compile fr.insee.trevas vtl-engine - 1.6.0 + 1.7.0-SNAPSHOT test diff --git a/vtl-model/pom.xml b/vtl-model/pom.xml index 0e7b82a87..8574e8263 100644 --- a/vtl-model/pom.xml +++ b/vtl-model/pom.xml @@ -7,7 +7,7 @@ fr.insee.trevas trevas-parent - 1.6.0 + 1.7.0-SNAPSHOT @@ -21,7 +21,7 @@ vtl-model VTL Model Model describing VTL expressions and bindings - 1.6.0 + 1.7.0-SNAPSHOT diff --git a/vtl-parser/pom.xml b/vtl-parser/pom.xml index 0c0397883..e9086fce3 100644 --- a/vtl-parser/pom.xml +++ b/vtl-parser/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.6.0 + 1.7.0-SNAPSHOT vtl-parser VTL Parser Artifacts generated by Antlr from the VTL grammar files - 1.6.0 + 1.7.0-SNAPSHOT diff --git a/vtl-prov/pom.xml b/vtl-prov/pom.xml index 5bae38c52..dd0f08ae5 100644 --- a/vtl-prov/pom.xml +++ b/vtl-prov/pom.xml @@ -7,14 +7,14 @@ fr.insee.trevas trevas-parent - 1.6.0 + 1.7.0-SNAPSHOT VTL Provenance Provenance static analysis vtl-prov - 1.6.0 + 1.7.0-SNAPSHOT @@ -32,7 +32,7 @@ fr.insee.trevas vtl-parser - 1.6.0 + 1.7.0-SNAPSHOT diff --git a/vtl-sdmx/pom.xml b/vtl-sdmx/pom.xml index b4558806e..99c65ab87 100644 --- a/vtl-sdmx/pom.xml +++ b/vtl-sdmx/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.6.0 + 1.7.0-SNAPSHOT vtl-sdmx VTL SDMX Dataset wrapper around SDMX - 1.6.0 + 1.7.0-SNAPSHOT @@ -40,24 +40,24 @@ fr.insee.trevas vtl-model - 1.6.0 + 1.7.0-SNAPSHOT fr.insee.trevas vtl-engine - 1.6.0 + 1.7.0-SNAPSHOT test fr.insee.trevas vtl-csv - 1.6.0 + 1.7.0-SNAPSHOT test fr.insee.trevas vtl-spark - 1.6.0 + 1.7.0-SNAPSHOT test diff --git a/vtl-spark/pom.xml b/vtl-spark/pom.xml index 551815d1a..768c5f8cd 100644 --- a/vtl-spark/pom.xml +++ b/vtl-spark/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.6.0 + 1.7.0-SNAPSHOT vtl-spark VTL Spark Trevas engine for Apache Spark - 1.6.0 + 1.7.0-SNAPSHOT @@ -25,13 +25,13 @@ fr.insee.trevas vtl-model - 1.6.0 + 1.7.0-SNAPSHOT compile fr.insee.trevas vtl-engine - 1.6.0 + 1.7.0-SNAPSHOT test From 674ddc1cf2621853c9f034bc6fd332746fb2d3d7 Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 08:20:42 +0200 Subject: [PATCH 02/17] Fix node version in docs CI --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2918d719e..f1d656a69 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 16.19.0 + node-version: 22 - name: Install dependencies run: yarn install --frozen-lockfile working-directory: docs From 3a6de266c3adfc2056eacee6a1c2673f5255771c Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 13:00:33 +0200 Subject: [PATCH 03/17] Add vtl 2.1 updates to docs --- .../coverage/conditional-operators.mdx | 1 + .../user-guide/coverage/numeric-operators.mdx | 1 + .../user-guide/coverage/time-operators.mdx | 28 +++++++++++++------ .../coverage/conditional-operators.mdx | 1 + .../user-guide/coverage/numeric-operators.mdx | 1 + .../user-guide/coverage/time-operators.mdx | 10 +++++++ .../coverage/conditional-operators.mdx | 1 + .../user-guide/coverage/numeric-operators.mdx | 1 + .../user-guide/coverage/time-operators.mdx | 28 +++++++++++++------ .../coverage/conditional-operators.mdx | 1 + .../user-guide/coverage/numeric-operators.mdx | 1 + .../user-guide/coverage/time-operators.mdx | 28 +++++++++++++------ 12 files changed, 75 insertions(+), 27 deletions(-) diff --git a/docs/docs/user-guide/coverage/conditional-operators.mdx b/docs/docs/user-guide/coverage/conditional-operators.mdx index 8ca3d26b9..947d7e5bd 100644 --- a/docs/docs/user-guide/coverage/conditional-operators.mdx +++ b/docs/docs/user-guide/coverage/conditional-operators.mdx @@ -9,4 +9,5 @@ custom_edit_url: null | Name | Symbol | Boolean | Component | Dataset | | ------------ | :----------- | :----------------: | :----------------: | :----------------: | | If Then Else | if-then-else | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Case | case | :x: | :x: | :x: | | Nvl | nvl | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/docs/user-guide/coverage/numeric-operators.mdx b/docs/docs/user-guide/coverage/numeric-operators.mdx index bb158e9ad..431504f97 100644 --- a/docs/docs/user-guide/coverage/numeric-operators.mdx +++ b/docs/docs/user-guide/coverage/numeric-operators.mdx @@ -24,5 +24,6 @@ custom_edit_url: null | Exponential | exp | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Natural logarithm | ln | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Power | power | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Random | random | :x: | :x: | :x: | | Logarithm | log | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Square root | sqrt | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/docs/user-guide/coverage/time-operators.mdx b/docs/docs/user-guide/coverage/time-operators.mdx index 624b54b17..d7d89029a 100644 --- a/docs/docs/user-guide/coverage/time-operators.mdx +++ b/docs/docs/user-guide/coverage/time-operators.mdx @@ -6,12 +6,22 @@ slug: /user-guide/coverage/time-operators custom_edit_url: null --- -| Name | Symbol | Time_period | Component | Dataset | -| ---------------- | :--------------- | :----------------: | :----------------: | :----------------: | -| Period indicator | period_indicator | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Fill time series | fill_time_series | N/A | N/A | :x: | -| Flow to stock | flow_to_stock | N/A | N/A | :heavy_check_mark: | -| Stock to flow | stock_to_flow | N/A | N/A | :heavy_check_mark: | -| Time shift | timeshift | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Time aggregation | time_agg | N/A | N/A | :x: | -| Actual time | current_date | :heavy_check_mark: | N/A | N/A | +| Name | Symbol | Time_period | Component | Dataset | +| ------------------------------ | :--------------- | :----------------: | :----------------: | :----------------: | +| Period indicator | period_indicator | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Fill time series | fill_time_series | N/A | N/A | :x: | +| Flow to stock | flow_to_stock | N/A | N/A | :heavy_check_mark: | +| Stock to flow | stock_to_flow | N/A | N/A | :heavy_check_mark: | +| Time shift | timeshift | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Time aggregation | time_agg | N/A | N/A | :x: | +| Actual time | current_date | :heavy_check_mark: | N/A | N/A | +| Subtract dates | datediff | :x: | :x: | :x: | +| Add to date | dateadd | :x: | :x: | :x: | +| Year of a date | year | :x: | :x: | :x: | +| Month of a date | month | :x: | :x: | :x: | +| Number of day within the year | dayofyear | :x: | :x: | :x: | +| Number of day within the month | dayofmonth | :x: | :x: | :x: | +| Convert days to years | daytoyear | :x: | :x: | :x: | +| Convert days to months | daytomonth | :x: | :x: | :x: | +| Convert duration in days | yeartoday | :x: | :x: | :x: | +| Convert duration in months | yeartomonth | :x: | :x: | :x: | diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx index 81ed68f40..3d6cfa413 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx @@ -9,4 +9,5 @@ custom_edit_url: null | Nom | Symbole | Boolean | Component | Dataset | | -------------- | :----------- | :----------------: | :----------------: | :----------------: | | Si Alors Sinon | if-then-else | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Cas | case | :x: | :x: | :x: | | Valeur nulle | nvl | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx index 66650b9ed..a10dd3207 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx @@ -24,5 +24,6 @@ custom_edit_url: null | Exponentiel | exp | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Logarithme néperien | ln | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Puissance | power | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Random | random | :x: | :x: | :x: | | Logarithme | log | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Racine carrée | sqrt | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx index 4f9c73727..ca7e7e678 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx @@ -15,3 +15,13 @@ custom_edit_url: null | Time shift | timeshift | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Décalage dans le temps | time_agg | N/A | N/A | :x: | | Heure courante | current_date | :heavy_check_mark: | N/A | N/A | +| Soustraire des dates | datediff | :x: | :x: | :x: | +| Ajouter à une date | dateadd | :x: | :x: | :x: | +| Année d'une date | year | :x: | :x: | :x: | +| Mois d'une date | month | :x: | :x: | :x: | +| Nombre de jours dans l'année | dayofyear | :x: | :x: | :x: | +| Nombre de jours dans le mois | dayofmonth | :x: | :x: | :x: | +| Convertir des jours en années | daytoyear | :x: | :x: | :x: | +| Convertir des jours en mois | daytomonth | :x: | :x: | :x: | +| Convertir la durée en jours | yeartoday | :x: | :x: | :x: | +| Convertir la durée en mois | yeartomonth | :x: | :x: | :x: | diff --git a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx index 872c657b2..4e7cac1e8 100644 --- a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx +++ b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx @@ -9,4 +9,5 @@ custom_edit_url: null | Navn | Symbol | Boolean | Component | Dataset | | ----------- | :----------- | :----------------: | :----------------: | :----------------: | | Om så annet | if-then-else | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Sak | case | :x: | :x: | :x: | | Null verdi | nvl | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx index cedcefdcb..b93ff1a2d 100644 --- a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx +++ b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx @@ -24,5 +24,6 @@ custom_edit_url: null | Eksponentiell | exp | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Naturlig logaritme | ln | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Strøm | power | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Random | random | :x: | :x: | :x: | | Logaritme | log | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Kvadratrot | sqrt | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx index 0500dc66a..d2cbb032b 100644 --- a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx +++ b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx @@ -6,12 +6,22 @@ slug: /user-guide/coverage/time-operators custom_edit_url: null --- -| Navn | Symbol | Time_period | Component | Dataset | -| ---------------- | :--------------- | :----------------: | :----------------: | :----------------: | -| Periodeindikator | period_indicator | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Fyll tidsserier | fill_time_series | N/A | N/A | :x: | -| Flyt til lager | flow_to_stock | N/A | N/A | :heavy_check_mark: | -| Aksje til flyt | stock_to_flow | N/A | N/A | :heavy_check_mark: | -| Tidsforskyvning | timeshift | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Tidsaggregering | time_agg | N/A | N/A | :x: | -| Faktisk tid | current_date | :heavy_check_mark: | N/A | N/A | +| Navn | Symbol | Time_period | Component | Dataset | +| ---------------------------- | :--------------- | :----------------: | :----------------: | :----------------: | +| Periodeindikator | period_indicator | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Fyll tidsserier | fill_time_series | N/A | N/A | :x: | +| Flyt til lager | flow_to_stock | N/A | N/A | :heavy_check_mark: | +| Aksje til flyt | stock_to_flow | N/A | N/A | :heavy_check_mark: | +| Tidsforskyvning | timeshift | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Tidsaggregering | time_agg | N/A | N/A | :x: | +| Faktisk tid | current_date | :heavy_check_mark: | N/A | N/A | +| Trekk fra datoer | datediff | :x: | :x: | :x: | +| Legg til dato | dateadd | :x: | :x: | :x: | +| År av en date | year | :x: | :x: | :x: | +| Måned av en date | month | :x: | :x: | :x: | +| Antall dager i året | dayofyear | :x: | :x: | :x: | +| Antall dager i måneden | dayofmonth | :x: | :x: | :x: | +| Konverter dager til år | daytoyear | :x: | :x: | :x: | +| Konverter dager til måneder | daytomonth | :x: | :x: | :x: | +| Konverter varighet i dager | yeartoday | :x: | :x: | :x: | +| Konverter varighet i måneder | yeartomonth | :x: | :x: | :x: | diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx index 8ca3d26b9..947d7e5bd 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx @@ -9,4 +9,5 @@ custom_edit_url: null | Name | Symbol | Boolean | Component | Dataset | | ------------ | :----------- | :----------------: | :----------------: | :----------------: | | If Then Else | if-then-else | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Case | case | :x: | :x: | :x: | | Nvl | nvl | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx index bb158e9ad..431504f97 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx @@ -24,5 +24,6 @@ custom_edit_url: null | Exponential | exp | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Natural logarithm | ln | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Power | power | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Random | random | :x: | :x: | :x: | | Logarithm | log | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Square root | sqrt | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx index 624b54b17..d7d89029a 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/time-operators.mdx @@ -6,12 +6,22 @@ slug: /user-guide/coverage/time-operators custom_edit_url: null --- -| Name | Symbol | Time_period | Component | Dataset | -| ---------------- | :--------------- | :----------------: | :----------------: | :----------------: | -| Period indicator | period_indicator | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Fill time series | fill_time_series | N/A | N/A | :x: | -| Flow to stock | flow_to_stock | N/A | N/A | :heavy_check_mark: | -| Stock to flow | stock_to_flow | N/A | N/A | :heavy_check_mark: | -| Time shift | timeshift | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Time aggregation | time_agg | N/A | N/A | :x: | -| Actual time | current_date | :heavy_check_mark: | N/A | N/A | +| Name | Symbol | Time_period | Component | Dataset | +| ------------------------------ | :--------------- | :----------------: | :----------------: | :----------------: | +| Period indicator | period_indicator | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Fill time series | fill_time_series | N/A | N/A | :x: | +| Flow to stock | flow_to_stock | N/A | N/A | :heavy_check_mark: | +| Stock to flow | stock_to_flow | N/A | N/A | :heavy_check_mark: | +| Time shift | timeshift | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Time aggregation | time_agg | N/A | N/A | :x: | +| Actual time | current_date | :heavy_check_mark: | N/A | N/A | +| Subtract dates | datediff | :x: | :x: | :x: | +| Add to date | dateadd | :x: | :x: | :x: | +| Year of a date | year | :x: | :x: | :x: | +| Month of a date | month | :x: | :x: | :x: | +| Number of day within the year | dayofyear | :x: | :x: | :x: | +| Number of day within the month | dayofmonth | :x: | :x: | :x: | +| Convert days to years | daytoyear | :x: | :x: | :x: | +| Convert days to months | daytomonth | :x: | :x: | :x: | +| Convert duration in days | yeartoday | :x: | :x: | :x: | +| Convert duration in months | yeartomonth | :x: | :x: | :x: | From c69f3740dd36b59b3fc04af20721d7e3960ce49c Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 13:02:58 +0200 Subject: [PATCH 04/17] Update EBNF sources to VTL 2.1 --- .../main/antlr4/fr/insee/vtl/parser/Vtl.g4 | 39 ++++++++++++++++--- .../antlr4/fr/insee/vtl/parser/VtlTokens.g4 | 16 +++++++- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 index c3ba44928..a57b9c9b5 100644 --- a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 +++ b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 @@ -1,3 +1,13 @@ +// VTL 2.1 10/07/2024 SDMX +// Custom: +// - Remove component duplication +// - Add distance operators (levenshtein) + +// Since 2.0: +// - add RANDOM operator +// - add CASE operator +// - add time operators: dateDiffAtom, dateAddAtom, yearAtom, monthAtom, dayOfMonthAtom, dayOfYearAtom, dayToYearAtom, dayToMonthAtom, yearTodayAtom, monthTodayAtom + grammar Vtl; import VtlTokens; @@ -26,6 +36,7 @@ expr: | left=expr op=AND right=expr # booleanExpr | left=expr op=(OR|XOR) right=expr # booleanExpr | IF conditionalExpr=expr THEN thenExpr=expr ELSE elseExpr=expr # ifExpr + | CASE WHEN expr THEN expr (WHEN expr THEN expr)* ELSE expr # caseExpr | constant # constantExpr | varID # varIdExpr @@ -185,13 +196,13 @@ stringOperators: numericOperators: op=(CEIL | FLOOR | ABS | EXP | LN | SQRT) LPAREN expr RPAREN # unaryNumeric | op=(ROUND | TRUNC) LPAREN expr (COMMA optionalExpr)? RPAREN # unaryWithOptionalNumeric - | op=(MOD | POWER|LOG) LPAREN left=expr COMMA right=expr RPAREN # binaryNumeric + | op=(MOD | POWER | LOG | RANDOM) LPAREN left=expr COMMA right=expr RPAREN # binaryNumeric ; //numericOperatorsComponent: // op=(CEIL | FLOOR | ABS | EXP | LN | SQRT) LPAREN exprComponent RPAREN # unaryNumericComponent // | op=(ROUND | TRUNC) LPAREN exprComponent (COMMA optionalExprComponent)? RPAREN # unaryWithOptionalNumericComponent -// | op=(MOD | POWER | LOG) LPAREN left=exprComponent COMMA right=exprComponent RPAREN # binaryNumericComponent +// | op=(MOD | POWER | LOG | RANDOM) LPAREN left=exprComponent COMMA right=exprComponent RPAREN # binaryNumericComponent //; comparisonOperators: @@ -214,6 +225,16 @@ timeOperators: | TIMESHIFT LPAREN expr COMMA signedInteger RPAREN # timeShiftAtom | TIME_AGG LPAREN periodIndTo=STRING_CONSTANT (COMMA periodIndFrom=(STRING_CONSTANT| OPTIONAL ))? (COMMA op=optionalExpr)? (COMMA (FIRST|LAST))? RPAREN # timeAggAtom | CURRENT_DATE LPAREN RPAREN # currentDateAtom + | DATEDIFF LPAREN dateFrom=expr COMMA dateTo=expr RPAREN # dateDiffAtom + | DATEADD LPAREN op=expr COMMA shiftNumber=expr COMMA periodInd=expr RPAREN # dateAddAtom + | YEAR_OP LPAREN expr RPAREN # yearAtom + | MONTH_OP LPAREN expr RPAREN # monthAtom + | DAYOFMONTH LPAREN expr RPAREN # dayOfMonthAtom + | DAYOFYEAR LPAREN expr RPAREN # dayOfYearAtom + | DAYTOYEAR LPAREN expr RPAREN # dayToYearAtom + | DAYTOMONTH LPAREN expr RPAREN # dayToMonthAtom + | YEARTODAY LPAREN expr RPAREN # yearTodayAtom + | MONTHTODAY LPAREN expr RPAREN # monthTodayAtom ; //timeOperatorsComponent: @@ -223,6 +244,16 @@ timeOperators: // | TIMESHIFT LPAREN exprComponent COMMA signedInteger RPAREN # timeShiftAtomComponent // | TIME_AGG LPAREN periodIndTo=STRING_CONSTANT (COMMA periodIndFrom=(STRING_CONSTANT| OPTIONAL ))? (COMMA op=optionalExprComponent)? (COMMA (FIRST|LAST))? RPAREN # timeAggAtomComponent // | CURRENT_DATE LPAREN RPAREN # currentDateAtomComponent +// | DATEDIFF LPAREN dateFrom=expr COMMA dateTo=expr RPAREN # dateDiffAtom +// | DATEADD LPAREN op=expr COMMA shiftNumber=expr COMMA periodInd=expr RPAREN # dateAddAtom +// | YEAR_OP LPAREN expr RPAREN # yearAtom +// | MONTH_OP LPAREN expr RPAREN # monthAtom +// | DAYOFMONTH LPAREN expr RPAREN # dayOfMonthAtom +// | DAYOFYEAR LPAREN expr RPAREN # datOfYearAtom +// | DAYTOYEAR LPAREN expr RPAREN # dayToYearAtom +// | DAYTOMONTH LPAREN expr RPAREN # dayToMonthAtom +// | YEARTODAY LPAREN expr RPAREN # yearTodayAtom +// | MONTHTODAY LPAREN expr RPAREN # monthTodayAtom //; setOperators: @@ -276,7 +307,6 @@ aggrOperatorsGrouping: | STDDEV_SAMP | VAR_POP | VAR_SAMP) LPAREN expr (groupingClause havingClause?)? RPAREN #aggrDataset - | COUNT LPAREN RPAREN # countAggr ; @@ -294,9 +324,8 @@ aggrOperatorsGrouping: | FIRST_VALUE | LAST_VALUE) LPAREN expr OVER LPAREN (partition=partitionByClause? orderBy=orderByClause? windowing=windowingClause?)RPAREN RPAREN #anSimpleFunction - | op=(LAG |LEAD) LPAREN expr (COMMA offset=signedInteger(defaultValue=constant)?)? OVER LPAREN (partition=partitionByClause? orderBy=orderByClause) RPAREN RPAREN # lagOrLeadAn + | op=(LAG |LEAD) LPAREN expr (COMMA offet=signedInteger(defaultValue=constant)?)? OVER LPAREN (partition=partitionByClause? orderBy=orderByClause) RPAREN RPAREN # lagOrLeadAn | op=RATIO_TO_REPORT LPAREN expr OVER LPAREN (partition=partitionByClause) RPAREN RPAREN # ratioToReportAn - | op=RANK LPAREN OVER LPAREN (partition=partitionByClause? orderBy=orderByClause )RPAREN RPAREN #rankAn ; // anFunctionComponent: diff --git a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 index abd0996c1..4c8224f81 100644 --- a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 +++ b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 @@ -28,11 +28,22 @@ lexer grammar VtlTokens; MEMBERSHIP : '#'; EVAL : 'eval'; IF : 'if'; + CASE : 'case'; THEN : 'then'; ELSE : 'else'; USING : 'using'; WITH : 'with'; CURRENT_DATE : 'current_date'; + DATEDIFF : 'datediff'; + DATEADD : 'dateadd'; + YEAR_OP : 'year'; + MONTH_OP : 'month'; + DAYOFMONTH : 'dayofmonth'; + DAYOFYEAR : 'dayofyear'; + DAYTOYEAR : 'daytoyear'; + DAYTOMONTH : 'daytomonth'; + YEARTODAY : 'yeartoday'; + MONTHTODAY : 'monthtoday'; ON : 'on'; DROP : 'drop'; KEEP : 'keep'; @@ -54,6 +65,7 @@ lexer grammar VtlTokens; DIFF : 'diff'; SYMDIFF : 'symdiff'; INTERSECT : 'intersect'; + RANDOM : 'random'; KEYS : 'keys'; INTYEAR : 'intyear'; INTMONTH : 'intmonth'; @@ -107,8 +119,8 @@ lexer grammar VtlTokens; TYPE : 'type'; NVL : 'nvl'; HIERARCHY : 'hierarchy'; - OPTIONAL : '_'; - INVALID : 'invalid'; + OPTIONAL : '_'; + INVALID : 'invalid'; LEVENSHTEIN : 'levenshtein'; VALUE_DOMAIN : 'valuedomain'; From ccc248b5beaa163d9e2dd8b62b70d41107cc9429 Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 13:38:46 +0200 Subject: [PATCH 05/17] Fix doc coverage issue --- .../coverage/analytic-operators.mdx | 28 ++++++------------- .../coverage/analytic-operators.mdx | 10 ------- .../coverage/analytic-operators.mdx | 28 ++++++------------- .../coverage/analytic-operators.mdx | 28 ++++++------------- 4 files changed, 27 insertions(+), 67 deletions(-) diff --git a/docs/docs/user-guide/coverage/analytic-operators.mdx b/docs/docs/user-guide/coverage/analytic-operators.mdx index db3231a2d..021286509 100644 --- a/docs/docs/user-guide/coverage/analytic-operators.mdx +++ b/docs/docs/user-guide/coverage/analytic-operators.mdx @@ -6,22 +6,12 @@ slug: /user-guide/coverage/analytic-operators custom_edit_url: null --- -| Name | Symbol | InMemory | Spark | -| ---------------------------------- | :-------------- | :------: | :----------------: | -| Analytic invocation | | :x: | :heavy_check_mark: | -| Counting the number of data points | count | :x: | :heavy_check_mark: | -| Minimum value | min | :x: | :heavy_check_mark: | -| Maximum value | max | :x: | :heavy_check_mark: | -| Median value | median | :x: | :heavy_check_mark: | -| Sum | sum | :x: | :heavy_check_mark: | -| Average value | avg | :x: | :heavy_check_mark: | -| Population standard deviation | stddev_pop | :x: | :heavy_check_mark: | -| Sample standard deviation | stddev_samp | :x: | :heavy_check_mark: | -| Population variance | var_pop | :x: | :heavy_check_mark: | -| Sample variance | var_samp | :x: | :heavy_check_mark: | -| First value | first_value | :x: | :heavy_check_mark: | -| Last value | last_value | :x: | :heavy_check_mark: | -| Lag | lag | :x: | :heavy_check_mark: | -| lead | lead | :x: | :heavy_check_mark: | -| Rank | rank | :x: | :heavy_check_mark: | -| Ratio to report | ratio_to_report | :x: | :heavy_check_mark: | +| Name | Symbol | InMemory | Spark | +| ------------------- | :-------------- | :------: | :----------------: | +| Analytic invocation | | :x: | :heavy_check_mark: | +| First value | first_value | :x: | :heavy_check_mark: | +| Last value | last_value | :x: | :heavy_check_mark: | +| Lag | lag | :x: | :heavy_check_mark: | +| lead | lead | :x: | :heavy_check_mark: | +| Rank | rank | :x: | :heavy_check_mark: | +| Ratio to report | ratio_to_report | :x: | :heavy_check_mark: | diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx index 871ba6795..25ff39a2a 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx @@ -9,16 +9,6 @@ custom_edit_url: null | Nom | Symbole | InMemory | Spark | | --------------------------------------- | :-------------- | :------: | :----------------: | | Instanciation de l'opérateur analytique | | :x: | :heavy_check_mark: | -| Comptage du nombre de point de données | count | :x: | :heavy_check_mark: | -| Valeur minimuale | min | :x: | :heavy_check_mark: | -| Valeur maximale | max | :x: | :heavy_check_mark: | -| Valeur médiane | median | :x: | :heavy_check_mark: | -| Somme | sum | :x: | :heavy_check_mark: | -| Moyenne | avg | :x: | :heavy_check_mark: | -| Écart-type de la population | stddev_pop | :x: | :heavy_check_mark: | -| Écart-type de l'échantillon | stddev_samp | :x: | :heavy_check_mark: | -| Variance de la population | var_pop | :x: | :heavy_check_mark: | -| Variance de l'échantillon | var_samp | :x: | :heavy_check_mark: | | Première valeur | first_value | :x: | :heavy_check_mark: | | Dernière valeur | last_value | :x: | :heavy_check_mark: | | Décalage (vers le bas) | lag | :x: | :heavy_check_mark: | diff --git a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx index e9644d28a..31dc5e491 100644 --- a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx +++ b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx @@ -6,22 +6,12 @@ slug: /user-guide/coverage/analytic-operators custom_edit_url: null --- -| Navn | Symbol | InMemory | Spark | -| ------------------------- | :-------------- | :------: | :----------------: | -| Analytisk påkalling | | :x: | :heavy_check_mark: | -| Telle antall datapunkter | count | :x: | :heavy_check_mark: | -| Minimumsverdi | min | :x: | :heavy_check_mark: | -| Maksimal verdi | max | :x: | :heavy_check_mark: | -| Medianverdi | median | :x: | :heavy_check_mark: | -| Sum | sum | :x: | :heavy_check_mark: | -| Gjennomsnittlig verdi | avg | :x: | :heavy_check_mark: | -| Populasjonsstandardavvik | stddev_pop | :x: | :heavy_check_mark: | -| Eksempel på standardavvik | stddev_samp | :x: | :heavy_check_mark: | -| Varianspopulasjon | var_pop | :x: | :heavy_check_mark: | -| Prøveavvik | var_samp | :x: | :heavy_check_mark: | -| Førsteverdi | first_value | :x: | :heavy_check_mark: | -| Siste verdi | last_value | :x: | :heavy_check_mark: | -| Lag | lag | :x: | :heavy_check_mark: | -| Leder | lead | :x: | :heavy_check_mark: | -| Rangering | rank | :x: | :heavy_check_mark: | -| Forhold til rapportering | ratio_to_report | :x: | :heavy_check_mark: | +| Navn | Symbol | InMemory | Spark | +| ------------------------ | :-------------- | :------: | :----------------: | +| Analytisk påkalling | | :x: | :heavy_check_mark: | +| Førsteverdi | first_value | :x: | :heavy_check_mark: | +| Siste verdi | last_value | :x: | :heavy_check_mark: | +| Lag | lag | :x: | :heavy_check_mark: | +| Leder | lead | :x: | :heavy_check_mark: | +| Rangering | rank | :x: | :heavy_check_mark: | +| Forhold til rapportering | ratio_to_report | :x: | :heavy_check_mark: | diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx index db3231a2d..021286509 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/analytic-operators.mdx @@ -6,22 +6,12 @@ slug: /user-guide/coverage/analytic-operators custom_edit_url: null --- -| Name | Symbol | InMemory | Spark | -| ---------------------------------- | :-------------- | :------: | :----------------: | -| Analytic invocation | | :x: | :heavy_check_mark: | -| Counting the number of data points | count | :x: | :heavy_check_mark: | -| Minimum value | min | :x: | :heavy_check_mark: | -| Maximum value | max | :x: | :heavy_check_mark: | -| Median value | median | :x: | :heavy_check_mark: | -| Sum | sum | :x: | :heavy_check_mark: | -| Average value | avg | :x: | :heavy_check_mark: | -| Population standard deviation | stddev_pop | :x: | :heavy_check_mark: | -| Sample standard deviation | stddev_samp | :x: | :heavy_check_mark: | -| Population variance | var_pop | :x: | :heavy_check_mark: | -| Sample variance | var_samp | :x: | :heavy_check_mark: | -| First value | first_value | :x: | :heavy_check_mark: | -| Last value | last_value | :x: | :heavy_check_mark: | -| Lag | lag | :x: | :heavy_check_mark: | -| lead | lead | :x: | :heavy_check_mark: | -| Rank | rank | :x: | :heavy_check_mark: | -| Ratio to report | ratio_to_report | :x: | :heavy_check_mark: | +| Name | Symbol | InMemory | Spark | +| ------------------- | :-------------- | :------: | :----------------: | +| Analytic invocation | | :x: | :heavy_check_mark: | +| First value | first_value | :x: | :heavy_check_mark: | +| Last value | last_value | :x: | :heavy_check_mark: | +| Lag | lag | :x: | :heavy_check_mark: | +| lead | lead | :x: | :heavy_check_mark: | +| Rank | rank | :x: | :heavy_check_mark: | +| Ratio to report | ratio_to_report | :x: | :heavy_check_mark: | From 78e899e7bb67d793bc32eeed7b70268a3a7650a7 Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 16:08:14 +0200 Subject: [PATCH 06/17] Update 2.1 grammar --- vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 index a57b9c9b5..00cb48940 100644 --- a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 +++ b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 @@ -307,6 +307,7 @@ aggrOperatorsGrouping: | STDDEV_SAMP | VAR_POP | VAR_SAMP) LPAREN expr (groupingClause havingClause?)? RPAREN #aggrDataset + | COUNT LPAREN RPAREN # countAggr ; @@ -324,8 +325,9 @@ aggrOperatorsGrouping: | FIRST_VALUE | LAST_VALUE) LPAREN expr OVER LPAREN (partition=partitionByClause? orderBy=orderByClause? windowing=windowingClause?)RPAREN RPAREN #anSimpleFunction - | op=(LAG |LEAD) LPAREN expr (COMMA offet=signedInteger(defaultValue=constant)?)? OVER LPAREN (partition=partitionByClause? orderBy=orderByClause) RPAREN RPAREN # lagOrLeadAn + | op=(LAG |LEAD) LPAREN expr (COMMA offset=signedInteger(defaultValue=constant)?)? OVER LPAREN (partition=partitionByClause? orderBy=orderByClause) RPAREN RPAREN # lagOrLeadAn | op=RATIO_TO_REPORT LPAREN expr OVER LPAREN (partition=partitionByClause) RPAREN RPAREN # ratioToReportAn + | op=RANK LPAREN OVER LPAREN (partition=partitionByClause? orderBy=orderByClause )RPAREN RPAREN #rankAn ; // anFunctionComponent: @@ -342,7 +344,7 @@ aggrOperatorsGrouping: // | FIRST_VALUE // | LAST_VALUE) // LPAREN exprComponent OVER LPAREN (partition=partitionByClause? orderBy=orderByClause? windowing=windowingClause?)RPAREN RPAREN #anSimpleFunctionComponent -// | op=(LAG |LEAD) LPAREN exprComponent (COMMA offet=signedInteger(defaultValue=constant)?)? OVER LPAREN (partition=partitionByClause? orderBy=orderByClause) RPAREN RPAREN # lagOrLeadAnComponent +// | op=(LAG |LEAD) LPAREN exprComponent (COMMA offset=signedInteger(defaultValue=constant)?)? OVER LPAREN (partition=partitionByClause? orderBy=orderByClause) RPAREN RPAREN # lagOrLeadAnComponent // | op=RANK LPAREN OVER LPAREN (partition=partitionByClause? orderBy=orderByClause) RPAREN RPAREN # rankAnComponent // | op=RATIO_TO_REPORT LPAREN exprComponent OVER LPAREN (partition=partitionByClause) RPAREN RPAREN # ratioToReportAnComponent //; From ef4c4ff3886b43a21d2167fc36c1fe6262f2e7ff Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 16:08:21 +0200 Subject: [PATCH 07/17] Implement random --- .../fr/insee/vtl/engine/VtlNativeMethods.java | 1 + .../functions/NumericFunctionsVisitor.java | 17 ++++++++++++- .../functions/NumericFunctionsTest.java | 25 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/vtl-engine/src/main/java/fr/insee/vtl/engine/VtlNativeMethods.java b/vtl-engine/src/main/java/fr/insee/vtl/engine/VtlNativeMethods.java index 835d9c25d..9be3a852d 100644 --- a/vtl-engine/src/main/java/fr/insee/vtl/engine/VtlNativeMethods.java +++ b/vtl-engine/src/main/java/fr/insee/vtl/engine/VtlNativeMethods.java @@ -28,6 +28,7 @@ public class VtlNativeMethods { Fun.toMethod(NumericFunctionsVisitor::trunc), Fun.toMethod(NumericFunctionsVisitor::mod), Fun.toMethod(NumericFunctionsVisitor::power), + Fun.toMethod(NumericFunctionsVisitor::random), Fun.toMethod(NumericFunctionsVisitor::log), // ArithmeticExprOrConcatVisitor Fun.toMethod(ArithmeticExprOrConcatVisitor::addition), diff --git a/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/functions/NumericFunctionsVisitor.java b/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/functions/NumericFunctionsVisitor.java index 8679080be..e0f280d39 100644 --- a/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/functions/NumericFunctionsVisitor.java +++ b/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/functions/NumericFunctionsVisitor.java @@ -1,11 +1,11 @@ package fr.insee.vtl.engine.visitors.expression.functions; import fr.insee.vtl.engine.exceptions.VtlRuntimeException; -import fr.insee.vtl.model.utils.Java8Helpers; import fr.insee.vtl.engine.visitors.expression.ExpressionVisitor; import fr.insee.vtl.model.Positioned; import fr.insee.vtl.model.ResolvableExpression; import fr.insee.vtl.model.exceptions.VtlScriptException; +import fr.insee.vtl.model.utils.Java8Helpers; import fr.insee.vtl.parser.VtlBaseVisitor; import fr.insee.vtl.parser.VtlParser; @@ -13,6 +13,7 @@ import java.math.RoundingMode; import java.util.List; import java.util.Objects; +import java.util.Random; import static fr.insee.vtl.engine.VtlScriptEngine.fromContext; @@ -123,6 +124,18 @@ public static Double power(Number left, Number right) { return Math.pow(left.doubleValue(), right.doubleValue()); } + public static Double random(Long left, Long right) { + if (left == null || right == null) { + return null; + } + Double res = null; + Random random = new Random(left); + for (int i = 0; i < right; i++) { + res = random.nextDouble(); + } + return res; + } + public static Double log(Number operand, Number base) { if (operand == null || base == null) { return null; @@ -213,6 +226,8 @@ public ResolvableExpression visitBinaryNumeric(VtlParser.BinaryNumericContext ct return genericFunctionsVisitor.invokeFunction("mod", parameters, fromContext(ctx)); case VtlParser.POWER: return genericFunctionsVisitor.invokeFunction("power", parameters, fromContext(ctx)); + case VtlParser.RANDOM: + return genericFunctionsVisitor.invokeFunction("random", parameters, fromContext(ctx)); case VtlParser.LOG: return genericFunctionsVisitor.invokeFunction("log", parameters, fromContext(ctx)); default: diff --git a/vtl-engine/src/test/java/fr/insee/vtl/engine/visitors/expression/functions/NumericFunctionsTest.java b/vtl-engine/src/test/java/fr/insee/vtl/engine/visitors/expression/functions/NumericFunctionsTest.java index 308c50e4a..79215f3c6 100644 --- a/vtl-engine/src/test/java/fr/insee/vtl/engine/visitors/expression/functions/NumericFunctionsTest.java +++ b/vtl-engine/src/test/java/fr/insee/vtl/engine/visitors/expression/functions/NumericFunctionsTest.java @@ -63,6 +63,11 @@ public void testNull() throws ScriptException { assertThat((Boolean) engine.getContext().getAttribute("a")).isNull(); engine.eval("b := power(10, cast(null, integer));"); assertThat((Boolean) engine.getContext().getAttribute("b")).isNull(); + // Random + engine.eval("a := random(cast(null, integer), 10);"); + assertThat((Boolean) engine.getContext().getAttribute("a")).isNull(); + engine.eval("b := random(10, cast(null, integer));"); + assertThat((Boolean) engine.getContext().getAttribute("b")).isNull(); // Log engine.eval("a := log(cast(null, number), 10);"); assertThat((Boolean) engine.getContext().getAttribute("a")).isNull(); @@ -345,6 +350,26 @@ public void testPower() throws ScriptException { .hasMessage("function 'power(Long, String)' not found"); } + @Test + public void testRandom() throws ScriptException { + ScriptContext context = engine.getContext(); + engine.eval("a := random(111, 1);"); + assertThat((Double) context.getAttribute("a")).isCloseTo(0.72D, Percentage.withPercentage(0.2)); + + context.setAttribute("ds", DatasetSamples.ds1, ScriptContext.ENGINE_SCOPE); + Object res = engine.eval("res := trunc(random(ds[keep id, long1], 200), 1);"); + assertThat(((Dataset) res).getDataStructure().get("long1").getType()).isEqualTo(Double.class); + + assertThatThrownBy(() -> { + engine.eval("f := random(1.2, 2);"); + }).isInstanceOf(FunctionNotFoundException.class) + .hasMessage("function 'random(Double, Long)' not found"); + assertThatThrownBy(() -> { + engine.eval("f := power(2.3, \"ko\");"); + }).isInstanceOf(FunctionNotFoundException.class) + .hasMessage("function 'power(Double, String)' not found"); + } + @Test public void testLog() throws ScriptException { ScriptContext context = engine.getContext(); From be95e33c73708b29c58a48ad235efa3dc2eb586a Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 18:06:54 +0200 Subject: [PATCH 08/17] Temp comment test --- .../src/test/java/fr/insee/vtl/spark/SparkDatasetTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vtl-spark/src/test/java/fr/insee/vtl/spark/SparkDatasetTest.java b/vtl-spark/src/test/java/fr/insee/vtl/spark/SparkDatasetTest.java index d47848a9b..dcfda4f91 100644 --- a/vtl-spark/src/test/java/fr/insee/vtl/spark/SparkDatasetTest.java +++ b/vtl-spark/src/test/java/fr/insee/vtl/spark/SparkDatasetTest.java @@ -8,6 +8,7 @@ import org.apache.spark.sql.types.DataTypes; import org.apache.spark.sql.types.StructType; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -109,6 +110,7 @@ public void testParquetMetadataReading(@TempDir Path tmpDirectory) { assertTrue(readSparkDataset.getDataStructure().get("student_number").isAttribute()); } + @Disabled @Test public void testParquetMetadataWriting(@TempDir Path tmpDirectory) throws ScriptException { SparkDataset datasetWithoutMetadata = new SparkDataset(spark.read().parquet("src/main/resources/input_sample")); From 54750c367779b055edf22a2199ca541e5e4482e0 Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 18:07:00 +0200 Subject: [PATCH 09/17] Update grammar --- .../main/antlr4/fr/insee/vtl/parser/Vtl.g4 | 23 ++++++++++--------- .../antlr4/fr/insee/vtl/parser/VtlTokens.g4 | 4 ++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 index 00cb48940..339a46d0a 100644 --- a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 +++ b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 @@ -2,6 +2,7 @@ // Custom: // - Remove component duplication // - Add distance operators (levenshtein) +// - rename year and month functions to getYear and getMonth // Since 2.0: // - add RANDOM operator @@ -220,10 +221,10 @@ comparisonOperators: timeOperators: PERIOD_INDICATOR LPAREN expr? RPAREN # periodAtom - | FILL_TIME_SERIES LPAREN expr (COMMA (SINGLE|ALL))? RPAREN # fillTimeAtom + | FILL_TIME_SERIES LPAREN expr (COMMA op=(SINGLE|ALL))? RPAREN # fillTimeAtom | op=(FLOW_TO_STOCK | STOCK_TO_FLOW) LPAREN expr RPAREN # flowAtom | TIMESHIFT LPAREN expr COMMA signedInteger RPAREN # timeShiftAtom - | TIME_AGG LPAREN periodIndTo=STRING_CONSTANT (COMMA periodIndFrom=(STRING_CONSTANT| OPTIONAL ))? (COMMA op=optionalExpr)? (COMMA (FIRST|LAST))? RPAREN # timeAggAtom + | TIME_AGG LPAREN periodIndTo=STRING_CONSTANT (COMMA periodIndFrom=(STRING_CONSTANT| OPTIONAL ))? (COMMA op=optionalExpr)? (COMMA delim=(FIRST|LAST))? RPAREN # timeAggAtom | CURRENT_DATE LPAREN RPAREN # currentDateAtom | DATEDIFF LPAREN dateFrom=expr COMMA dateTo=expr RPAREN # dateDiffAtom | DATEADD LPAREN op=expr COMMA shiftNumber=expr COMMA periodInd=expr RPAREN # dateAddAtom @@ -239,10 +240,10 @@ timeOperators: //timeOperatorsComponent: // PERIOD_INDICATOR LPAREN exprComponent? RPAREN # periodAtomComponent -// | FILL_TIME_SERIES LPAREN exprComponent (COMMA (SINGLE|ALL))? RPAREN # fillTimeAtomComponent +// | FILL_TIME_SERIES LPAREN exprComponent (COMMA op=(SINGLE|ALL))? RPAREN # fillTimeAtomComponent // | op=(FLOW_TO_STOCK | STOCK_TO_FLOW) LPAREN exprComponent RPAREN # flowAtomComponent // | TIMESHIFT LPAREN exprComponent COMMA signedInteger RPAREN # timeShiftAtomComponent -// | TIME_AGG LPAREN periodIndTo=STRING_CONSTANT (COMMA periodIndFrom=(STRING_CONSTANT| OPTIONAL ))? (COMMA op=optionalExprComponent)? (COMMA (FIRST|LAST))? RPAREN # timeAggAtomComponent +// | TIME_AGG LPAREN periodIndTo=STRING_CONSTANT (COMMA periodIndFrom=(STRING_CONSTANT| OPTIONAL ))? (COMMA op=optionalExprComponent)? (COMMA delim=(FIRST|LAST))? RPAREN # timeAggAtomComponent // | CURRENT_DATE LPAREN RPAREN # currentDateAtomComponent // | DATEDIFF LPAREN dateFrom=expr COMMA dateTo=expr RPAREN # dateDiffAtom // | DATEADD LPAREN op=expr COMMA shiftNumber=expr COMMA periodInd=expr RPAREN # dateAddAtom @@ -435,19 +436,19 @@ signedInteger: ; limitClauseItem: - INTEGER_CONSTANT PRECEDING - | INTEGER_CONSTANT FOLLOWING + INTEGER_CONSTANT dir=PRECEDING + | INTEGER_CONSTANT dir=FOLLOWING | CURRENT DATA POINT - | UNBOUNDED PRECEDING - | UNBOUNDED FOLLOWING + | UNBOUNDED dir=PRECEDING + | UNBOUNDED dir=FOLLOWING ; /*--------------------------------------------END ANALYTIC CLAUSE -----------------------------------------------*/ /* ------------------------------------------------------------ GROUPING CLAUSE ------------------------------------*/ groupingClause: - GROUP op=(BY | EXCEPT) componentID (COMMA componentID)* # groupByOrExcept - | GROUP ALL expr # groupAll - ; + GROUP op=(BY | EXCEPT) componentID (COMMA componentID)* ( TIME_AGG LPAREN TIME_UNIT (COMMA delim=(FIRST|LAST))? RPAREN )? # groupByOrExcept + | GROUP ALL expr ( TIME_AGG LPAREN TIME_UNIT RPAREN )? # groupAll +; havingClause: HAVING expr diff --git a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 index 4c8224f81..69acab45f 100644 --- a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 +++ b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 @@ -357,7 +357,7 @@ IDENTIFIER | (MONTH MINUS DAY MINUS YEAR) ;*/ -/*TIME_UNIT +TIME_UNIT : 'A' |'S' @@ -366,7 +366,7 @@ IDENTIFIER |'W' |'D' |'T' - ;*/ + ; /* old From c244b3c4af8a2ca9f45b19cfb4c22d00aa10e675 Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 18:07:41 +0200 Subject: [PATCH 10/17] Customize grammar --- vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 | 8 ++++---- .../src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 index 339a46d0a..64945f4ee 100644 --- a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 +++ b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 @@ -228,8 +228,8 @@ timeOperators: | CURRENT_DATE LPAREN RPAREN # currentDateAtom | DATEDIFF LPAREN dateFrom=expr COMMA dateTo=expr RPAREN # dateDiffAtom | DATEADD LPAREN op=expr COMMA shiftNumber=expr COMMA periodInd=expr RPAREN # dateAddAtom - | YEAR_OP LPAREN expr RPAREN # yearAtom - | MONTH_OP LPAREN expr RPAREN # monthAtom + | GETYEAR LPAREN expr RPAREN # yearAtom + | GETMONTH LPAREN expr RPAREN # monthAtom | DAYOFMONTH LPAREN expr RPAREN # dayOfMonthAtom | DAYOFYEAR LPAREN expr RPAREN # dayOfYearAtom | DAYTOYEAR LPAREN expr RPAREN # dayToYearAtom @@ -247,8 +247,8 @@ timeOperators: // | CURRENT_DATE LPAREN RPAREN # currentDateAtomComponent // | DATEDIFF LPAREN dateFrom=expr COMMA dateTo=expr RPAREN # dateDiffAtom // | DATEADD LPAREN op=expr COMMA shiftNumber=expr COMMA periodInd=expr RPAREN # dateAddAtom -// | YEAR_OP LPAREN expr RPAREN # yearAtom -// | MONTH_OP LPAREN expr RPAREN # monthAtom +// | GETYEAR LPAREN expr RPAREN # yearAtom +// | GETMONTH LPAREN expr RPAREN # monthAtom // | DAYOFMONTH LPAREN expr RPAREN # dayOfMonthAtom // | DAYOFYEAR LPAREN expr RPAREN # datOfYearAtom // | DAYTOYEAR LPAREN expr RPAREN # dayToYearAtom diff --git a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 index 69acab45f..77415891a 100644 --- a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 +++ b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/VtlTokens.g4 @@ -36,8 +36,8 @@ lexer grammar VtlTokens; CURRENT_DATE : 'current_date'; DATEDIFF : 'datediff'; DATEADD : 'dateadd'; - YEAR_OP : 'year'; - MONTH_OP : 'month'; + GETYEAR : 'getyear'; + GETMONTH : 'getmonth'; DAYOFMONTH : 'dayofmonth'; DAYOFYEAR : 'dayofyear'; DAYTOYEAR : 'daytoyear'; From 57e24669e2c91ab1e6a761f23e2d976ab6b5d997 Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 18:09:24 +0200 Subject: [PATCH 11/17] Reactivate testParquetMetadataWriting --- .../src/test/java/fr/insee/vtl/spark/SparkDatasetTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vtl-spark/src/test/java/fr/insee/vtl/spark/SparkDatasetTest.java b/vtl-spark/src/test/java/fr/insee/vtl/spark/SparkDatasetTest.java index dcfda4f91..32edbeab1 100644 --- a/vtl-spark/src/test/java/fr/insee/vtl/spark/SparkDatasetTest.java +++ b/vtl-spark/src/test/java/fr/insee/vtl/spark/SparkDatasetTest.java @@ -1,14 +1,13 @@ package fr.insee.vtl.spark; import fr.insee.vtl.engine.VtlScriptEngine; -import fr.insee.vtl.model.utils.Java8Helpers; import fr.insee.vtl.model.InMemoryDataset; +import fr.insee.vtl.model.utils.Java8Helpers; import org.apache.spark.api.java.function.FilterFunction; import org.apache.spark.sql.*; import org.apache.spark.sql.types.DataTypes; import org.apache.spark.sql.types.StructType; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -110,7 +109,6 @@ public void testParquetMetadataReading(@TempDir Path tmpDirectory) { assertTrue(readSparkDataset.getDataStructure().get("student_number").isAttribute()); } - @Disabled @Test public void testParquetMetadataWriting(@TempDir Path tmpDirectory) throws ScriptException { SparkDataset datasetWithoutMetadata = new SparkDataset(spark.read().parquet("src/main/resources/input_sample")); From aafc779c4b54c66e7a18cad7a43e5389b3c54c03 Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Mon, 7 Oct 2024 18:35:37 +0200 Subject: [PATCH 12/17] Add Random support in docs --- docs/docs/user-guide/coverage/numeric-operators.mdx | 2 +- .../current/user-guide/coverage/numeric-operators.mdx | 2 +- .../current/user-guide/coverage/numeric-operators.mdx | 2 +- .../current/user-guide/coverage/numeric-operators.mdx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/user-guide/coverage/numeric-operators.mdx b/docs/docs/user-guide/coverage/numeric-operators.mdx index 431504f97..1115709ab 100644 --- a/docs/docs/user-guide/coverage/numeric-operators.mdx +++ b/docs/docs/user-guide/coverage/numeric-operators.mdx @@ -24,6 +24,6 @@ custom_edit_url: null | Exponential | exp | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Natural logarithm | ln | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Power | power | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Random | random | :x: | :x: | :x: | +| Random | random | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Logarithm | log | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Square root | sqrt | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx index a10dd3207..1d93c2f0b 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx @@ -24,6 +24,6 @@ custom_edit_url: null | Exponentiel | exp | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Logarithme néperien | ln | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Puissance | power | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Random | random | :x: | :x: | :x: | +| Random | random | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Logarithme | log | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Racine carrée | sqrt | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx index b93ff1a2d..10bb1b9fb 100644 --- a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx +++ b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx @@ -24,6 +24,6 @@ custom_edit_url: null | Eksponentiell | exp | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Naturlig logaritme | ln | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Strøm | power | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Random | random | :x: | :x: | :x: | +| Random | random | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Logaritme | log | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Kvadratrot | sqrt | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx index 431504f97..1115709ab 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/numeric-operators.mdx @@ -24,6 +24,6 @@ custom_edit_url: null | Exponential | exp | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Natural logarithm | ln | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Power | power | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Random | random | :x: | :x: | :x: | +| Random | random | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Logarithm | log | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Square root | sqrt | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | From 3a6f264dee872833b119095cd955b3fcd9a1c01f Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Tue, 8 Oct 2024 23:33:27 +0200 Subject: [PATCH 13/17] Update Vtl.g4 --- vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 index 64945f4ee..df5136f27 100644 --- a/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 +++ b/vtl-parser/src/main/antlr4/fr/insee/vtl/parser/Vtl.g4 @@ -37,7 +37,7 @@ expr: | left=expr op=AND right=expr # booleanExpr | left=expr op=(OR|XOR) right=expr # booleanExpr | IF conditionalExpr=expr THEN thenExpr=expr ELSE elseExpr=expr # ifExpr - | CASE WHEN expr THEN expr (WHEN expr THEN expr)* ELSE expr # caseExpr + | CASE WHEN whenExpr=expr THEN thenExpr=expr (WHEN whenExpr=expr THEN thenExpr=expr)* ELSE elseExpr=expr # caseExpr | constant # constantExpr | varID # varIdExpr From 07c4e9790dc9029262060724f806c27d7e01afdd Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Tue, 8 Oct 2024 23:33:34 +0200 Subject: [PATCH 14/17] Support case operator --- .../fr/insee/vtl/engine/VtlNativeMethods.java | 10 +- .../insee/vtl/engine/utils/TypeChecking.java | 7 +- .../expression/ConditionalVisitor.java | 132 +++++++++++++++++- .../expression/ExpressionVisitor.java | 14 +- .../expression/ConditionalExprTest.java | 36 +++++ .../exceptions/InvalidTypeException.java | 2 - 6 files changed, 192 insertions(+), 9 deletions(-) diff --git a/vtl-engine/src/main/java/fr/insee/vtl/engine/VtlNativeMethods.java b/vtl-engine/src/main/java/fr/insee/vtl/engine/VtlNativeMethods.java index 9be3a852d..cc9abe1f1 100644 --- a/vtl-engine/src/main/java/fr/insee/vtl/engine/VtlNativeMethods.java +++ b/vtl-engine/src/main/java/fr/insee/vtl/engine/VtlNativeMethods.java @@ -1,17 +1,19 @@ package fr.insee.vtl.engine; import fr.insee.vtl.engine.utils.safetymirror.Fun; -import fr.insee.vtl.model.utils.Java8Helpers; import fr.insee.vtl.engine.visitors.expression.*; import fr.insee.vtl.engine.visitors.expression.functions.ComparisonFunctionsVisitor; import fr.insee.vtl.engine.visitors.expression.functions.DistanceFunctionsVisitor; import fr.insee.vtl.engine.visitors.expression.functions.NumericFunctionsVisitor; import fr.insee.vtl.engine.visitors.expression.functions.StringFunctionsVisitor; +import fr.insee.vtl.model.utils.Java8Helpers; import org.threeten.extra.Interval; import org.threeten.extra.PeriodDuration; import java.lang.reflect.Method; -import java.time.*; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZonedDateTime; import java.util.Set; public class VtlNativeMethods { @@ -45,6 +47,10 @@ public class VtlNativeMethods { Fun.toMethod(ConditionalVisitor::ifThenElse), Fun.toMethod(ConditionalVisitor::ifThenElse), Fun.toMethod(ConditionalVisitor::ifThenElse), + Fun.toMethod(ConditionalVisitor::caseFn), + Fun.toMethod(ConditionalVisitor::caseFn), + Fun.toMethod(ConditionalVisitor::caseFn), + Fun.toMethod(ConditionalVisitor::caseFn), Fun.toMethod(ConditionalVisitor::nvl), Fun.toMethod(ConditionalVisitor::nvl), Fun.toMethod(ConditionalVisitor::nvl), diff --git a/vtl-engine/src/main/java/fr/insee/vtl/engine/utils/TypeChecking.java b/vtl-engine/src/main/java/fr/insee/vtl/engine/utils/TypeChecking.java index c52b1f698..18fad5641 100644 --- a/vtl-engine/src/main/java/fr/insee/vtl/engine/utils/TypeChecking.java +++ b/vtl-engine/src/main/java/fr/insee/vtl/engine/utils/TypeChecking.java @@ -7,6 +7,7 @@ import fr.insee.vtl.model.exceptions.InvalidTypeException; import org.antlr.v4.runtime.tree.ParseTree; +import java.util.List; import java.util.Objects; import java.util.stream.Stream; @@ -92,11 +93,11 @@ public static boolean isNumberOrSameType(TypedExpression expression, Class ty /** * Checks if expressions have the same type (or null type). * - * @param expressions Resolvable expressions to check. + * @param expressions List of resolvable expressions to check. * @return A boolean which is true if the expressions have the same type, false otherwise. */ - public static boolean hasSameTypeOrNull(ResolvableExpression... expressions) { - return Stream.of(expressions) + public static boolean hasSameTypeOrNull(List expressions) { + return expressions.stream() .map(ResolvableExpression::getType) .filter(clazz -> !Object.class.equals(clazz)) .distinct() diff --git a/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/ConditionalVisitor.java b/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/ConditionalVisitor.java index 6cff51f86..02165ec74 100644 --- a/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/ConditionalVisitor.java +++ b/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/ConditionalVisitor.java @@ -1,18 +1,24 @@ package fr.insee.vtl.engine.visitors.expression; import fr.insee.vtl.engine.exceptions.VtlRuntimeException; -import fr.insee.vtl.model.utils.Java8Helpers; import fr.insee.vtl.engine.visitors.expression.functions.GenericFunctionsVisitor; import fr.insee.vtl.model.Positioned; import fr.insee.vtl.model.ResolvableExpression; +import fr.insee.vtl.model.exceptions.InvalidTypeException; import fr.insee.vtl.model.exceptions.VtlScriptException; +import fr.insee.vtl.model.utils.Java8Helpers; import fr.insee.vtl.parser.VtlBaseVisitor; import fr.insee.vtl.parser.VtlParser; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.stream.Collectors; import static fr.insee.vtl.engine.VtlScriptEngine.fromContext; +import static fr.insee.vtl.engine.utils.TypeChecking.assertBoolean; +import static fr.insee.vtl.engine.utils.TypeChecking.hasSameTypeOrNull; /** * IfVisitor is the base visitor for if-then-else expressions. @@ -62,6 +68,34 @@ public static Boolean ifThenElse(Boolean condition, Boolean thenExpr, Boolean el return condition ? thenExpr : elseExpr; } + public static Long caseFn(Boolean condition, Long thenExpr) { + if (condition == null) { + return null; + } + return condition ? thenExpr : null; + } + + public static Double caseFn(Boolean condition, Double thenExpr) { + if (condition == null) { + return null; + } + return condition ? thenExpr : null; + } + + public static String caseFn(Boolean condition, String thenExpr) { + if (condition == null) { + return null; + } + return condition ? thenExpr : null; + } + + public static Boolean caseFn(Boolean condition, Boolean thenExpr) { + if (condition == null) { + return null; + } + return condition ? thenExpr : null; + } + public static Long nvl(Long value, Long defaultValue) { return value == null ? defaultValue : value; } @@ -73,9 +107,11 @@ public static Double nvl(Double value, Double defaultValue) { public static Double nvl(Double value, Long defaultValue) { return value == null ? defaultValue.doubleValue() : value; } + public static Double nvl(Long value, Double defaultValue) { return value == null ? defaultValue : value.doubleValue(); } + public static String nvl(String value, String defaultValue) { return value == null ? defaultValue : value; } @@ -105,6 +141,100 @@ public ResolvableExpression visitIfExpr(VtlParser.IfExprContext ctx) { } } + /** + * Visits case expressions. + * + * @param ctx The scripting context for the expression. + * @return A ResolvableExpression resolving to the case resolution depending on the condition resolution. + */ + @Override + public ResolvableExpression visitCaseExpr(VtlParser.CaseExprContext ctx) { + Positioned pos = fromContext(ctx); + List exprs = ctx.expr(); + List whenExprs = new ArrayList<>(); + List thenExprs = new ArrayList<>(); + for (int i = 0; i < exprs.size() - 1; i = i + 2) { + whenExprs.add(exprs.get(i)); + thenExprs.add(exprs.get(i + 1)); + } + List whenExpressions = whenExprs.stream() + .map(e -> assertBoolean(exprVisitor.visit(e), e)) + .collect(Collectors.toList()); + List thenExpressions = thenExprs.stream() + .map(exprVisitor::visit) + .collect(Collectors.toList()); + ResolvableExpression elseExpression = exprVisitor.visit(exprs.get(exprs.size() - 1)); + List forTypeCheck = (new ArrayList<>(thenExpressions)); + forTypeCheck.add(elseExpression); + // TODO: handle better the default element position + if (!hasSameTypeOrNull(forTypeCheck)) { + try { + throw new InvalidTypeException( + forTypeCheck.get(0).getClass(), + Boolean.class, + fromContext(ctx.expr(0)) + ); + } catch (InvalidTypeException e) { + throw new RuntimeException(e); + } + } + + Class outputType = elseExpression.getType(); + + if (outputType.equals(String.class)) { + return ResolvableExpression.withType(String.class) + .withPosition(pos) + .using(context -> { + for (int i = 0; i < whenExprs.size(); i++) { + Boolean condition = (Boolean) whenExpressions.get(i).resolve(context); + if (condition) { + return (String) (new CastExpression(pos, thenExpressions.get(i), outputType)).resolve(context); + } + } + return (String) (new CastExpression(pos, elseExpression, outputType)).resolve(context); + }); + } + if (outputType.equals(Double.class)) { + return ResolvableExpression.withType(Double.class) + .withPosition(pos) + .using(context -> { + for (int i = 0; i < whenExprs.size(); i++) { + Boolean condition = (Boolean) whenExpressions.get(i).resolve(context); + if (condition) { + return (Double) (new CastExpression(pos, thenExpressions.get(i), outputType)).resolve(context); + } + } + return (Double) (new CastExpression(pos, elseExpression, outputType)).resolve(context); + }); + } + if (outputType.equals(Long.class)) { + return ResolvableExpression.withType(Long.class) + .withPosition(pos) + .using(context -> { + for (int i = 0; i < whenExprs.size(); i++) { + Boolean condition = (Boolean) whenExpressions.get(i).resolve(context); + if (condition) { + return (Long) (new CastExpression(pos, thenExpressions.get(i), outputType)).resolve(context); + } + } + return (Long) (new CastExpression(pos, elseExpression, outputType)).resolve(context); + }); + } + if (outputType.equals(Boolean.class)) { + return ResolvableExpression.withType(Boolean.class) + .withPosition(pos) + .using(context -> { + for (int i = 0; i < whenExprs.size(); i++) { + Boolean condition = (Boolean) whenExpressions.get(i).resolve(context); + if (condition) { + return (Boolean) (new CastExpression(pos, thenExpressions.get(i), outputType)).resolve(context); + } + } + return (Boolean) (new CastExpression(pos, elseExpression, outputType)).resolve(context); + }); + } else return null; + } + /** * Visits nvl expressions. * diff --git a/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/ExpressionVisitor.java b/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/ExpressionVisitor.java index 02976a614..8562a9e94 100644 --- a/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/ExpressionVisitor.java +++ b/vtl-engine/src/main/java/fr/insee/vtl/engine/visitors/expression/ExpressionVisitor.java @@ -3,13 +3,13 @@ import fr.insee.vtl.engine.VtlScriptEngine; import fr.insee.vtl.engine.exceptions.UnimplementedException; import fr.insee.vtl.engine.exceptions.VtlRuntimeException; -import fr.insee.vtl.model.utils.Java8Helpers; import fr.insee.vtl.engine.visitors.AnalyticsVisitor; import fr.insee.vtl.engine.visitors.ClauseVisitor; import fr.insee.vtl.engine.visitors.expression.functions.*; import fr.insee.vtl.model.*; import fr.insee.vtl.model.exceptions.InvalidTypeException; import fr.insee.vtl.model.exceptions.VtlScriptException; +import fr.insee.vtl.model.utils.Java8Helpers; import fr.insee.vtl.parser.VtlBaseVisitor; import fr.insee.vtl.parser.VtlParser; @@ -211,6 +211,18 @@ public ResolvableExpression visitIfExpr(VtlParser.IfExprContext ctx) { return conditionalVisitor.visit(ctx); } + /** + * Visits case expressions. + * + * @param ctx The scripting context for the expression. + * @return A ResolvableExpression resolving to the case resolution depending on the condition resolution. + * @see ConditionalVisitor#visitIfExpr(VtlParser.IfExprContext) + */ + @Override + public ResolvableExpression visitCaseExpr(VtlParser.CaseExprContext ctx) { + return conditionalVisitor.visit(ctx); + } + /** * Visits nvl expressions. * diff --git a/vtl-engine/src/test/java/fr/insee/vtl/engine/visitors/expression/ConditionalExprTest.java b/vtl-engine/src/test/java/fr/insee/vtl/engine/visitors/expression/ConditionalExprTest.java index 207ea1ab2..a53c5e12e 100644 --- a/vtl-engine/src/test/java/fr/insee/vtl/engine/visitors/expression/ConditionalExprTest.java +++ b/vtl-engine/src/test/java/fr/insee/vtl/engine/visitors/expression/ConditionalExprTest.java @@ -58,6 +58,42 @@ public void testIfExpr() throws ScriptException { assertThat(((Dataset) res).getDataStructure().get("bool_var").getType()).isEqualTo(Long.class); } + @Test + public void testCaseExpr() throws ScriptException { + ScriptContext context = engine.getContext(); + engine.eval("s := case when true then \"no\" else \"else\";"); + assertThat(context.getAttribute("s")).isEqualTo("no"); + engine.eval("s := case when false then \"no\" else \"else\";"); + assertThat(context.getAttribute("s")).isEqualTo("else"); + engine.eval("s := case when false then \"no\" when true then \"yes\" else \"else\";"); + assertThat(context.getAttribute("s")).isEqualTo("yes"); + engine.eval("s := case when false then \"no\" when 1=2 then \"yes\" else \"else\";"); + assertThat(context.getAttribute("s")).isEqualTo("else"); + + engine.getContext().setAttribute("ds_1", DatasetSamples.ds1, ScriptContext.ENGINE_SCOPE); + engine.getContext().setAttribute("ds_2", DatasetSamples.ds2, ScriptContext.ENGINE_SCOPE); + engine.eval("ds1 := ds_1[keep id, long1]; " + + "res <- ds1[calc c := case when long1 > 30 then \"ok\" else \"ko\"][drop long1];"); + Object res = engine.getContext().getAttribute("res"); + assertThat(((Dataset) res).getDataAsMap()).containsExactlyInAnyOrder( + Java8Helpers.mapOf("id", "Toto", "c", "ko"), + Java8Helpers.mapOf("id", "Hadrien", "c", "ko"), + Java8Helpers.mapOf("id", "Nico", "c", "ko"), + Java8Helpers.mapOf("id", "Franck", "c", "ok") + ); + assertThat(((Dataset) res).getDataStructure().get("c").getType()).isEqualTo(String.class); + engine.eval("ds1 := ds_1[keep id, long1]; " + + "res1 <- ds1[calc c := case when long1 > 30 then 1 else 0][drop long1];"); + Object res1 = engine.getContext().getAttribute("res1"); + assertThat(((Dataset) res1).getDataAsMap()).containsExactlyInAnyOrder( + Java8Helpers.mapOf("id", "Toto", "c", 0L), + Java8Helpers.mapOf("id", "Hadrien", "c", 0L), + Java8Helpers.mapOf("id", "Nico", "c", 0L), + Java8Helpers.mapOf("id", "Franck", "c", 1L) + ); + assertThat(((Dataset) res1).getDataStructure().get("c").getType()).isEqualTo(Long.class); + } + @Test public void testNvlExpr() throws ScriptException { ScriptContext context = engine.getContext(); diff --git a/vtl-model/src/main/java/fr/insee/vtl/model/exceptions/InvalidTypeException.java b/vtl-model/src/main/java/fr/insee/vtl/model/exceptions/InvalidTypeException.java index ee2b246ed..4781ac978 100644 --- a/vtl-model/src/main/java/fr/insee/vtl/model/exceptions/InvalidTypeException.java +++ b/vtl-model/src/main/java/fr/insee/vtl/model/exceptions/InvalidTypeException.java @@ -3,8 +3,6 @@ import fr.insee.vtl.model.Positioned; import fr.insee.vtl.model.utils.Java8Helpers; -import java.util.Collections; -import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; From 41d1b6ff93719d07a081682422d8641bbb0487f8 Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Tue, 8 Oct 2024 23:40:02 +0200 Subject: [PATCH 15/17] Update docs --- docs/docs/user-guide/coverage/conditional-operators.mdx | 2 +- .../current/user-guide/coverage/conditional-operators.mdx | 2 +- .../current/user-guide/coverage/conditional-operators.mdx | 2 +- .../current/user-guide/coverage/conditional-operators.mdx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/user-guide/coverage/conditional-operators.mdx b/docs/docs/user-guide/coverage/conditional-operators.mdx index 947d7e5bd..28f828b25 100644 --- a/docs/docs/user-guide/coverage/conditional-operators.mdx +++ b/docs/docs/user-guide/coverage/conditional-operators.mdx @@ -9,5 +9,5 @@ custom_edit_url: null | Name | Symbol | Boolean | Component | Dataset | | ------------ | :----------- | :----------------: | :----------------: | :----------------: | | If Then Else | if-then-else | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Case | case | :x: | :x: | :x: | +| Case | case | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Nvl | nvl | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx index 3d6cfa413..09af67af5 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx @@ -9,5 +9,5 @@ custom_edit_url: null | Nom | Symbole | Boolean | Component | Dataset | | -------------- | :----------- | :----------------: | :----------------: | :----------------: | | Si Alors Sinon | if-then-else | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Cas | case | :x: | :x: | :x: | +| Cas | case | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Valeur nulle | nvl | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx index 4e7cac1e8..88deaa3c0 100644 --- a/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx +++ b/docs/i18n/no/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx @@ -9,5 +9,5 @@ custom_edit_url: null | Navn | Symbol | Boolean | Component | Dataset | | ----------- | :----------- | :----------------: | :----------------: | :----------------: | | Om så annet | if-then-else | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Sak | case | :x: | :x: | :x: | +| Sak | case | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Null verdi | nvl | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx index 947d7e5bd..28f828b25 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/coverage/conditional-operators.mdx @@ -9,5 +9,5 @@ custom_edit_url: null | Name | Symbol | Boolean | Component | Dataset | | ------------ | :----------- | :----------------: | :----------------: | :----------------: | | If Then Else | if-then-else | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Case | case | :x: | :x: | :x: | +| Case | case | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Nvl | nvl | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | From 23ebd84a364635d0172d23c4f777a352ffcaf23f Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Wed, 9 Oct 2024 00:08:00 +0200 Subject: [PATCH 16/17] Add references to README --- README.md | 14 ++++ docs/static/img/sdmx-io-logo.svg | 136 +++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 docs/static/img/sdmx-io-logo.svg diff --git a/README.md b/README.md index 96031c1bd..4564bc09a 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,17 @@ If you want to contribute, see this [guide](docs/CONTRIBUTING.md). ## Requirements Open JDK 8+ is required. + +## References + +

+ +

+ +Trevas is part of the [sdmx.io](https://www.sdmx.io/) ecosystem. + +

+ +

+ +Trevas is referencing by [_Awesome official statistics software_](https://github.com/SNStatComp/awesome-official-statistics-software) diff --git a/docs/static/img/sdmx-io-logo.svg b/docs/static/img/sdmx-io-logo.svg new file mode 100644 index 000000000..c9cf67edd --- /dev/null +++ b/docs/static/img/sdmx-io-logo.svg @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 6c631135772d956aeeefb4fe952940c74ea47373 Mon Sep 17 00:00:00 2001 From: Franck Cotton Date: Wed, 9 Oct 2024 08:39:16 +0200 Subject: [PATCH 17/17] Bump to version 1.7.0 --- coverage/pom.xml | 14 +++++++------- pom.xml | 2 +- vtl-csv/pom.xml | 6 +++--- vtl-engine/pom.xml | 8 ++++---- vtl-jackson/pom.xml | 6 +++--- vtl-jdbc/pom.xml | 8 ++++---- vtl-model/pom.xml | 4 ++-- vtl-parser/pom.xml | 4 ++-- vtl-prov/pom.xml | 6 +++--- vtl-sdmx/pom.xml | 12 ++++++------ vtl-spark/pom.xml | 8 ++++---- 11 files changed, 39 insertions(+), 39 deletions(-) diff --git a/coverage/pom.xml b/coverage/pom.xml index b33380b64..9ab5110b7 100644 --- a/coverage/pom.xml +++ b/coverage/pom.xml @@ -6,7 +6,7 @@ fr.insee.trevas trevas-parent - 1.7.0-SNAPSHOT + 1.7.0 coverage @@ -22,32 +22,32 @@ fr.insee.trevas vtl-engine - 1.7.0-SNAPSHOT + 1.7.0 fr.insee.trevas vtl-jackson - 1.7.0-SNAPSHOT + 1.7.0 fr.insee.trevas vtl-jdbc - 1.7.0-SNAPSHOT + 1.7.0 fr.insee.trevas vtl-model - 1.7.0-SNAPSHOT + 1.7.0 fr.insee.trevas vtl-parser - 1.7.0-SNAPSHOT + 1.7.0 fr.insee.trevas vtl-spark - 1.7.0-SNAPSHOT + 1.7.0
diff --git a/pom.xml b/pom.xml index 88d1b96b5..98cef9395 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ fr.insee.trevas trevas-parent pom - 1.7.0-SNAPSHOT + 1.7.0 vtl-parser vtl-model diff --git a/vtl-csv/pom.xml b/vtl-csv/pom.xml index b0b057fdf..9c0af0afc 100644 --- a/vtl-csv/pom.xml +++ b/vtl-csv/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.7.0-SNAPSHOT + 1.7.0 vtl-csv VTL CSV CSV module for the VTL model - 1.7.0-SNAPSHOT + 1.7.0 @@ -25,7 +25,7 @@ fr.insee.trevas vtl-model - 1.7.0-SNAPSHOT + 1.7.0 net.sf.supercsv diff --git a/vtl-engine/pom.xml b/vtl-engine/pom.xml index 8247362ce..dc429e899 100644 --- a/vtl-engine/pom.xml +++ b/vtl-engine/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.7.0-SNAPSHOT + 1.7.0 vtl-engine VTL Engine VTL engine framework for Trevas - 1.7.0-SNAPSHOT + 1.7.0 @@ -25,13 +25,13 @@ fr.insee.trevas vtl-parser - 1.7.0-SNAPSHOT + 1.7.0 compile fr.insee.trevas vtl-model - 1.7.0-SNAPSHOT + 1.7.0 compile diff --git a/vtl-jackson/pom.xml b/vtl-jackson/pom.xml index 782b3d1e2..700f79375 100644 --- a/vtl-jackson/pom.xml +++ b/vtl-jackson/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.7.0-SNAPSHOT + 1.7.0 vtl-jackson VTL Jackson Jackson module for the VTL model - 1.7.0-SNAPSHOT + 1.7.0 @@ -25,7 +25,7 @@ fr.insee.trevas vtl-model - 1.7.0-SNAPSHOT + 1.7.0 compile diff --git a/vtl-jdbc/pom.xml b/vtl-jdbc/pom.xml index 02ac3cbbd..596b66cd6 100644 --- a/vtl-jdbc/pom.xml +++ b/vtl-jdbc/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.7.0-SNAPSHOT + 1.7.0 vtl-jdbc VTL JDBC Dataset wrapper around JDBC result set. Useful to expose SQL tables as VTL datasets - 1.7.0-SNAPSHOT + 1.7.0 @@ -25,14 +25,14 @@ fr.insee.trevas vtl-model - 1.7.0-SNAPSHOT + 1.7.0 compile fr.insee.trevas vtl-engine - 1.7.0-SNAPSHOT + 1.7.0 test diff --git a/vtl-model/pom.xml b/vtl-model/pom.xml index 8574e8263..995da2e1c 100644 --- a/vtl-model/pom.xml +++ b/vtl-model/pom.xml @@ -7,7 +7,7 @@ fr.insee.trevas trevas-parent - 1.7.0-SNAPSHOT + 1.7.0 @@ -21,7 +21,7 @@ vtl-model VTL Model Model describing VTL expressions and bindings - 1.7.0-SNAPSHOT + 1.7.0 diff --git a/vtl-parser/pom.xml b/vtl-parser/pom.xml index e9086fce3..2bbcc55cf 100644 --- a/vtl-parser/pom.xml +++ b/vtl-parser/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.7.0-SNAPSHOT + 1.7.0 vtl-parser VTL Parser Artifacts generated by Antlr from the VTL grammar files - 1.7.0-SNAPSHOT + 1.7.0 diff --git a/vtl-prov/pom.xml b/vtl-prov/pom.xml index dd0f08ae5..6df502fb8 100644 --- a/vtl-prov/pom.xml +++ b/vtl-prov/pom.xml @@ -7,14 +7,14 @@ fr.insee.trevas trevas-parent - 1.7.0-SNAPSHOT + 1.7.0 VTL Provenance Provenance static analysis vtl-prov - 1.7.0-SNAPSHOT + 1.7.0 @@ -32,7 +32,7 @@ fr.insee.trevas vtl-parser - 1.7.0-SNAPSHOT + 1.7.0 diff --git a/vtl-sdmx/pom.xml b/vtl-sdmx/pom.xml index 99c65ab87..d118eb258 100644 --- a/vtl-sdmx/pom.xml +++ b/vtl-sdmx/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.7.0-SNAPSHOT + 1.7.0 vtl-sdmx VTL SDMX Dataset wrapper around SDMX - 1.7.0-SNAPSHOT + 1.7.0 @@ -40,24 +40,24 @@ fr.insee.trevas vtl-model - 1.7.0-SNAPSHOT + 1.7.0 fr.insee.trevas vtl-engine - 1.7.0-SNAPSHOT + 1.7.0 test fr.insee.trevas vtl-csv - 1.7.0-SNAPSHOT + 1.7.0 test fr.insee.trevas vtl-spark - 1.7.0-SNAPSHOT + 1.7.0 test diff --git a/vtl-spark/pom.xml b/vtl-spark/pom.xml index 768c5f8cd..5406c2d0d 100644 --- a/vtl-spark/pom.xml +++ b/vtl-spark/pom.xml @@ -7,13 +7,13 @@ fr.insee.trevas trevas-parent - 1.7.0-SNAPSHOT + 1.7.0 vtl-spark VTL Spark Trevas engine for Apache Spark - 1.7.0-SNAPSHOT + 1.7.0 @@ -25,13 +25,13 @@ fr.insee.trevas vtl-model - 1.7.0-SNAPSHOT + 1.7.0 compile fr.insee.trevas vtl-engine - 1.7.0-SNAPSHOT + 1.7.0 test