hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nirmal Kumar <nirmal.ku...@impetus.co.in>
Subject Best way to add custom UDF jar in HiveServer2
Date Thu, 28 Aug 2014 03:19:41 GMT
Hi All,

What is the best way to add custom UDF jar in HiveServer2.

Currently I am adding it through Java JDBC code :

Statement stmt = null;
ResultSet res = null;
Connection con = getHiveConnection(host, port, db);
try {
                stmt = con.createStatement();

String[] args = new String[2];
args[0] = "add jar /home/nirmal/udf/hiveUDF-1.0-SNAPSHOT.jar";
args[1] = "CREATE TEMPORARY FUNCTION zeroifnull AS 'com.test.udf.ZeroIfNullUDF'";

for (String queryUDF : args) {
stmt.execute(queryUDF);
                }
}

Is there any other better way ?

Thanks,
-Nirmal


________________________________






NOTE: This message may contain information that is confidential, proprietary, privileged or
otherwise protected by law. The message is intended solely for the named addressee. If received
in error, please destroy and notify the sender. Any use of this email is prohibited when received
in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this
communication has been maintained nor that the communication is free of errors, virus, interception
or interference.

Mime
View raw message