Files
impala/testdata/bin/check-schema-diff.sh
ishaan dee6911b20 Enable loading metadata from the hive metastore snapshot and cleanup build scripts.
This patch contains the following changes:
  - Add a metastore_snapshot_file parameter to build.sh
  - Enable skipping loading the metadata.
  - create-load-data.sh is refactored into functions.
  - A lot of scripts source impala-config, which creates a lot of log spew. This has now
    been muted.
  - Unecessary log spew from compute-table-stats has been muted.
  - build_thirdparty.sh determins its parallelism from the system, it was previously hard
    coded to 4
  - Only force load data of the particular dataset if a schema change is detected.

Change-Id: I909336451e5c1ca57d21f040eb94c0e831546837
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5540
Reviewed-by: Ishaan Joshi <ishaan@cloudera.com>
Tested-by: jenkins
2014-12-19 13:41:00 -08:00

30 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2012 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Check if a reference githash exists in hdfs; If it does, diff the directories that
# contain the schemas against the current HEAD.
# This script exits with 0 and 1 as the returncodes
# - 0 implies that the schema diff is emppty, or that a reference githash was not found.
# - 1 implies that the schemas have changed.
. ${IMPALA_HOME}/bin/impala-config.sh > /dev/null 2>&1
set -ex
DATASET=${1-}
hdfs dfs -test -e /test-warehouse/githash.txt || { exit 0; }
GIT_HASH=$(echo $(hdfs dfs -cat /test-warehouse/githash.txt))
# Check whether a non-empty diff exists.
git diff --exit-code ${GIT_HASH}..HEAD ${IMPALA_HOME}/testdata/datasets/$DATASET