From 71df43fdab27076937ffe95f8ed8437f875f6e4f Mon Sep 17 00:00:00 2001 From: Pere Miquel Brull Date: Wed, 9 Aug 2023 09:41:41 +0200 Subject: [PATCH] Fix impala migration query (#12809) --- .../v014__create_db_connection_info.sql | 3 ++- .../org.postgresql.Driver/v014__create_db_connection_info.sql | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v014__create_db_connection_info.sql b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v014__create_db_connection_info.sql index cf03aff2f94..6da982a11d1 100644 --- a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v014__create_db_connection_info.sql +++ b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v014__create_db_connection_info.sql @@ -36,7 +36,8 @@ WHERE serviceType in ('Snowflake') AND JSON_EXTRACT(json, '$.connection.config.i UPDATE dbservice_entity SET json = JSON_REPLACE(json, '$.connection.config.scheme', 'hive') -WHERE JSON_EXTRACT(json, '$.connection.config.scheme') IN ('impala', 'impala4'); +WHERE JSON_EXTRACT(json, '$.connection.config.scheme') IN ('impala', 'impala4') +AND serviceType = 'Hive'; -- remove the dataModel references from Data Models UPDATE dashboard_data_model_entity diff --git a/bootstrap/sql/org.postgresql.Driver/v014__create_db_connection_info.sql b/bootstrap/sql/org.postgresql.Driver/v014__create_db_connection_info.sql index 4035765ec8c..553a5fa1baf 100644 --- a/bootstrap/sql/org.postgresql.Driver/v014__create_db_connection_info.sql +++ b/bootstrap/sql/org.postgresql.Driver/v014__create_db_connection_info.sql @@ -32,7 +32,8 @@ where serviceType in ('Snowflake') and json#>'{connection,config,includeTempTabl update dbservice_entity set json = jsonb_set(json::jsonb, '{connection,config,scheme}', '"hive"') -where json#>>'{connection,config,scheme}' in ('impala', 'impala4'); +where json#>>'{connection,config,scheme}' in ('impala', 'impala4') +and serviceType = 'Hive'; -- remove the dataModel references from Data Models UPDATE dashboard_data_model_entity SET json = json #- '{dataModels}';