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

Announcements
ALERT: The support homepage carousel is not displaying. We are working toward a resolution.

Qlik Talend Studio: How to update column properties when using a dynamic schema

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
TalendSolutionExpert
Contributor II
Contributor II

Qlik Talend Studio: How to update column properties when using a dynamic schema

Last Update:

Dec 19, 2025 2:53:50 AM

Updated By:

Xiaodi_Shi

Created date:

Apr 28, 2023 8:03:05 AM

In many cases, when using a dynamic schema, it's necessary to change the properties of a column to map the target data structure. The column properties include column name, value, type, etc.

Example Job

The following image shows an example of how to get the column properties on a tJavaRow component and update them.
jobDesignDemo.png

The example Java code below changes the column name of column 'name' to a new name, changes the data type of column 'age' to Integer. Copy this code and modify it according to specific needs, it supports changing column name, data type, length, precision, etc.
 
Dynamic columns = input_row.data;
for (int i = 0; i < columns.getColumnCount(); i++)
{
DynamicMetadata columnMetadata = columns.getColumnMetadata(i);
String col_name=columnMetadata.getName();
String col_type=columnMetadata.getType();

if(col_name.equals("name")){
columnMetadata.setName("new_name");
}

if(col_name.equals("age")){
columnMetadata.setType("id_Integer");
}
}
output_row.data=columns;​
Talend Support does not support custom code development or debugging.

Environment

Talend Data Integration 8.0.1 

 
Labels (2)
Comments
vmadakasha
Contributor
Contributor

Hi, thanks for the post.  is there a way to dynamically update a table?  I know how to do it for inserts.  Looking for a solution as how to update it as it requires a key to be set in the talend job.

Version history
Last update:
6 hours ago
Updated by: