- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Permanently added UDF doesn't work with ODBC connection
- Labels:
-
Apache Hive
Created 02-26-2016 06:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using the Hortonworks Hive ODBC driver in my application.
I did: CREATE FUNCTION MyFunc as 'com.my.udf.class' USING JAR 'hdfs:///user/location/to/my.jar';
That worked. Ehen I close my HiveCLI session and open it back up, I can immediately run SELECT myfunc(data) FROM tbl; and it loads the class and functions correctly. However it doesn't work inside of HUE or in my ODBC connection within my app.
Created 02-26-2016 06:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Both Hue /ODBC make use of HiveServer2. You might want to check the HiveServer2 logs to see if there are any errors when running these queries. Is the HDFS location of your JAR accessible to the "hive" user (or whatever user is running HiveServer2)?
Created 02-26-2016 06:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you give details of how it doesn't work? Does it not find the function, or find the function and fail to execute it properly?
Created 02-26-2016 10:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, yeah using HUE or through my ODBC application it says it can't find the function. I'm logging into the application in HUE with the same username I am with through the HiveCLI.
To be specific:
Error occurred executing hive query: Error while compiling statement: FAILED: SemanticException [Error 10011]: Line 1:155 Invalid function
Created 02-26-2016 06:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Both Hue /ODBC make use of HiveServer2. You might want to check the HiveServer2 logs to see if there are any errors when running these queries. Is the HDFS location of your JAR accessible to the "hive" user (or whatever user is running HiveServer2)?
Created 02-26-2016 10:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Logging in with the same username with Hue as I am with HiveCLI. Getting this error
Error occurred executing hive query: Error while compiling statement: FAILED: SemanticException [Error 10011]: Line 1:155 Invalid function
Created 03-01-2016 06:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What database was the function created under (permanent functions are qualified with a database name). If you did not specify the DB name when you created it, it would have automatically used the current DB. Do you see the fully qualified function name when you run SHOW FUNCTIONS?
Created 03-04-2016 03:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It was not created with a specific database. If I run SHOW FUNCTION within the HiveCLI it shows up as default.<myfunction>. If I run SHOW FUNCTION in Hue, the function does NOT show up even though I'm using the "default" database. Is there a way I can make it not be under "default." and just "<function>"? Hue/App using ODBC has no problem using those functions (e.g. count()).
If I add the jar file in Hue (one the left sidebar) and the function/class information it all works.
Created 03-05-2016 12:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There was supposed to be a RELOAD FUNCTIONS command to refresh the function list if the function was created in a different environment from the current one like what you have done here. However it looks like this command was not working properly in HDP 2.3. It was fixed in HIVE-13043.
The workaround for HDP 2.3 would be to restart HiveServer2, or to create the function in Hue/ODBC rather than in a separate HiveCLI.
Created 03-05-2016 02:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't seem to reply to your last comment but that was exactly the problem.
Created 03-01-2016 03:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Kevin Vasko @jdere Can you check if hive.server2.enable.doAs is set to True ?
Also, check this JIRA
https://issues.apache.org/jira/browse/HIVE-5160
Which version of Hive you are using ?