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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
WSyahirah21
Creator
Creator

Define query in talend context using tSystem component

I am trying to run an impala command using the tSystem component in Talend Studio. I am able to run the command in terminal . 

impala-shell -i hostname:21000 -d default -k --ssl -q "COMPUTE STATS DEFAULT.TABLENAME;"

 

I tried to apply the same command in tSystem component. so, the command in TOS will be appied by this way:

 

In Talend context:

hostname = hostname:21000

database = default 

tablename = default.tablename

 

Impala command I defined in tSystem component:

"impala-shell -i context.hostname -d context.database -k --ssl -q "COMPUTE STATS context.tablename;""

 

However, I got an error for this line -> `-q "COMPUTE STATS context.tablename;"`

 

0695b00000OC2zLAAT.png 

Is there any ways I could use the string query in my impala command using tSystem component in TOS? Appreciate any helps. Thanks. 

Labels (4)
2 Replies
Anonymous
Not applicable

You don't use the context variable in a string correctly, try this expression:

"impala-shell -i context.hostname -d context.database -k --ssl -q 'COMPUTE STATS "+context.tablename+"';"

WSyahirah21
Creator
Creator
Author

Hi Shong, I received following error:

 

Query: 'COMPUTE STATS tablename;'

Query submitted at: 2022-02-21 16:05:17 (Coordinator: https://hostname:25000)

ERROR: ParseException: Syntax error in line 1:

'COMPUTE STATS tablename;'

^

Encountered: STRING LITERAL

Expected: ALTER, COMMENT, COMPUTE, COPY, CREATE, DELETE, DESCRIBE, DROP, EXPLAIN, GRANT, INSERT, INVALIDATE, LOAD, REFRESH, REVOKE, SELECT, SET, SHOW, TRUNCATE, UPDATE, UPSERT, USE, VALUES, WITH

 

CAUSED BY: Exception: Syntax error

 

Could not execute command: 'COMPUTE STATS tablename;'