Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hive Sql error- Invalid function CONVERT_FROM

Highlighted

Hive Sql error- Invalid function CONVERT_FROM

New Contributor

Hi,

I am trying to execute the following simple query on Zeppelin, but I am not able to figure out the reason behind this error. Can anyone suggest what is wrong in the script ?


%spark2

import spark.sql

import sqlContext.implicits._

import com.hortonworks.hwc.HiveWarehouseSession

val hive = HiveWarehouseSession.session(spark).build()


hive.execute("SELECT CONVERT_FROM(chunk,'UTF8') AS lbres_ck FROM oacis_zrlbres_ck").show(2)


Stack trace:


import spark.sql import sqlContext.implicits._ import com.hortonworks.hwc.HiveWarehouseSession hive: com.hortonworks.spark.sql.hive.llap.HiveWarehouseSessionImpl = com.hortonworks.spark.sql.hive.llap.HiveWarehouseSessionImpl@34e61f38 java.lang.RuntimeException: shadehive.org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: SemanticException [Error 10011]: Invalid function CONVERT_FROM at com.hortonworks.spark.sql.hive.llap.HiveWarehouseSessionImpl.execute(HiveWarehouseSessionImpl.java:70) ... 102 elided Caused by: shadehive.org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: SemanticException [Error 10011]: Invalid function CONVERT_FROM at shadehive.org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:300) at shadehive.org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:286) at shadehive.org.apache.hive.jdbc.HiveStatement.runAsyncOnServer(HiveStatement.java:324) at shadehive.org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:265) at shadehive.org.apache.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:497) at shadehive.org.apache.hive.jdbc.HivePreparedStatement.executeQuery(HivePreparedStatement.java:112) at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83) at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83) at com.hortonworks.spark.sql.hive.llap.JDBCWrapper.executeStmt(HS2JDBCWrapper.scala:166) at com.hortonworks.spark.sql.hive.llap.DefaultJDBCWrapper.executeStmt(HS2JDBCWrapper.scala) at com.hortonworks.spark.sql.hive.llap.HiveWarehouseSessionImpl.lambda$new$1(HiveWarehouseSessionImpl.java:50) at com.hortonworks.spark.sql.hive.llap.HiveWarehouseSessionImpl.execute(HiveWarehouseSessionImpl.java:67) ... 102 more