Skip to main content
ep_01
Silver ⭐️
January 28, 2020
Solved

How to accommodate special character '?' in a column name in Hive

I have a query where as per the requirement the column name should be 'abc xyz?'. I am using tilted quotes to accommodate the space and special characters in between column name but i am getting the below error with '?':

 

Parameters cannot be used with normal Statement objects, use PreparedStatements instead.

 

I am using SQL Workbench for connecting to Hive. 

stevenmatison
Platinum ⭐️⭐️
January 28, 2020

I would highly recommend to not use special characters in columns names.  Per documentation hive .13 (link) `column?name` should work with Hive,  however, there is no gauruntee that other clients, including SQL Workbench will allow this when the special character can be considered a code like character ($ % & ? " , . etc)

 

 

2 replies

stevenmatison
Platinum ⭐️⭐️
January 28, 2020

I would highly recommend to not use special characters in columns names.  Per documentation hive .13 (link) `column?name` should work with Hive,  however, there is no gauruntee that other clients, including SQL Workbench will allow this when the special character can be considered a code like character ($ % & ? " , . etc)

 

 

Translate
ep_01
ep_01Author
Silver ⭐️
January 29, 2020

Thankyou Steven 🙂

Translate