You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by "second_comet.yahoo.com via user" <us...@hive.apache.org> on 2022/07/14 05:49:58 UTC

hive table with special character for column name

I able to create hive table with special character ^ in column name    . example column name : column^test  . but when I do  select * from the table, i get below error
Error: java.io.IOException: java.lang.IllegalArgumentException: Error: name expected at the position 40 of 'struct<$timestamp:string,company:string,^level:string,title:string,totalyearlycompensation:int,!location:string,????_yearsofexperience:double,yearsatcompany:double,tag:string,basesalary:int,stockgrantvalue:double,bonus:double,gender:string,otherdetails:string,cityid:int,dmaid:string,rownumber:int,masters_degree:int,bachelors_degree:int,doctorate_degree:int,highschool:int,some_college:int,race_asian:int,race_white:int,race_two_or_more:int,race_black:int,race_hispanic:int,race:string,education:string>' but '^' is found. (state=,code=0)
Why hive server allow to create table with special character ^ for column name but cannot query using a select statement ?

Thank you,Comet

Re: hive table with special character for column name

Posted by "second_comet.yahoo.com via user" <us...@hive.apache.org>.
when use beeline cli or pyhive to do select * from table , it will return error like i mentioned. The screenshot you are using GUI to access database server directly right?
   On Thursday, July 14, 2022 at 02:43:44 PM GMT+8, lpc_encode <lp...@aliyun.com> wrote:  
 
 #yiv5242789865 font{line-height:1.6;}#yiv5242789865 ul, #yiv5242789865 ol{padding-left:20px;list-style-position:inside;}    
     
      
|  | lpc_encode |
| lpc_encode@aliyun.com |

     ---- Replied Message ----   
|  From  |  second_comet.yahoo.com via user<us...@hive.apache.org>   |
|  Date  |  7/14/2022 13:50  |
|  To  |   User<us...@hive.apache.org>   |
|  Subject  |  hive table with special character for column name  |

  I able to create hive table with special character ^ in column name    . example column name : column^test  . but when I do  select * from the table, i get below error
Error: java.io.IOException: java.lang.IllegalArgumentException: Error: name expected at the position 40 of 'struct<$timestamp:string,company:string,^level:string,title:string,totalyearlycompensation:int,!location:string,????_yearsofexperience:double,yearsatcompany:double,tag:string,basesalary:int,stockgrantvalue:double,bonus:double,gender:string,otherdetails:string,cityid:int,dmaid:string,rownumber:int,masters_degree:int,bachelors_degree:int,doctorate_degree:int,highschool:int,some_college:int,race_asian:int,race_white:int,race_two_or_more:int,race_black:int,race_hispanic:int,race:string,education:string>' but '^' is found. (state=,code=0)
Why hive server allow to create table with special character ^ for column name but cannot query using a select statement ?

Thank you,Comet
  

Re: hive table with special character for column name

Posted by lpc_encode <lp...@aliyun.com>.
  

  

[![](https://mail-online.nosdn.127.net/qiyelogo/defaultAvatar.png)| lpc_encode  
---|---  
lpc_encode@aliyun.com  
](https://maas.mail.163.com/dashi-web-
extend/html/proSignature.html?ftlId=1&name=lpc_encode&uid=lpc_encode%40aliyun.com&iconUrl=https%3A%2F%2Fmail-
online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png&items=%5B%22lpc_encode%40aliyun.com%22%5D)

\---- Replied Message ----

From  |  [second_comet.yahoo.com via user<us...@hive.apache.org>
](mailto:user@hive.apache.org)  
---|---  
Date  |  7/14/2022 13:50  
To  |  [ User<us...@hive.apache.org> ](mailto:user@hive.apache.org)  
Subject  |  hive table with special character for column name  
  
I able to create hive table with special character ^ in column name    .
example column name : column^test  . but when I do  select * from the table, i
get below error

  

Error: java.io.IOException: java.lang.IllegalArgumentException: Error: name
expected at the position 40 of
'struct<$timestamp:string,company:string,^level:string,title:string,totalyearlycompensation:int,!location:string,????_yearsofexperience:double,yearsatcompany:double,tag:string,basesalary:int,stockgrantvalue:double,bonus:double,gender:string,otherdetails:string,cityid:int,dmaid:string,rownumber:int,masters_degree:int,bachelors_degree:int,doctorate_degree:int,highschool:int,some_college:int,race_asian:int,race_white:int,race_two_or_more:int,race_black:int,race_hispanic:int,race:string,education:string>'
but '^' is found. (state=,code=0)

  

Why hive server allow to create table with special character ^ for column name
but cannot query using a select statement ?

  

  

Thank you,

Comet  


Re: hive table with special character for column name

Posted by lpc_encode <lp...@aliyun.com>.
you can try:column\\\^test.I think it needs escape

[![](https://mail-online.nosdn.127.net/qiyelogo/defaultAvatar.png)| lpc_encode  
---|---  
lpc_encode@aliyun.com  
](https://maas.mail.163.com/dashi-web-
extend/html/proSignature.html?ftlId=1&name=lpc_encode&uid=lpc_encode%40aliyun.com&iconUrl=https%3A%2F%2Fmail-
online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png&items=%5B%22lpc_encode%40aliyun.com%22%5D)

\---- Replied Message ----

From  |  [lpc_encode<lp...@aliyun.com> ](mailto:lpc_encode@aliyun.com)  
---|---  
Date  |  7/14/2022 13:54  
To  |  [ user@hive.apache.org<us...@hive.apache.org>
](mailto:user@hive.apache.org)  
Cc  |  [ user@hive.apache.org<us...@hive.apache.org>
](mailto:user@hive.apache.org)  
Subject  |  Re: hive table with special character for column name  
  
I suggest you follow the rules, but I appreciate your bold attempt

[![](https://mail-online.nosdn.127.net/qiyelogo/defaultAvatar.png)| lpc_encode  
---|---  
lpc_encode@aliyun.com  
](https://maas.mail.163.com/dashi-web-
extend/html/proSignature.html?ftlId=1&name=lpc_encode&uid=lpc_encode%40aliyun.com&iconUrl=https%3A%2F%2Fmail-
online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png&items=%5B%22lpc_encode%40aliyun.com%22%5D)

\---- Replied Message ----

From  |  [second_comet.yahoo.com via user<us...@hive.apache.org>
](mailto:user@hive.apache.org)  
---|---  
Date  |  7/14/2022 13:50  
To  |  [ User<us...@hive.apache.org> ](mailto:user@hive.apache.org)  
Subject  |  hive table with special character for column name  
  
I able to create hive table with special character ^ in column name    .
example column name : column^test  . but when I do  select * from the table, i
get below error

  

Error: java.io.IOException: java.lang.IllegalArgumentException: Error: name
expected at the position 40 of
'struct<$timestamp:string,company:string,^level:string,title:string,totalyearlycompensation:int,!location:string,????_yearsofexperience:double,yearsatcompany:double,tag:string,basesalary:int,stockgrantvalue:double,bonus:double,gender:string,otherdetails:string,cityid:int,dmaid:string,rownumber:int,masters_degree:int,bachelors_degree:int,doctorate_degree:int,highschool:int,some_college:int,race_asian:int,race_white:int,race_two_or_more:int,race_black:int,race_hispanic:int,race:string,education:string>'
but '^' is found. (state=,code=0)

  

Why hive server allow to create table with special character ^ for column name
but cannot query using a select statement ?

  

  

Thank you,

Comet  


Re: hive table with special character for column name

Posted by lpc_encode <lp...@aliyun.com>.
I suggest you follow the rules, but I appreciate your bold attempt

[![](https://mail-online.nosdn.127.net/qiyelogo/defaultAvatar.png)| lpc_encode  
---|---  
lpc_encode@aliyun.com  
](https://maas.mail.163.com/dashi-web-
extend/html/proSignature.html?ftlId=1&name=lpc_encode&uid=lpc_encode%40aliyun.com&iconUrl=https%3A%2F%2Fmail-
online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png&items=%5B%22lpc_encode%40aliyun.com%22%5D)

\---- Replied Message ----

From  |  [second_comet.yahoo.com via user<us...@hive.apache.org>
](mailto:user@hive.apache.org)  
---|---  
Date  |  7/14/2022 13:50  
To  |  [ User<us...@hive.apache.org> ](mailto:user@hive.apache.org)  
Subject  |  hive table with special character for column name  
  
I able to create hive table with special character ^ in column name    .
example column name : column^test  . but when I do  select * from the table, i
get below error

  

Error: java.io.IOException: java.lang.IllegalArgumentException: Error: name
expected at the position 40 of
'struct<$timestamp:string,company:string,^level:string,title:string,totalyearlycompensation:int,!location:string,????_yearsofexperience:double,yearsatcompany:double,tag:string,basesalary:int,stockgrantvalue:double,bonus:double,gender:string,otherdetails:string,cityid:int,dmaid:string,rownumber:int,masters_degree:int,bachelors_degree:int,doctorate_degree:int,highschool:int,some_college:int,race_asian:int,race_white:int,race_two_or_more:int,race_black:int,race_hispanic:int,race:string,education:string>'
but '^' is found. (state=,code=0)

  

Why hive server allow to create table with special character ^ for column name
but cannot query using a select statement ?

  

  

Thank you,

Comet