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:
```
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','[email protected]');
insert into customers (customer_id, customer_name, customer_email) values
(12,'Jerry Washington','[email protected]');
```
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 | [email protected]
5 | Quin Hurst | [email protected]
1 | Nasim Duke | [email protected]
7 | Erasmus Phelps | [email protected]
2 | Perry Tyler | [email protected]
8 | Lenore Wilder | [email protected]
6 | Harriet Best | [email protected]
9 | Raya Mcguire | [email protected]
12 | Jerry Washington | [email protected]
11 | Rory Brown | [email protected]
10 | Ronan Joyner | [email protected]
3 | Leah Swanson | [email protected]
(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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]