Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ?
@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?
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);
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
It worked fine. Although I tried this :
And 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.
@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
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 ( at INTO.