<commit_before>#!/usr/bin/env bash

if [ ! -f "$DATADIR/init_hive_db_executed" ]; then
    set -e
    echo "Create Hive database"
    echo "CREATE DATABASE $DATABASE;" | psql -U postgres
    echo "CREATE USER $USER WITH PASSWORD '$PASSWORD';" | psql -U postgres
    echo "GRANT ALL PRIVILEGES ON DATABASE $USER TO $DATABASE;" | psql -U postgres

    echo "Add access to pg_hba.conf"
    DATADIR=$(psql -c "show data_directory;" | grep "/data")
    echo "Datadir: $DATADIR"
    echo "host $DATABASE $USER 0.0.0.0/0 md5" >> $DATADIR/pg_hba.conf
    echo "local $DATABASE $USER md5" >> $DATADIR/pg_hba.conf
    echo $(date +%Y-%m-%d:%H:%M:%S) >> $DATADIR/init_hive_db_executed
    set +e
fi
<commit_msg>BUG-97317 - Enable cluster no internet mode<commit_after>#!/usr/bin/env bash

if [ ! -f "/var/init_hive_db_executed" ]; then
    set -e
    echo "Create Hive database"
    echo "CREATE DATABASE $DATABASE;" | psql -U postgres
    echo "CREATE USER $USER WITH PASSWORD '$PASSWORD';" | psql -U postgres
    echo "GRANT ALL PRIVILEGES ON DATABASE $USER TO $DATABASE;" | psql -U postgres

    echo "Add access to pg_hba.conf"
    DATADIR=$(psql -c "show data_directory;" | grep "/data")
    echo "Datadir: $DATADIR"
    echo "host $DATABASE $USER 0.0.0.0/0 md5" >> $DATADIR/pg_hba.conf
    echo "local $DATABASE $USER md5" >> $DATADIR/pg_hba.conf
    echo $(date +%Y-%m-%d:%H:%M:%S) >> /var/init_hive_db_executed
    set +e
fi

{'fraction_non_alphanumeric': 0.14627285513361463, 'fraction_numerical': 0.013361462728551337, 'mean_word_length': 3.3516819571865444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5531088', 'n_tokens_mistral': 583, 'n_tokens_neox': 568, 'n_words': 155}