From e2d53105d1ff84863e1ae8fd74de3502785b66c5 Mon Sep 17 00:00:00 2001 From: LSmyrnaios Date: Fri, 7 Oct 2022 15:51:31 +0300 Subject: [PATCH] Fix not creating the "assignment" table in a new production database, which contains only the "publication" and "datasource" data. --- .../urls_controller/configuration/ImpalaConnector.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/openaire/urls_controller/configuration/ImpalaConnector.java b/src/main/java/eu/openaire/urls_controller/configuration/ImpalaConnector.java index 1f3e2f6..acfcbd9 100644 --- a/src/main/java/eu/openaire/urls_controller/configuration/ImpalaConnector.java +++ b/src/main/java/eu/openaire/urls_controller/configuration/ImpalaConnector.java @@ -68,9 +68,6 @@ public class ImpalaConnector { jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS " + testDatabaseName + ".datasource stored as parquet as select * from " + initialDatabaseName + ".datasource"); jdbcTemplate.execute("COMPUTE STATS " + testDatabaseName + ".datasource"); - jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS " + testDatabaseName + ".assignment (id string, original_url string, workerid string, `date` timestamp) stored as parquet"); - jdbcTemplate.execute("COMPUTE STATS " + testDatabaseName + ".assignment"); - databaseName = testDatabaseName; // For the rest of the queries. } else { logger.info("Going to create or validate the tables that are populated by the Controller, for the \"initialDatabase\" = \"" + initialDatabaseName + "\""); @@ -82,6 +79,9 @@ public class ImpalaConnector { // Drop the "current_assignment" table. It is a temporary table which is created on-demand during execution. jdbcTemplate.execute("DROP TABLE IF EXISTS " + databaseName + ".current_assignment PURGE"); + jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS " + testDatabaseName + ".assignment (id string, original_url string, workerid string, `date` timestamp) stored as parquet"); + jdbcTemplate.execute("COMPUTE STATS " + testDatabaseName + ".assignment"); + jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS " + databaseName + ".attempt (id string, original_url string, `date` timestamp, status string, error_class string, error_message string) stored as parquet"); jdbcTemplate.execute("COMPUTE STATS " + databaseName + ".attempt");