apache / gravitino

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
https://gravitino.apache.org
Apache License 2.0
1.09k stars 343 forks source link

[Improvement] Version manange for H2 database like MySQL #4022

Closed yuqi1129 closed 4 months ago

yuqi1129 commented 4 months ago

What would you like to be improved?

DDL and table definition have used version management in the MySQL database, H2 database should also add it.

image

How should we improve?

Change file schema-h2.sql to schema-0.6.0-mysql.sql and other necessary changes.

lw-yang commented 4 months ago

@yuqi1129 We will support the h2 database in version 0.6.0. I think we only needs to change the file schema-h2.sql to schema-0.6.0-mysql.sql, and there's no need for other upgrade operations.

yuqi1129 commented 4 months ago

I recall that you used the procedure to insert some data to MySQL. Is it not necessary for the H2 database?

lw-yang commented 4 months ago

@yuqi1129 We use procedure to initialize data in MySQL because there is already some existing metalakes in MySQL. However, h2 only started supporting in version 0.6.0, there is no existing metalake in the database, so there is no need for initialization.

yuqi1129 commented 4 months ago

OK, please go ahead.

yuqi1129 commented 4 months ago

@lw-yang Please refer to Apache Hive's handling of schema upgrades for derby. https://github.com/apache/hive/tree/branch-3/metastore/scripts/upgrade/derby