Files
impala/bin/run-jdbc-client.sh
Zoltan Borok-Nagy 06fbb0d629 IMPALA-10571: ImpalaJdbcClient might silently choose a different driver than the one specified
ImpalaJdbcClient might silently choose the HiveDriver when the
connection string is not specified. It's because the default
connection string is 'jdbc:hive2://...'.

This patch adds a check to ImpalaJdbcClient to make sure the driver
being used is the one specified by the user. If not, it raises an
error.

I also modified bin/run-jdbc-client.sh to make it easier to use
different drivers. Users are now able to specify the classpath
of their custom driver via the environment variable
IMPALA_JDBC_DRIVER_CLASSPATH.

Testing:
 * tested manually

Change-Id: If7fdf49b7f04f4d9ae6286df5c8df6b205cbce8f
Reviewed-on: http://gerrit.cloudera.org:8080/17164
Reviewed-by: Thomas Tauber-Marshall <tmarshall@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
2021-03-09 23:03:05 +00:00

23 lines
970 B
Bash
Executable File

#!/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.
. ${IMPALA_HOME}/bin/set-classpath.sh test
CLASSPATH=${IMPALA_JDBC_DRIVER_CLASSPATH}:${CLASSPATH}
"$JAVA" -cp $CLASSPATH org.apache.impala.testutil.ImpalaJdbcClient "$@"