danhuawang commented on code in PR #111:
URL: 
https://github.com/apache/gravitino-playground/pull/111#discussion_r1976246049


##########
init/common/init_metalake_catalog.sh:
##########
@@ -64,9 +73,12 @@ if echo "$response" | grep -q "\"code\":0"; then
 else
   # Create Mysql catalog for experience Gravitino service
   response=$(curl -X POST -H "Accept: application/vnd.gravitino.v1+json" -H 
"Content-Type: application/json" -d '{ "name":"catalog_mysql", 
"type":"RELATIONAL", "provider":"jdbc-mysql", "comment":"comment", 
"properties":{ "jdbc-url":"jdbc:mysql://'${MYSQL_HOST_IP}':3306", 
"jdbc-user":"mysql", "jdbc-password":"mysql", "jdbc-driver": 
"com.mysql.cj.jdbc.Driver" } }' 
http://gravitino:8090/api/metalakes/metalake_demo/catalogs)
-  
+
   if echo "$response" | grep -q "catalog_mysql"; then
     true # Placeholder, do nothing
+  elif echo "$response" | grep -q 
"\"type\":\"CatalogAlreadyExistsException\""; then
+    echo "Catalog catalog_mysql already exists"
+    true # Placeholder, do nothing

Review Comment:
   If there's old catalog data in gravitino, will it cause the test cases run 
failed ?



##########
init/common/init_metalake_catalog.sh:
##########
@@ -78,9 +90,12 @@ if echo "$response" | grep -q "\"code\":0"; then
   true
 else
   # Create Iceberg catalog for experience Gravitino service
-  response=$(curl -X POST -H "Accept: application/vnd.gravitino.v1+json" -H 
"Content-Type: application/json" -d '{ "name":"catalog_iceberg", 
"type":"RELATIONAL", "provider":"lakehouse-iceberg", "comment":"comment", 
"properties":{ "uri":"jdbc:mysql://'${MYSQL_HOST_IP}':3306/db", 
"catalog-backend":"jdbc", 
"warehouse":"hdfs://'${HIVE_HOST_IP}':9000/user/iceberg/warehouse/", 
"jdbc-user":"mysql", "jdbc-password":"mysql", 
"jdbc-driver":"com.mysql.cj.jdbc.Driver"} }' 
http://gravitino:8090/api/metalakes/metalake_demo/catalogs)
+  response=$(curl -X POST -H "Accept: application/vnd.gravitino.v1+json" -H 
"Content-Type: application/json" -d '{ "name":"catalog_iceberg", 
"type":"RELATIONAL", "provider":"lakehouse-iceberg", "comment":"comment", 
"properties":{ "uri":"jdbc:mysql://mysql:3306/db", "catalog-backend":"jdbc", 
"warehouse":"hdfs://hive:9000/user/iceberg/warehouse/", "jdbc-user":"mysql", 
"jdbc-password":"mysql", "jdbc-driver":"com.mysql.cj.jdbc.Driver"} }' 
http://gravitino:8090/api/metalakes/metalake_demo/catalogs)
   if echo "$response" | grep -q "\"code\":0"; then
     true # Placeholder, do nothing
+  elif echo "$response" | grep -q 
"\"type\":\"CatalogAlreadyExistsException\""; then
+    echo "Catalog catalog_iceberg already exists"
+    true # Placeholder, do nothing

Review Comment:
   If there's old catalog data in gravitino, will it cause the test cases run 
failed ?



-- 
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