Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Hive : Special Character Column in a table

avatar
New Contributor

Hi Team,

 

What i'm trying:

 

- To create a table that has a special character column in Hive.  iam getting an error due to hive doesn't support a special character column.

 

Ex: Create external table tbl1 (Sales$ float)

 

Why I need: iam trying to pull data from Sql server as it's the source where in the column has special char and i'm trying to replicate the source schema in Hive. iam using Sqoop tool to pull data from sql server and have it on the Hadoop.. since i create the external table in hive and  it's refering to that hdfs path for data.

 

Kindly help..

 

Thank you

 

3 REPLIES 3

avatar
Champion

@bdgreek

 

Try this

 

Create external table tbl1 (`Sales$` float)

avatar
New Contributor

yes, i'm able to create it with the backticks.. if i try describe formatted tablename. i see that $ sign is replaced by underscore (_)..

column name : Sales_

i read the column names from hive tables and pass it to source table via sqoop.. in that case, Sales_ column is not present in the source, so im getting an error  saying Sales_ invalid column at the source side ,even though i create a column with back ticks in hive.

avatar
Champion

@bdgreek

 

I tried the below queries and it shows the column as created (Sales$). Not sure it is due to your version

 

 

create table mydb.test1 (`Sales$` float) 
describe formatted mydb.test1
describe mydb.test1