You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by sp...@apache.org on 2015/05/20 18:01:26 UTC

[07/50] [abbrv] hive git commit: HIVE-10669: The HMS upgrade test is not testing postgres nor derby upgrades (Sergio Pena, reviewed by Szehon Ho)

HIVE-10669: The HMS upgrade test is not testing postgres nor derby upgrades (Sergio Pena, reviewed by Szehon Ho)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/fbdd7dad
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/fbdd7dad
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/fbdd7dad

Branch: refs/heads/parquet
Commit: fbdd7dad17d7a46d8c77b9fb24bbca0cc709767d
Parents: c13ce55
Author: Sergio Pena <se...@cloudera.com>
Authored: Wed May 13 10:37:50 2015 -0500
Committer: Sergio Pena <se...@cloudera.com>
Committed: Wed May 13 10:37:50 2015 -0500

----------------------------------------------------------------------
 metastore/dbs/derby/execute.sh              | 37 ------------
 metastore/dbs/derby/prepare.sh              | 63 ---------------------
 metastore/dbs/postgres/execute.sh           | 29 ----------
 metastore/dbs/postgres/prepare.sh           | 72 ------------------------
 testutils/metastore/dbs/derby/execute.sh    | 37 ++++++++++++
 testutils/metastore/dbs/derby/prepare.sh    | 63 +++++++++++++++++++++
 testutils/metastore/dbs/postgres/execute.sh | 29 ++++++++++
 testutils/metastore/dbs/postgres/prepare.sh | 72 ++++++++++++++++++++++++
 8 files changed, 201 insertions(+), 201 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/fbdd7dad/metastore/dbs/derby/execute.sh
----------------------------------------------------------------------
diff --git a/metastore/dbs/derby/execute.sh b/metastore/dbs/derby/execute.sh
deleted file mode 100644
index d60f05b..0000000
--- a/metastore/dbs/derby/execute.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-
-# This script executes all hive metastore upgrade scripts on an specific
-# database server in order to verify that upgrade scripts are working
-# properly.
-
-cd $(dirname $1)
-
-echo "####################################################"
-echo "Executing script for Derby SQL: $1"
-echo "####################################################"
-
-export DERBY_HOME=/usr/share/javadb
-export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
-export PATH=$PATH:$DERBY_HOME/bin:$JAVA_HOME/bin
-export CLASSPATH=$CLASSPATH:$DERBY_HOME/lib/derby.jar:$DERBY_HOME/lib/derbytools.jar:$DERBY_HOME/lib/derbyclient.jar
-
-echo "connect 'jdbc:derby:/tmp/hive_hms_testing;create=true';" > /tmp/derbyRun.sql
-echo "run '$1';" >> /tmp/derbyRun.sql
-echo "quit;" >> /tmp/derbyRun.sql
-
-ij /tmp/derbyRun.sql

http://git-wip-us.apache.org/repos/asf/hive/blob/fbdd7dad/metastore/dbs/derby/prepare.sh
----------------------------------------------------------------------
diff --git a/metastore/dbs/derby/prepare.sh b/metastore/dbs/derby/prepare.sh
deleted file mode 100644
index fe4b2c3..0000000
--- a/metastore/dbs/derby/prepare.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-
-# This script executes all hive metastore upgrade scripts on an specific
-# database server in order to verify that upgrade scripts are working
-# properly.
-
-export DEBIAN_FRONTEND=noninteractive
-OS_VERSION=`lsb_release -c | cut -d":" -f2`
-
-echo "####################################################"
-echo "Begin for OS version $OS_VERSION"
-echo "####################################################"
-
-HTTPS_INFO=($(dpkg -l apt-transport-https | grep ^i | tr -s ' '))
-if [[ ${HTTPS_INFO[1]} == "apt-transport-https" ]]
-then
-  echo "apt-transport-https package installed"
-else
-  echo "apt-transport-https package not installed"
-  apt-get install -y --force-yes apt-transport-https
-fi
-
-INSTALL_INFO=($(dpkg -l \*javadb-core\* | grep ^ii | tr -s ' '))
-
-if [[ ${INSTALL_INFO[1]} == "sun-javadb-core" ]]
-then
-  echo "Derby already installed...Skipping"
-else
-  echo "Derby not installed"
-  # Cleanup existing installation + configuration.
-  apt-get purge -y --force-yes derby-tools sun-javadb-client sun-javadb-core sun-javadb-common libderby-java openjdk-7-jre openjdk-7-jre openjdk-7-jre-headless || /bin/true
-  echo "####################################################"
-  echo "Installing Derby dependencies:"
-  echo "####################################################"
-  apt-get update || /bin/true
-  apt-get install -y --force-yes -o Dpkg::Options::="--force-overwrite" sun-javadb-core sun-javadb-client derby-tools
-fi
-
-export DERBY_HOME=/usr/share/javadb
-export JAVA_HOME=//usr/lib/jvm/java-7-openjdk-amd64
-export PATH=$PATH:/usr/share/javadb/bin:$JAVA_HOME/bin
-export CLASSPATH=$CLASSPATH:$DERBY_HOME/lib/derby.jar:$DERBY_HOME/lib/derbytools.jar:$DERBY_HOME/lib/derbyclient.jar
-rm -rf /tmp/hive_hms_testing;
-
-echo "connect 'jdbc:derby:/tmp/hive_hms_testing;create=true';" > /tmp/derbyInit.sql
-ij /tmp/derbyInit.sql 
-
-echo "DONE!!!"
-

http://git-wip-us.apache.org/repos/asf/hive/blob/fbdd7dad/metastore/dbs/postgres/execute.sh
----------------------------------------------------------------------
diff --git a/metastore/dbs/postgres/execute.sh b/metastore/dbs/postgres/execute.sh
deleted file mode 100644
index cabcae4..0000000
--- a/metastore/dbs/postgres/execute.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-
-# This script executes all hive metastore upgrade scripts on an specific
-# database server in order to verify that upgrade scripts are working
-# properly.
-
-cd $(dirname $1)
-
-echo "####################################################"
-echo "Executing script for PostgreSQL: $1"
-echo "####################################################"
-
-export PGPASSWORD=hivepw
-psql -h localhost -U hiveuser -d hive_hms_testing -f $1

http://git-wip-us.apache.org/repos/asf/hive/blob/fbdd7dad/metastore/dbs/postgres/prepare.sh
----------------------------------------------------------------------
diff --git a/metastore/dbs/postgres/prepare.sh b/metastore/dbs/postgres/prepare.sh
deleted file mode 100644
index 2036354..0000000
--- a/metastore/dbs/postgres/prepare.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-
-# This script executes all hive metastore upgrade scripts on an specific
-# database server in order to verify that upgrade scripts are working
-# properly.
-
-export DEBIAN_FRONTEND=noninteractive
-OS_VERSION=`lsb_release -c | cut -d":" -f2`
-echo "$OS_VERSION"
-
-echo "####################################################"
-echo "Begin for OS version $OS_VERSION"
-echo "####################################################"
-
-HTTPS_INFO=($(dpkg -l apt-transport-https | grep ^i | tr -s ' '))
-if [[ ${HTTPS_INFO[1]} == "apt-transport-https" ]]
-then
-  echo "apt-transport-https package installed"
-else
-  echo "apt-transport-https package not installed"
-  apt-get install -y --force-yes apt-transport-https
-fi
-
-INSTALL_INFO=($(dpkg -l postgresql-9.4\* | grep ^i | tr -s ' '))
-
-if [[ ${INSTALL_INFO[1]} == "postgresql-9.4" ]]
-then
-  echo "PostgreSQL already installed...Skipping"
-else
-  echo "PostgreSQL not installed"
-  # Cleanup existing installation + configuration.
-  apt-get purge -y --force-yes postgressql-9.4 || /bin/true
-  echo "####################################################"
-  echo "Installing PostgreSQL dependencies:"
-  echo "####################################################"
-  if grep -q "deb http://apt.postgresql.org/pub/repos/apt/ $OS_VERSION-pgdg main" /etc/apt/sources.list.d/postgreSQL.list
-  then
-    echo "Sources already listed"
-  else
-    echo "deb http://apt.postgresql.org/pub/repos/apt/ $OS_VERSION-pgdg main" >> /etc/apt/sources.list.d/postgreSQL.list
-  fi
-
-  wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
-  apt-get update  || /bin/true
-  apt-get install -y --force-yes postgresql-9.4
-fi
-
-echo "####################################################"
-echo "Configuring PostgreSQL Environment:"
-echo "####################################################"
-echo "drop database if exists hive_hms_testing;" > /tmp/postgresInit.sql
-echo "drop user if exists hiveuser;" >> /tmp/postgresInit.sql
-echo "create user hiveuser createdb createuser password 'hivepw';" >> /tmp/postgresInit.sql
-echo "create database hive_hms_testing owner hiveuser;" >> /tmp/postgresInit.sql
-sudo -u postgres psql -f /tmp/postgresInit.sql
-
-echo "DONE!!!"
-

http://git-wip-us.apache.org/repos/asf/hive/blob/fbdd7dad/testutils/metastore/dbs/derby/execute.sh
----------------------------------------------------------------------
diff --git a/testutils/metastore/dbs/derby/execute.sh b/testutils/metastore/dbs/derby/execute.sh
new file mode 100644
index 0000000..d60f05b
--- /dev/null
+++ b/testutils/metastore/dbs/derby/execute.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+# This script executes all hive metastore upgrade scripts on an specific
+# database server in order to verify that upgrade scripts are working
+# properly.
+
+cd $(dirname $1)
+
+echo "####################################################"
+echo "Executing script for Derby SQL: $1"
+echo "####################################################"
+
+export DERBY_HOME=/usr/share/javadb
+export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
+export PATH=$PATH:$DERBY_HOME/bin:$JAVA_HOME/bin
+export CLASSPATH=$CLASSPATH:$DERBY_HOME/lib/derby.jar:$DERBY_HOME/lib/derbytools.jar:$DERBY_HOME/lib/derbyclient.jar
+
+echo "connect 'jdbc:derby:/tmp/hive_hms_testing;create=true';" > /tmp/derbyRun.sql
+echo "run '$1';" >> /tmp/derbyRun.sql
+echo "quit;" >> /tmp/derbyRun.sql
+
+ij /tmp/derbyRun.sql

http://git-wip-us.apache.org/repos/asf/hive/blob/fbdd7dad/testutils/metastore/dbs/derby/prepare.sh
----------------------------------------------------------------------
diff --git a/testutils/metastore/dbs/derby/prepare.sh b/testutils/metastore/dbs/derby/prepare.sh
new file mode 100644
index 0000000..fe4b2c3
--- /dev/null
+++ b/testutils/metastore/dbs/derby/prepare.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+# This script executes all hive metastore upgrade scripts on an specific
+# database server in order to verify that upgrade scripts are working
+# properly.
+
+export DEBIAN_FRONTEND=noninteractive
+OS_VERSION=`lsb_release -c | cut -d":" -f2`
+
+echo "####################################################"
+echo "Begin for OS version $OS_VERSION"
+echo "####################################################"
+
+HTTPS_INFO=($(dpkg -l apt-transport-https | grep ^i | tr -s ' '))
+if [[ ${HTTPS_INFO[1]} == "apt-transport-https" ]]
+then
+  echo "apt-transport-https package installed"
+else
+  echo "apt-transport-https package not installed"
+  apt-get install -y --force-yes apt-transport-https
+fi
+
+INSTALL_INFO=($(dpkg -l \*javadb-core\* | grep ^ii | tr -s ' '))
+
+if [[ ${INSTALL_INFO[1]} == "sun-javadb-core" ]]
+then
+  echo "Derby already installed...Skipping"
+else
+  echo "Derby not installed"
+  # Cleanup existing installation + configuration.
+  apt-get purge -y --force-yes derby-tools sun-javadb-client sun-javadb-core sun-javadb-common libderby-java openjdk-7-jre openjdk-7-jre openjdk-7-jre-headless || /bin/true
+  echo "####################################################"
+  echo "Installing Derby dependencies:"
+  echo "####################################################"
+  apt-get update || /bin/true
+  apt-get install -y --force-yes -o Dpkg::Options::="--force-overwrite" sun-javadb-core sun-javadb-client derby-tools
+fi
+
+export DERBY_HOME=/usr/share/javadb
+export JAVA_HOME=//usr/lib/jvm/java-7-openjdk-amd64
+export PATH=$PATH:/usr/share/javadb/bin:$JAVA_HOME/bin
+export CLASSPATH=$CLASSPATH:$DERBY_HOME/lib/derby.jar:$DERBY_HOME/lib/derbytools.jar:$DERBY_HOME/lib/derbyclient.jar
+rm -rf /tmp/hive_hms_testing;
+
+echo "connect 'jdbc:derby:/tmp/hive_hms_testing;create=true';" > /tmp/derbyInit.sql
+ij /tmp/derbyInit.sql 
+
+echo "DONE!!!"
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fbdd7dad/testutils/metastore/dbs/postgres/execute.sh
----------------------------------------------------------------------
diff --git a/testutils/metastore/dbs/postgres/execute.sh b/testutils/metastore/dbs/postgres/execute.sh
new file mode 100644
index 0000000..cabcae4
--- /dev/null
+++ b/testutils/metastore/dbs/postgres/execute.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+# This script executes all hive metastore upgrade scripts on an specific
+# database server in order to verify that upgrade scripts are working
+# properly.
+
+cd $(dirname $1)
+
+echo "####################################################"
+echo "Executing script for PostgreSQL: $1"
+echo "####################################################"
+
+export PGPASSWORD=hivepw
+psql -h localhost -U hiveuser -d hive_hms_testing -f $1

http://git-wip-us.apache.org/repos/asf/hive/blob/fbdd7dad/testutils/metastore/dbs/postgres/prepare.sh
----------------------------------------------------------------------
diff --git a/testutils/metastore/dbs/postgres/prepare.sh b/testutils/metastore/dbs/postgres/prepare.sh
new file mode 100644
index 0000000..2036354
--- /dev/null
+++ b/testutils/metastore/dbs/postgres/prepare.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+# This script executes all hive metastore upgrade scripts on an specific
+# database server in order to verify that upgrade scripts are working
+# properly.
+
+export DEBIAN_FRONTEND=noninteractive
+OS_VERSION=`lsb_release -c | cut -d":" -f2`
+echo "$OS_VERSION"
+
+echo "####################################################"
+echo "Begin for OS version $OS_VERSION"
+echo "####################################################"
+
+HTTPS_INFO=($(dpkg -l apt-transport-https | grep ^i | tr -s ' '))
+if [[ ${HTTPS_INFO[1]} == "apt-transport-https" ]]
+then
+  echo "apt-transport-https package installed"
+else
+  echo "apt-transport-https package not installed"
+  apt-get install -y --force-yes apt-transport-https
+fi
+
+INSTALL_INFO=($(dpkg -l postgresql-9.4\* | grep ^i | tr -s ' '))
+
+if [[ ${INSTALL_INFO[1]} == "postgresql-9.4" ]]
+then
+  echo "PostgreSQL already installed...Skipping"
+else
+  echo "PostgreSQL not installed"
+  # Cleanup existing installation + configuration.
+  apt-get purge -y --force-yes postgressql-9.4 || /bin/true
+  echo "####################################################"
+  echo "Installing PostgreSQL dependencies:"
+  echo "####################################################"
+  if grep -q "deb http://apt.postgresql.org/pub/repos/apt/ $OS_VERSION-pgdg main" /etc/apt/sources.list.d/postgreSQL.list
+  then
+    echo "Sources already listed"
+  else
+    echo "deb http://apt.postgresql.org/pub/repos/apt/ $OS_VERSION-pgdg main" >> /etc/apt/sources.list.d/postgreSQL.list
+  fi
+
+  wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
+  apt-get update  || /bin/true
+  apt-get install -y --force-yes postgresql-9.4
+fi
+
+echo "####################################################"
+echo "Configuring PostgreSQL Environment:"
+echo "####################################################"
+echo "drop database if exists hive_hms_testing;" > /tmp/postgresInit.sql
+echo "drop user if exists hiveuser;" >> /tmp/postgresInit.sql
+echo "create user hiveuser createdb createuser password 'hivepw';" >> /tmp/postgresInit.sql
+echo "create database hive_hms_testing owner hiveuser;" >> /tmp/postgresInit.sql
+sudo -u postgres psql -f /tmp/postgresInit.sql
+
+echo "DONE!!!"
+