This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new b723e4abe [KYUUBI #4950][FOLLOWUP] SQLite schema files should start 
from 1.8.0
b723e4abe is described below

commit b723e4abe0c2e1d2cb8026d41b5760a5b3e76ba9
Author: Cheng Pan <[email protected]>
AuthorDate: Wed Jun 14 14:54:59 2023 +0800

    [KYUUBI #4950][FOLLOWUP] SQLite schema files should start from 1.8.0
    
    ### _Why are the changes needed?_
    
    SQLite is added since 1.8.0
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #4955 from pan3793/sqlite-init.
    
    Closes #4950
    
    24de565cf [Cheng Pan] [KYUUBI #4950][FOLLOWUP] SQLite schema files should 
start from 1.8.0
    
    Authored-by: Cheng Pan <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../sql/sqlite/001-KYUUBI-3967.sqlite.sql          | 47 ----------------------
 .../sql/sqlite/002-KYUUBI-4119.sqlite.sql          |  3 --
 kyuubi-server/src/main/resources/sql/sqlite/README | 20 ++++-----
 .../sqlite/metadata-store-schema-1.6.0.sqlite.sql  | 35 ----------------
 ....sql => metadata-store-schema-1.8.0.sqlite.sql} |  0
 .../sql/sqlite/upgrade-1.6.0-to-1.7.0.sqlite.sql   |  4 --
 6 files changed, 10 insertions(+), 99 deletions(-)

diff --git 
a/kyuubi-server/src/main/resources/sql/sqlite/001-KYUUBI-3967.sqlite.sql 
b/kyuubi-server/src/main/resources/sql/sqlite/001-KYUUBI-3967.sqlite.sql
deleted file mode 100644
index 3809d16fa..000000000
--- a/kyuubi-server/src/main/resources/sql/sqlite/001-KYUUBI-3967.sqlite.sql
+++ /dev/null
@@ -1,47 +0,0 @@
-SELECT '< KYUUBI-3967: Shorten column varchar length of metadata table >' AS ' 
';
-
-BEGIN;
-
-CREATE TABLE metadata_X(
-    key_id INTEGER PRIMARY KEY AUTOINCREMENT, -- the auto increment key id
-    identifier varchar(36) NOT NULL, -- the identifier id, which is an UUID
-    session_type varchar(32) NOT NULL, -- the session type, SQL or BATCH
-    real_user varchar(255) NOT NULL, -- the real user
-    user_name varchar(255) NOT NULL, -- the user name, might be a proxy user
-    ip_address varchar(128), -- the client ip address
-    kyuubi_instance varchar(1024) NOT NULL, -- the kyuubi instance that 
creates this
-    state varchar(128) NOT NULL, -- the session state
-    resource varchar(1024), -- the main resource
-    class_name varchar(1024), -- the main class name
-    request_name varchar(1024), -- the request name
-    request_conf mediumtext, -- the request config map
-    request_args mediumtext, -- the request arguments
-    create_time BIGINT NOT NULL, -- the metadata create time
-    engine_type varchar(32) NOT NULL, -- the engine type
-    cluster_manager varchar(128), -- the engine cluster manager
-    engine_id varchar(128), -- the engine application id
-    engine_name mediumtext, -- the engine application name
-    engine_url varchar(1024), -- the engine tracking url
-    engine_state varchar(32), -- the engine application state
-    engine_error mediumtext, -- the engine application diagnose
-    end_time bigint, -- the metadata end time
-    peer_instance_closed boolean default '0' -- closed by peer kyuubi instance
-);
-
-INSERT INTO metadata_X SELECT * FROM metadata;
-
-DROP TABLE metadata;
-
-ALTER TABLE metadata_X RENAME TO metadata;
-
-CREATE INDEX metadata_kyuubi_instance_index ON metadata(kyuubi_instance);
-
-CREATE UNIQUE INDEX metadata_unique_identifier_index ON metadata(identifier);
-
-CREATE INDEX metadata_user_name_index ON metadata(user_name);
-
-CREATE INDEX metadata_engine_type_index ON metadata(engine_type);
-
-COMMIT;
-
-DROP INDEX metadata_kyuubi_instance_index;
diff --git 
a/kyuubi-server/src/main/resources/sql/sqlite/002-KYUUBI-4119.sqlite.sql 
b/kyuubi-server/src/main/resources/sql/sqlite/002-KYUUBI-4119.sqlite.sql
deleted file mode 100644
index 12bee3250..000000000
--- a/kyuubi-server/src/main/resources/sql/sqlite/002-KYUUBI-4119.sqlite.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-SELECT '< KYUUBI-4119: Return app submission time for batch >' AS ' ';
-
-ALTER TABLE metadata ADD COLUMN engine_open_time bigint;
diff --git a/kyuubi-server/src/main/resources/sql/sqlite/README 
b/kyuubi-server/src/main/resources/sql/sqlite/README
index 38341f6d3..de15931f5 100644
--- a/kyuubi-server/src/main/resources/sql/sqlite/README
+++ b/kyuubi-server/src/main/resources/sql/sqlite/README
@@ -21,8 +21,8 @@ Kyuubi MetaStore Upgrade HowTo
 This document describes how to upgrade the schema of a SQLite backed
 Kyuubi MetaStore instance from one release version of Kyuubi to another
 release version of Kyuubi. For example, by following the steps listed
-below it is possible to upgrade a Kyuubi 1.6.0 MetaStore schema to a
-Kyuubi 1.7.0 MetaStore schema. Before attempting this project we
+below it is possible to upgrade a Kyuubi 1.8.0 MetaStore schema to a
+Kyuubi 1.9.0 MetaStore schema. Before attempting this project we
 strongly recommend that you read through all of the steps in this
 document and familiarize yourself with the required tools.
 
@@ -60,14 +60,14 @@ MetaStore Upgrade Steps
    be resolved manually or the upgrade scripts will fail to complete.
 
 5) You are now ready to run the schema upgrade scripts. If you are
-   upgrading from Kyuubi 1.6.0 to Kyuubi 1.7.0 you need to run the
-   upgrade-1.6.0-to-1.7.0.sqlite.sql script, but if you are upgrading
-   from 1.6.0 to 1.8.0 you will need to run the 1.6.0 to 1.7.0 upgrade
-   script followed by the 1.7.0 to 1.8.0 upgrade script.
+   upgrading from Kyuubi 1.8.0 to Kyuubi 1.9.0 you need to run the
+   upgrade-1.8.0-to-1.9.0.sqlite.sql script, but if you are upgrading
+   from 1.8.0 to 2.0.0 you will need to run the 1.8.0 to 1.9.0 upgrade
+   script followed by the 1.9.0 to 2.0.0 upgrade script.
 
    % sqlite3 <metastore_db_name>.db
-   sqlite> .read  upgrade-1.6.0-to-1.7.0.sqlite.sql
-   sqlite> .read  upgrade-1.7.0-to-1.8.0.sqlite.sql
+   sqlite> .read  upgrade-1.8.0-to-1.9.0.sqlite.sql
+   sqlite> .read  upgrade-1.9.0-to-2.0.0.sqlite.sql
 
    These scripts should run to completion without any errors. If you
    do encounter errors you need to analyze the cause and attempt to
@@ -77,6 +77,6 @@ MetaStore Upgrade Steps
    upgraded schema against the official schema for your particular
    version of Kyuubi. This is accomplished by repeating steps (3) and
    (4), but this time comparing against the official version of the
-   upgraded schema, e.g. if you upgraded the schema to Kyuubi 1.7.0 then
+   upgraded schema, e.g. if you upgraded the schema to Kyuubi 1.9.0 then
    you will want to compare your schema dump against the contents of
-   metadata-store-schema-1.7.0.sqlite.sql
+   metadata-store-schema-1.9.0.sqlite.sql
diff --git 
a/kyuubi-server/src/main/resources/sql/sqlite/metadata-store-schema-1.6.0.sqlite.sql
 
b/kyuubi-server/src/main/resources/sql/sqlite/metadata-store-schema-1.6.0.sqlite.sql
deleted file mode 100644
index c444a96ce..000000000
--- 
a/kyuubi-server/src/main/resources/sql/sqlite/metadata-store-schema-1.6.0.sqlite.sql
+++ /dev/null
@@ -1,35 +0,0 @@
--- the metadata table ddl
-
-CREATE TABLE IF NOT EXISTS metadata(
-    key_id INTEGER PRIMARY KEY AUTOINCREMENT, -- the auto increment key id
-    identifier varchar(36) NOT NULL, -- the identifier id, which is an UUID
-    session_type varchar(128) NOT NULL, -- the session type, SQL or BATCH
-    real_user varchar(1024) NOT NULL, -- the real user
-    user_name varchar(1024) NOT NULL, -- the user name, might be a proxy user
-    ip_address varchar(512), -- the client ip address
-    kyuubi_instance varchar(1024) NOT NULL, -- the kyuubi instance that 
creates this
-    state varchar(128) NOT NULL, -- the session state
-    resource varchar(1024), -- the main resource
-    class_name varchar(1024), -- the main class name
-    request_name varchar(1024), -- the request name
-    request_conf mediumtext, -- the request config map
-    request_args mediumtext, -- the request arguments
-    create_time BIGINT NOT NULL, -- the metadata create time
-    engine_type varchar(1024) NOT NULL, -- the engine type
-    cluster_manager varchar(128), -- the engine cluster manager
-    engine_id varchar(128), -- the engine application id
-    engine_name mediumtext, -- the engine application name
-    engine_url varchar(1024), -- the engine tracking url
-    engine_state varchar(128), -- the engine application state
-    engine_error mediumtext, -- the engine application diagnose
-    end_time bigint, -- the metadata end time
-    peer_instance_closed boolean default '0' -- closed by peer kyuubi instance
-);
-
-CREATE INDEX IF NOT EXISTS metadata_kyuubi_instance_index ON 
metadata(kyuubi_instance);
-
-CREATE UNIQUE INDEX IF NOT EXISTS metadata_unique_identifier_index ON 
metadata(identifier);
-
-CREATE INDEX IF NOT EXISTS metadata_user_name_index ON metadata(user_name);
-
-CREATE INDEX IF NOT EXISTS metadata_engine_type_index ON metadata(engine_type);
diff --git 
a/kyuubi-server/src/main/resources/sql/sqlite/metadata-store-schema-1.7.0.sqlite.sql
 
b/kyuubi-server/src/main/resources/sql/sqlite/metadata-store-schema-1.8.0.sqlite.sql
similarity index 100%
rename from 
kyuubi-server/src/main/resources/sql/sqlite/metadata-store-schema-1.7.0.sqlite.sql
rename to 
kyuubi-server/src/main/resources/sql/sqlite/metadata-store-schema-1.8.0.sqlite.sql
diff --git 
a/kyuubi-server/src/main/resources/sql/sqlite/upgrade-1.6.0-to-1.7.0.sqlite.sql 
b/kyuubi-server/src/main/resources/sql/sqlite/upgrade-1.6.0-to-1.7.0.sqlite.sql
deleted file mode 100644
index f9a663ef1..000000000
--- 
a/kyuubi-server/src/main/resources/sql/sqlite/upgrade-1.6.0-to-1.7.0.sqlite.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-SELECT '< Upgrading MetaStore schema from 1.6.0 to 1.7.0 >' AS ' ';
-.read 001-KYUUBI-3967.sqlite.sql
-.read 002-KYUUBI-4119.sqlite.sql
-SELECT '< Finished upgrading MetaStore schema from 1.6.0 to 1.7.0 >' AS ' ';

Reply via email to