diqiu50 commented on code in PR #4715:
URL: https://github.com/apache/gravitino/pull/4715#discussion_r1733886536


##########
trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergConnectorAdapter.java:
##########
@@ -46,6 +46,7 @@ public IcebergConnectorAdapter() {
   @Override
   public Map<String, String> buildInternalConnectorConfig(GravitinoCatalog 
catalog)
       throws Exception {
+    catalog.getProperties().put("catalog-name", catalog.getName());

Review Comment:
   I test it with the playground with my change, I'm build the `gravitino` 
project with this change  in the directory 
`/Users/ice/Documents/workspace/git/gravitino` :
   ```
   diff --git a/docker-compose.yaml b/docker-compose.yaml
   index 6c6a27e..87a9794 100644
   --- a/docker-compose.yaml
   +++ b/docker-compose.yaml
   @@ -82,6 +82,8 @@ services:
        entrypoint:  /bin/bash /tmp/trino/init.sh
        volumes:
          - ./init/trino:/tmp/trino
   +      - 
/Users/ice/Documents/workspace/git/gravitino/trino-connector/build/libs:/tmp/trino-connector
   +      - 
/Users/ice/Documents/workspace/git/gravitino/integration-test/trino-it/init/trino/config/jvm.config:/etc/trino/jvm.config
        depends_on:
          hive :
            condition: service_healthy
   @@ -173,4 +175,4 @@ services:
          resources:
            limits:
              cpus: "0.5"
   -          memory: 500M
   \ No newline at end of file
   +          memory: 500M
   diff --git a/init/trino/init.sh b/init/trino/init.sh
   index 70d6199..7284962 100644
   --- a/init/trino/init.sh
   +++ b/init/trino/init.sh
   @@ -18,6 +18,12 @@
    #
   
    # Since trino-connector needs to connect Gravitino service, get the default 
metalake
   +
   +set -x
   +
   +rm -fr /usr/lib/trino/plugin/gravitino
   +cp -r /tmp/trino-connector /usr/lib/trino/plugin/gravitino
   +
   ```
   Then run the command start the playground
   ···
   cd gravitino-playground
   ./launch-playground.sh
   ···
   Waiting for the playground startup, run the following command:
   ```shell
   docker exec -it playground-spark bash
   ```
   
   ```shell
   spark@container_id:/$ cd /opt/spark && /bin/bash bin/spark-sql 
   ```
   
   ```SQL
   use catalog_iceberg;
   create database sales;
   use sales;
   create table customers (customer_id int, customer_name varchar(100), 
customer_email varchar(100));
   describe extended customers;    
   insert into customers (customer_id, customer_name, customer_email) values 
(11,'Rory Brown','r...@123.com');
   insert into customers (customer_id, customer_name, customer_email) values 
(12,'Jerry Washington','je...@dt.com');
   ```
   
   2. Login Trino container and execute the steps.
   You can get all the customers from both the Hive and Iceberg table.
   
   ```shell
   docker exec -it playground-trino bash
   ```
   
   ```shell
   trino@container_id:/$ trino  
   ```
   
   ```SQL
   select * from catalog_hive.sales.customers
   union
   select * from catalog_iceberg.sales.customers;
   ```
   
   The finally results :
   ```
    customer_id |  customer_name   |          customer_email
   -------------+------------------+----------------------------------
              4 | Mia Hahn         | miah...@yahoo.edu
              5 | Quin Hurst       | quinhurst5...@google.net
              1 | Nasim Duke       | nasimd...@hotmail.net
              7 | Erasmus Phelps   | erasmusphelps9...@protonmail.net
              2 | Perry Tyler      | perryty...@outlook.com
              8 | Lenore Wilder    | lenorewil...@aol.net
              6 | Harriet Best     | harrietbest2...@icloud.com
              9 | Raya Mcguire     | rayamcgu...@hotmail.com
             12 | Jerry Washington | je...@dt.com
             11 | Rory Brown       | r...@123.com
             10 | Ronan Joyner     | ronanjoyner5...@aol.com
              3 | Leah Swanson     | leahswanson1...@protonmail.com
   (12 rows)
   ```
   



-- 
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: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to