Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;"`
Is there any ways I could use the string query in my impala command using tSystem component in TOS? Appreciate any helps. Thanks.
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+"';"
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;'