This is an automated email from the ASF dual-hosted git repository.
timbrown pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-xtable.git
The following commit(s) were added to refs/heads/main by this push:
new 3352098a [Demo] Fix UnknownHostException: host.docker.internal in
docker demo
3352098a is described below
commit 3352098a7a673fdbc333e17e073e9fb8bd562e7a
Author: daragu <[email protected]>
AuthorDate: Tue Apr 30 11:23:57 2024 +0800
[Demo] Fix UnknownHostException: host.docker.internal in docker demo
---
demo/docker-compose.yaml | 2 ++
demo/notebook/demo.ipynb | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/demo/docker-compose.yaml b/demo/docker-compose.yaml
index 395e8495..beeabaa9 100644
--- a/demo/docker-compose.yaml
+++ b/demo/docker-compose.yaml
@@ -18,6 +18,7 @@ version: "3.9"
services:
trino:
container_name: trino
+ hostname: trino
ports:
- '8080:8080'
image: 'trinodb/trino:428'
@@ -27,6 +28,7 @@ services:
presto:
container_name: presto
+ hostname: presto
ports:
- '8082:8082'
image: 'prestodb/presto:0.283'
diff --git a/demo/notebook/demo.ipynb b/demo/notebook/demo.ipynb
index d242fc43..e877a7a9 100644
--- a/demo/notebook/demo.ipynb
+++ b/demo/notebook/demo.ipynb
@@ -114,7 +114,7 @@
"val namespace = \"demo\" // requires that this db is already created in
your HMS, in Trino you can run `create schema hive.demo`\n",
"val namespaceArray = Array(namespace)\n",
"val catalogOptions = new HashMap[String, String]();\n",
- "catalogOptions.put(\"uri\", \"thrift://host.docker.internal:9083\");\n",
+ "catalogOptions.put(\"uri\", \"thrift://hive-metastore:9083\");\n",
"val icebergCatalogConfig = IcebergCatalogConfig.builder()\n",
" .catalogImpl(\"org.apache.iceberg.hive.HiveCatalog\")\n",
" .catalogName(\"iceberg\")\n",
@@ -182,7 +182,7 @@
"outputs": [],
"source": [
"import java.sql._\n",
- "val url = \"jdbc:trino://host.docker.internal:8080/iceberg/\" + namespace
+ \"?user=admin\"\n",
+ "val url = \"jdbc:trino://trino:8080/iceberg/\" + namespace +
\"?user=admin\"\n",
"val connection = DriverManager.getConnection(url)\n",
"val statement = connection.createStatement()\n",
"statement.executeUpdate(\"INSERT INTO
hudi_dimCustomer(_c0,CustomerKey,GeographyKey,FirstName,LastName,BirthDate,MaritalStatus,Gender,YearlyIncome,TotalChildren,NumberChildrenAtHome,Education,Occupation,HouseOwnerFlag,NumberCarsOwned)
\" +\n",