Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Does anyone know a way to loop through all fields in a dynamic schema input, using the tJavaRow component?
I'm trying to implement a schema validation process, however the source input data utilizes a dynamic schema, so I'm unable to utilize the tSchemaComplianceCheck component. I want to create a custom routine to determine the data type of each record in each field, however I'm not sure how to implement this routine so that it can be applied to all fields in the schema?
Thanks!
I have tried to implement this into the example you provided but when I have an integer field and a string field defined in the dynamic schema, both are returned as "id_String" when I use the GetType method.
Starting job testDynacal at 15:53 10/07/2013.
connecting to socket on port 3546
connected
The length of column is: 11column Type is: id_Integer
The length of column is: 11column Type is: id_String
The length of column is: 11column Type is: id_Integer
The length of column is: 11column Type is: id_String
disconnected
Job testDynacal ended at 15:53 10/07/2013.
int ncount=input_row.c.getColumnCount();
DynamicMetadata column0=row1.c.getColumnMetadata(ncount-2);
DynamicMetadata column1=row1.c.getColumnMetadata(ncount-1);
System.out.println("The column name is:"+column0.getName()+" The length of column is: "+column0.getLength()+" The column Type is: "+column0.getType());
System.out.println("The column name is:"+column1.getName()+" The length of column is: "+column1.getLength()+" The column Type is: "+column1.getType());