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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] How to use the Dynamic Settings for tHDFS components?

I opened the dynamic settings and clicked the green plus sign. This gives me:
0683p000009MBEk.png
I have tried to fill the "Code" box with the following:
(context.is_test ? "tHDFSConnection_1" : "tHDFSConnection_2")
(context.is_test ? tHDFSConnection_1 : tHDFSConnection_2)
context.hdfs_connection
(I tried making context.hdfs_connection a string with the value of "tHDFSConnection_2")
None of these worked, as when I clicked on Basic Settings and then back to Dynamic Settings, the value was reverted to tHDFSConnection_1.
How may I get this to work?
Regards,
Matthew
Labels (2)
7 Replies
Anonymous
Not applicable
Author

Hi Matthew 
The dynamic settings tab don't support context variables.
Best regards
Shong
Anonymous
Not applicable
Author

I am facing the same issue under tMySQLInput and the settings revert automatically. 
While you are on the Dynamic Settings tab the Code works fine. For Example : This works and picks the connection from Global Map.
" + globalMap.get("conn2") + "
Associated Java Code also seems fine.
java.sql.Connection conn_tMysqlInput_1 = null;
conn_tMysqlInput_1 = (java.sql.Connection) globalMap.get("conn_" + globalMap.get("conn2") + "");
But as soon as you switch Tab, the value in dynamic tab reverts to tMysqlConnection_1 and also the java code.
Anonymous
Not applicable
Author

I am facing the same issue under tMySQLInput and the settings revert automatically. 
While you are on the Dynamic Settings tab the Code works fine. For Example : This works and picks the connection from Global Map.
" + globalMap.get("conn2") + "
Associated Java Code also seems fine.
java.sql.Connection conn_tMysqlInput_1 = null;
conn_tMysqlInput_1 = (java.sql.Connection) globalMap.get("conn_" + globalMap.get("conn2") + "");
But as soon as you switch Tab, the value in dynamic tab reverts to tMysqlConnection_1 and also the java code.

Hi Shong,
I have a similar requirement as chitwan.
I have a job that I wish to be able to use two different Oracle Databases depending on the context variable I pass to it. One of the DBs uses the Oracle Service Name, whereas the other uses a Oracle SID:

0683p000009MAv6.png
I would need to have two different tOracleConnections in a single job to do this.
How would I go about dynamically assigning my tOracleInput/Outputs to use a particular tOracleConnection based on a context variable?
Thanks and best regards,
Matthew
Anonymous
Not applicable
Author

This is exactly as explained in 
Scenario 3: Reading data from MySQL databases through context-based dynamic connections

help.talend.com/display/TalendComponentsReferenceGuide54EN/tMysqlInput

And as mentioned here, that this should not only allow context variable, it should allow any code.

help.talend.com/display/TalendOpenStudioforBigDataUserGuide55EN/3.2.6+How+to+define+component+properties
As code, you can input a context variable or a piece of Java code.
Anonymous
Not applicable
Author

But not working the way its explained, or we are missing something.
Anonymous
Not applicable
Author

Good News. 
Its working as expected in Version: 5.6.1
Build id: V5.6.1_20141207_1530
Anonymous
Not applicable
Author

Good News. 
Its working as expected in Version: 5.6.1
Build id: V5.6.1_20141207_1530

Awesome. Thanks for the heads up Chitwan.