Hive Reserve Keyword support

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Hive Reserve Keyword support

Dibyendu Bhattacharya
Hi, 

I have a Hive Table which has a column named date. When I tried to query using Zeppelin %jdbc interpreter , I got bellow error.


Error while compiling statement: FAILED: ParseException line 1:312 Failed to recognize predicate 'date'. Failed rule: 'identifier' in expression specification
class org.apache.hive.service.cli.HiveSQLException
org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:231)
org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:217)
org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254)
org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:322)
org.apache.zeppelin.jdbc.JDBCInterpreter.interpret(JDBCInterpreter.java:408)
org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:94)
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:341)
org.apache.zeppelin.scheduler.Job.run(Job.java:176)
org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162)


My query looks like this :

select x,y,z from mytable where date = '2017-04-28"

I believe it is failing because date is reserve keyword . Is there anyway I can set  hive.support.sql11.reserved.keywords=false in Zeppelin ?

regards, 
Dibyendu



Reply | Threaded
Open this post in threaded view
|

Re: Hive Reserve Keyword support

Jongyoul Lee
If it's possible for you to pass that properties when you create a connection, you can passes it by setting it into interpreter setting

On Sat, Apr 29, 2017 at 4:25 PM, Dibyendu Bhattacharya <[hidden email]> wrote:
Hi, 

I have a Hive Table which has a column named date. When I tried to query using Zeppelin %jdbc interpreter , I got bellow error.


Error while compiling statement: FAILED: ParseException line 1:312 Failed to recognize predicate 'date'. Failed rule: 'identifier' in expression specification
class org.apache.hive.service.cli.HiveSQLException
org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:231)
org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:217)
org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254)
org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:322)
org.apache.zeppelin.jdbc.JDBCInterpreter.interpret(JDBCInterpreter.java:408)
org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:94)
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:341)
org.apache.zeppelin.scheduler.Job.run(Job.java:176)
org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162)


My query looks like this :

select x,y,z from mytable where date = '2017-04-28"

I believe it is failing because date is reserve keyword . Is there anyway I can set  hive.support.sql11.reserved.keywords=false in Zeppelin ?

regards, 
Dibyendu






--
이종열, Jongyoul Lee, 李宗烈
Reply | Threaded
Open this post in threaded view
|

Re: Hive Reserve Keyword support

Felix Cheung
I think you can put backticks around the name date


From: Jongyoul Lee <[hidden email]>
Sent: Tuesday, May 9, 2017 10:33:50 AM
To: [hidden email]
Subject: Re: Hive Reserve Keyword support
 
If it's possible for you to pass that properties when you create a connection, you can passes it by setting it into interpreter setting

On Sat, Apr 29, 2017 at 4:25 PM, Dibyendu Bhattacharya <[hidden email]> wrote:
Hi, 

I have a Hive Table which has a column named date. When I tried to query using Zeppelin %jdbc interpreter , I got bellow error.


Error while compiling statement: FAILED: ParseException line 1:312 Failed to recognize predicate 'date'. Failed rule: 'identifier' in expression specification
class org.apache.hive.service.cli.HiveSQLException
org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:231)
org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:217)
org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254)
org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:322)
org.apache.zeppelin.jdbc.JDBCInterpreter.interpret(JDBCInterpreter.java:408)
org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:94)
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:341)
org.apache.zeppelin.scheduler.Job.run(Job.java:176)
org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162)


My query looks like this :

select x,y,z from mytable where date = '2017-04-28"

I believe it is failing because date is reserve keyword . Is there anyway I can set  hive.support.sql11.reserved.keywords=false in Zeppelin ?

regards, 
Dibyendu






--
이종열, Jongyoul Lee, 李宗烈
Reply | Threaded
Open this post in threaded view
|

Re: Hive Reserve Keyword support

Dibyendu Bhattacharya
right. This backticks worked 

On Wed, May 10, 2017 at 8:51 AM, Felix Cheung <[hidden email]> wrote:
I think you can put backticks around the name date


From: Jongyoul Lee <[hidden email]>
Sent: Tuesday, May 9, 2017 10:33:50 AM
To: [hidden email]
Subject: Re: Hive Reserve Keyword support
 
If it's possible for you to pass that properties when you create a connection, you can passes it by setting it into interpreter setting

On Sat, Apr 29, 2017 at 4:25 PM, Dibyendu Bhattacharya <[hidden email]> wrote:
Hi, 

I have a Hive Table which has a column named date. When I tried to query using Zeppelin %jdbc interpreter , I got bellow error.


Error while compiling statement: FAILED: ParseException line 1:312 Failed to recognize predicate 'date'. Failed rule: 'identifier' in expression specification
class org.apache.hive.service.cli.HiveSQLException
org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:231)
org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:217)
org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254)
org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:322)
org.apache.zeppelin.jdbc.JDBCInterpreter.interpret(JDBCInterpreter.java:408)
org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:94)
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:341)
org.apache.zeppelin.scheduler.Job.run(Job.java:176)
org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162)


My query looks like this :

select x,y,z from mytable where date = '2017-04-28"

I believe it is failing because date is reserve keyword . Is there anyway I can set  hive.support.sql11.reserved.keywords=false in Zeppelin ?

regards, 
Dibyendu






--
이종열, Jongyoul Lee, 李宗烈