Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
DrGenious
Creator
Creator

QUERY ERROR

Hey,

 

I am trying to make this query:

" INSERT INTO TABLE thodoris VALUES (((String)globalMap.get('mykey1')), ((String)globalMap.get('mykey2')))"

 

but i have this error :

[ERROR]: etisalat.test_table_0_1.test_table - tHiveRow_2 - Error while compiling statement: FAILED: ParseException line 1:45 mismatched input 'globalMap' expecting ) near ')' in value row constructor

 

Can someon help me ?

Labels (2)
9 Replies
Anonymous
Not applicable

It is a syntax error in the query, change it to:
" INSERT INTO TABLE thodoris VALUES ("+((String)globalMap.get("mykey1"))+","+ ((String)globalMap.get("mykey2"))+")"

Regards
Shong
DrGenious
Creator
Creator
Author

@shong  thanks for the quick response.

 

The query is in thiverow component and now I have this error

FAILED: ParseException line 1:41 cannot recognize input near ')' '<EOF>' '<EOF>' in value row constructor.

 

Also in tsetglobalvar i set the "mykey1" to row3.ID. Is this the correct way to assign a row's value into a key in tsetglobalvar?

Anonymous
Not applicable

Hi
Make sure the value of global variable is gotten correctly. For testing, print the value of global variable on console to check the value before they are used.
DrGenious
Creator
Creator
Author

@shong 

Ok I will do it.But for insert into ? Can you help me with the problem that I have?  

FAILED: ParseException line 1:41 cannot recognize input near ')' '<EOF>' '<EOF>' in value row constructor.

 

 

I set global vars in a tjavarow like : globalMap.put("varId", input_row.Id);
                                                        globalMap.put("varName", input_row.Name);

Anonymous
Not applicable

change it to
" INSERT INTO TABLE thodoris VALUES ("+(String)globalMap.get("mykey1")+","+ (String)globalMap.get("mykey2")+")"

and Make sure the value of global variable is not null, please test and let me know if it works.

Regards
Shong

DrGenious
Creator
Creator
Author

@shong 

It worked fine. Although I tried this : 

0683p000009M9xY.pngAnd it shows me this : 

[WARN ]: org.apache.hadoop.util.Shell - Did not find winutils.exe: java.io.FileNotFoundException: java.io.FileNotFoundException: HADOOP_HOME and hadoop.home.dir are unset. -see https://wiki.apache.org/hadoop/WindowsProblems

 

(SOS)And this error :

[ERROR]: test_table - tHiveRow_2 - Error while compiling statement: FAILED: SemanticException [Error 10293]: Unable to create temp file for insert values Expression of type . not supported in insert/values 

 

 

 

My tjavarow:

globalMap.put("id", input_row.id);
globalMap.put("name", input_row.name);
globalMap.put("created_time", input_row.created_time);
globalMap.put("mac", input_row.mac);
globalMap.put("ip", input_row.ip);
globalMap.put("duration", input_row.duration);

 

My query in thiverow: 

"INSERT INTO TABLE omg VALUES ("+((String)globalMap.get("id"))+","+ ((String)globalMap.get("name"))+","+ ((String)globalMap.get("created_time"))+","+ ((String)globalMap.get("mac"))+","+ ((String)globalMap.get("ip"))+","+ ((String)globalMap.get("duration"))+")"

This happens only on this job which has json. 

DrGenious
Creator
Creator
Author

@shong  It worked fine but now that I put twaitforfile and a jsoninput I have this error.

[ERROR]:table_0_1.test_table - tHiveRow_2 - Error while compiling statement: FAILED: SemanticException [Error 10293]: Unable to create temp file for insert values Expression of type . not supported in insert/values

Anonymous
Not applicable

Hi
Refer to the answers in this page,
https://community.cloudera.com/t5/Support-Questions/Insert-values-in-Array-data-type-Hive/td-p/12045...
have a try to change your query to format:
INSERT INTO TABLE thodoris Select "+(String)globalMap.get("mykey1")+","+ (String)globalMap.get("mykey2")
DrGenious
Creator
Creator
Author

@shong 

I tried also with select and it throws me these errors:

ParseException line 1:42 cannot recognize input near ')' '<EOF>' '<EOF>' in expression specification

"INSERT INTO TABLE omg SELECT ("+(String)globalMap.get("Id")+","+ (String)globalMap.get("Name")+")"

//

ParseException line 1:41 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in selection target

"INSERT INTO TABLE omg SELECT "+(String)globalMap.get("Id")+","+ (String)globalMap.get("Name")+""

//

If I dont put "" on the statement it throws an error that it is missing a (0683p000009MA9p.png at INTO.