FANNG1 commented on code in PR #14904:
URL: https://github.com/apache/gravitino/pull/14904#discussion_r4642153922


##########
scripts/h2/iceberg-jdbc-schema-h2.sql:
##########
@@ -0,0 +1,36 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"). You may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--  http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+--
+
+CREATE TABLE IF NOT EXISTS iceberg_tables (
+    catalog_name VARCHAR(255) NOT NULL,
+    table_namespace VARCHAR(255) NOT NULL,
+    table_name VARCHAR(255) NOT NULL,
+    metadata_location VARCHAR(1000),
+    previous_metadata_location VARCHAR(1000),
+    iceberg_type VARCHAR(5),

Review Comment:
   [P2] Document the H2 identifier casing required for manual initialization
   
   With H2 2.2.224's default settings, this script creates 
`ICEBERG_TABLES.ICEBERG_TYPE` in uppercase. Iceberg 1.11.0 looks up the column 
under lowercase names in JDBC metadata. The lookup misses, so catalog 
initialization attempts `ALTER TABLE iceberg_tables ADD COLUMN iceberg_type 
VARCHAR(5)` even with `jdbc-initialize=false`. I reproduced the resulting H2 
error 90096 (not enough rights) with a DML-only account on a fresh database.
   
   The same script and account work when the H2 database is created and 
accessed with `DATABASE_TO_LOWER=TRUE`. Could we document that requirement in 
both guides and add a test that initializes the catalog with a DML-only account 
after running the script?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to