<commit_before>#!/usr/bin/env bash
set -e
set -u

cd $IMPALA_HOME

# build with profile gen enabled
cmake -DCMAKE_BUILD_TYPE=PROFILE_GEN .
make clean
cd $IMPALA_HOME/common/function-registry
make
cd $IMPALA_HOME/common/thrift
make
cd $IMPALA_BE_DIR
make -j
cd $IMPALA_HOME

# Run sample queries - outputs .gcda files
be/build/release/service/runquery -query="\
  select count(field) from grep1gb_text_none where field like '%xyz%';\
  select count(field) from grep1gb_rc_file_none where field like '%xyz%';\
  select count(field) from grep1gb_sequence_file_snappy where field like '%xyz%';\
  select sourceIP, SUM(adRevenue) FROM uservisits_web_sequence_file_none \
    GROUP by sourceIP order by SUM(adRevenue) desc limit 10;\
  select sourceIP, SUM(adRevenue) FROM uservisits_web_text_none \
    GROUP by sourceIP order by SUM(adRevenue) desc limit 10;\
  select sourceIP, SUM(adRevenue) FROM uservisits_web_rc_file_none GROUP by sourceIP \
    order by SUM(adRevenue) desc limit 10;select sourceIP, SUM(adRevenue) \
    FROM uservisits_web_text_none \
    GROUP by sourceIP order by SUM(adRevenue) desc limit 10;\
  select uv.sourceip, avg(r.pagerank), sum(uv.adrevenue) as totalrevenue \
    from uservisits_web_text_none uv join rankings_web_text_none r on \
    (r.pageurl = uv.desturl) \
    where uv.visitdate > '1999-01-01' and uv.visitdate < '2000-01-01' \
    group by uv.sourceip order by totalrevenue desc limit 1"\
  -profile_output_file=""

# Build again using the PGO data
cmake -DCMAKE_BUILD_TYPE=PROFILE_BUILD .
make clean
cd $IMPALA_HOME/common/function-registry
make
cd $IMPALA_HOME/common/thrift
make
cd $IMPALA_BE_DIR
make -j
cd $IMPALA_HOME

# Remove all the PGO intermediates and set build to release.  This seems to be the most
# convenient workflow.  Otherwise, changing one src file after a PGO build causes many warnings
# about stale PGO data.
find . -type f -name "*.gcda" -exec rm -rf {} \;
cmake -DCMAKE_BUILD_TYPE=RELEASE<commit_msg>Updated make_release script to add flag for controlling whether or not to do PGO build<commit_after>#!/usr/bin/env bash
set -e
set -u

USE_PGO=1

# parse command line options
for ARG in $*
do
  case "$ARG" in
    -nopgo)
      USE_PGO=0
      ;;
    -help|*)
      echo "make_release.sh [-nopgo]"
      echo "[-nopgo] : do not use performance guided optimizations for building"
      exit 1
      ;;
  esac
done


cd $IMPALA_HOME

if [ $USE_PGO -eq 1 ]
then

  # build with profile gen enabled
  cmake -DCMAKE_BUILD_TYPE=PROFILE_GEN .
  make clean
  cd $IMPALA_HOME/common/function-registry
  make
  cd $IMPALA_HOME/common/thrift
  make
  cd $IMPALA_BE_DIR
  make -j
  cd $IMPALA_HOME

  # Run sample queries - outputs .gcda files
  be/build/release/service/runquery -query="\
    select count(field) from grep1gb_text_none where field like '%xyz%';\
    select count(field) from grep1gb_rc_file_none where field like '%xyz%';\
    select count(field) from grep1gb_sequence_file_snappy where field like '%xyz%';\
    select sourceIP, SUM(adRevenue) FROM uservisits_web_sequence_file_none \
      GROUP by sourceIP order by SUM(adRevenue) desc limit 10;\
    select sourceIP, SUM(adRevenue) FROM uservisits_web_text_none \
      GROUP by sourceIP order by SUM(adRevenue) desc limit 10;\
    select sourceIP, SUM(adRevenue) FROM uservisits_web_rc_file_none GROUP by sourceIP \
      order by SUM(adRevenue) desc limit 10;select sourceIP, SUM(adRevenue) \
      FROM uservisits_web_text_none \
      GROUP by sourceIP order by SUM(adRevenue) desc limit 10;\
    select uv.sourceip, avg(r.pagerank), sum(uv.adrevenue) as totalrevenue \
      from uservisits_web_text_none uv join rankings_web_text_none r on \
      (r.pageurl = uv.desturl) \
      where uv.visitdate > '1999-01-01' and uv.visitdate < '2000-01-01' \
      group by uv.sourceip order by totalrevenue desc limit 1"\
    -profile_output_file=""

  # Build again using the PGO data
  cmake -DCMAKE_BUILD_TYPE=PROFILE_BUILD .
  make clean
  cd $IMPALA_HOME/common/function-registry
  make
  cd $IMPALA_HOME/common/thrift
  make
  cd $IMPALA_BE_DIR
  make -j
  cd $IMPALA_HOME

  # Remove all the PGO intermediates and set build to release.  This seems to be the most
  # convenient workflow.  Otherwise, changing one src file after a PGO build causes many warnings
  # about stale PGO data.
  find . -type f -name "*.gcda" -exec rm -rf {} \;
  cmake -DCMAKE_BUILD_TYPE=RELEASE
else
  cmake -DCMAKE_BUILD_TYPE=RELEASE
  make clean

  cd $IMPALA_HOME/common/function-registry
  make
  cd $IMPALA_HOME/common/thrift
  make
  cd $IMPALA_BE_DIR
  make -j
fi
{'fraction_non_alphanumeric': 0.0819493006993007, 'fraction_numerical': 0.013111888111888112, 'mean_word_length': 3.7040082219938335, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '6157556', 'n_tokens_mistral': 1720, 'n_tokens_neox': 1574, 'n_words': 492}