linghengqian commented on code in PR #5629: URL: https://github.com/apache/hive/pull/5629#discussion_r1946438921
########## packaging/src/docker/README.md: ########## @@ -210,3 +210,14 @@ docker compose down select count(distinct a) from hive_example; select sum(b) from hive_example; ``` + +#### Hive Schema Tool + +`Hive Schema Tool` is located in the Docker Image at `/opt/hive/bin/schematool`. +Possible use cases are as follows, + +```shell +docker run -d --env SERVICE_NAME=hiveserver2 --name hive4 apache/hive:${HIVE_VERSION} +docker exec -it hive4 /bin/bash +/opt/hive/bin/schematool -info -dbType hive -metaDbType derby -url jdbc:hive2://localhost:10000/default Review Comment: - @dengzhhu653 But even if I create a `compose.yaml` file like this, ```yaml services: some-postgres: image: postgres:17.2-bookworm environment: POSTGRES_PASSWORD: "example" metastore-standalone: image: apache/hive:4.0.1 depends_on: - some-postgres environment: SERVICE_NAME: metastore DB_DRIVER: postgres SERVICE_OPTS: >- -Djavax.jdo.option.ConnectionDriverName=org.postgresql.Driver -Djavax.jdo.option.ConnectionURL=jdbc:postgresql://some-postgres:5432/postgres -Djavax.jdo.option.ConnectionUserName=postgres -Djavax.jdo.option.ConnectionPassword=example volumes: - ~/.m2/repository/org/postgresql/postgresql/42.7.5/postgresql-42.7.5.jar:/opt/hive/lib/postgres.jar hiveserver2-standalone: image: apache/hive:4.0.1 depends_on: - metastore-standalone environment: SERVICE_NAME: hiveserver2 SERVICE_OPTS: >- -Dhive.metastore.uris=thrift://metastore-standalone:9083 ports: - "10000:10000" ``` - Then I executed the shell command, ```shell mvn dependency:get -Dartifact=org.postgresql:postgresql:42.7.5 docker compose up -d docker compose exec hiveserver2-standalone /bin/bash /opt/hive/bin/schematool -initSchema -dbType hive -metaDbType derby -url jdbc:hive2://localhost:10000/default exit ``` - At this point all I can see from Dbeaver CE is empty data. -  - In contrast, the `information_schema.columns` obtained by the following shell command is not empty, ```shell docker run -d --env SERVICE_NAME=hiveserver2 --name hive4 apache/hive:4.0.1 docker exec -it hive4 /bin/bash /opt/hive/bin/schematool -initSchema -dbType hive -metaDbType derby -url jdbc:hive2://localhost:10000/default /opt/hive/bin/schematool -info -dbType hive -metaDbType derby -url jdbc:hive2://localhost:10000/default exit ``` - Is there any external issue I missed? -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org