Skip to content

Commit

Permalink
Add verbose mode for schema creation
Browse files Browse the repository at this point in the history
Needed for debugging connection problems, which sometimes have useless
errors
  • Loading branch information
MrCreosote committed Jun 20, 2024
1 parent 389eb29 commit a5bf098
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ RUN apt-get update; \
RUN rm /opt/hadoop/share/hadoop/common/lib/log4j-1.2.17.jar && \
rm /opt/hadoop/share/hadoop/hdfs/lib/log4j-1.2.17.jar

# Allow providing arguments to schematool by appending an env var to the line
# This is fragile and may need updating as the hive version changes
RUN sed -i -r 's#^(.*schematool.*)$#\1 \$SCHEMATOOL_ARGS#' /entrypoint.sh

ENV POSTGRES_JAR=postgresql-42.6.2.jar

# License is BSD-2: https://jdbc.postgresql.org/license/
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ services:
# Set to true after DB has been created on first run
# This is really annoying...
- IS_RESUME=false
- VERBOSE=false
- POSTGRES_HOST=postgres:5432
- POSTGRES_DB=hive
- POSTGRES_USER=hive
Expand Down
5 changes: 5 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ export SERVICE_OPTS="
-Djavax.jdo.option.ConnectionUserName=$POSTGRES_USER
-Djavax.jdo.option.ConnectionPassword=$POSTGRES_PASSWORD"

if [ "$VERBOSE" = "true" ]; then
echo "Setting verbose mode"
export SCHEMATOOL_ARGS="--verbose"
fi

# https://github.com/apache/hive/blob/7f87a3b0ef5bd468df34fb4dd5bb4c4db2ac2245/packaging/src/docker/Dockerfile
/entrypoint.sh

0 comments on commit a5bf098

Please sign in to comment.