yuqi1129 commented on code in PR #4497: URL: https://github.com/apache/gravitino/pull/4497#discussion_r1716437266
########## integration-test/trino-distribution-it/init/trino-coordinator/init.sh: ########## @@ -0,0 +1,63 @@ +#!/bin/bash +# +# 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. + +set -ex +trino_conf_dir="$(dirname "${BASH_SOURCE-$0}")" +trino_conf_dir="$(cd "${trino_conf_dir}">/dev/null; pwd)" + +cp $trino_conf_dir/config/*.* /etc/trino +cp $trino_conf_dir/config/catalog/*.* /etc/trino/catalog + +#start the gravitino server +/usr/local/gravitino-server/bin/gravitino.sh start + +#create test metalake +sleep 3 +curl -X POST -H "Content-Type: application/json" -d '{"name":"test","comment":"comment","properties":{}}' http://localhost:8090/api/metalakes + +# +# Update `gravitino.uri = http://GRAVITINO_HOST_IP:GRAVITINO_HOST_PORT` in the `conf/catalog/gravitino.properties` +sed -i "s/GRAVITINO_HOST_IP:GRAVITINO_HOST_PORT/${GRAVITINO_HOST_IP}:${GRAVITINO_HOST_PORT}/g" /etc/trino/catalog/gravitino.properties +# Update `gravitino.metalake = GRAVITINO_METALAKE_NAME` in the `conf/catalog/gravitino.properties` +sed -i "s/GRAVITINO_METALAKE_NAME/${GRAVITINO_METALAKE_NAME}/g" /etc/trino/catalog/gravitino.properties + + +# Check the number of Gravitino connector plugins present in the Trino plugin directory +num_of_gravitino_connector=$(ls /usr/lib/trino/plugin/gravitino | grep gravitino-trino-connector-* | wc -l) +if [[ "${num_of_gravitino_connector}" -ne 1 ]]; then + echo "Multiple versions of the Gravitino connector plugin found or none present." + exit 1 +fi + +nohup /usr/lib/trino/bin/run-trino & + +counter=0 +while [ $counter -le 300 ]; do + counter=$((counter + 1)) + trino_ready=$(trino --execute "SHOW CATALOGS LIKE 'gravitino'" | wc -l) + if [ "$trino_ready" -eq 0 ]; + then + echo "Wait for the initialization of services" + sleep 1; + else + # persist the container + tail -f /dev/null Review Comment: If the value of `trino_ready` is NOT 0, I assume this means the Trino cluster is okay, so you use `tail -f /dev/null` to block the process? ########## integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00008_alter_catalog.txt: ########## @@ -1,17 +1,17 @@ CALL -"gt_mysql_xxx1","jdbc-mysql","{""jdbc-url"":""jdbc:mysql://%/?useSSL=false"",""jdbc-user"":""trino"",""jdbc-password"":""ds123"",""jdbc-driver"":""com.mysql.cj.jdbc.Driver""}" +"gt_mysql_xxx1","jdbc-mysql","{""jdbc-driver"":""com.mysql.cj.jdbc.Driver"",""jdbc-password"":""ds123"",""jdbc-url"":""jdbc:mysql://%/?useSSL=false"",""jdbc-user"":""trino""}" Review Comment: Did you compare the string value during the test as you need to make it organized? ########## integration-test/trino-distribution-it/init/hive/init.sh: ########## @@ -0,0 +1,24 @@ +#!/bin/bash +# +# 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.IP=$(hostname -I | awk '{print $1}') + +IP=$(hostname -I | awk '{print $1}') +sed -i "s|<value>hdfs://__REPLACE__HOST_NAME:9000|<value>hdfs://${IP}:9000|g" ${HIVE_TMP_CONF_DIR}/hive-site.xml Review Comment: Does this work on MacOS? ########## trino-connector/src/main/java/org/apache/gravitino/trino/connector/system/table/GravitinoSystemTableCatalog.java: ########## @@ -56,21 +60,35 @@ public GravitinoSystemTableCatalog(CatalogConnectorManager catalogConnectorManag @Override public Page loadPageData() { - List<GravitinoCatalog> catalogs = catalogConnectorManager.getCatalogs(); - int size = catalogs.size(); + List<GravitinoCatalog> gravitinoCatalogs = new ArrayList<>(); + catalogConnectorManager + .getUsedMetalakes() + .forEach( + (metalakeName) -> { + GravitinoMetalake metalake = catalogConnectorManager.getMetalake(metalakeName); + String[] catalogNames = metalake.listCatalogs(); Review Comment: metalake.listCatalogsInfo() -- 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]
