Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: gabygyyHI,
i'm using a metadata change node and i'm having some problems with date fields.
The source file is an xls file read as unicode by the xls node and the final scope is to store data into a database table.
After reading file i'm using a metadata change node for converting all columns to string.
From string i must adapt them to data type expected by orcale table, and in this case i'm using another metadata change with 2 inputs:
-1 all columns as string type
-2 all columns names and their data type as expected by oracle( in this case i have for eg more DATE fields in input as string Effective Time
15/05/2000
21/04/2015
04/01/2000
05/05/2015
01/09/2014
Note that in input are many DATE columns with null values also and with other formats also.
I fon the last metadata chnage node i don't specify the date format string the node is crashing
"
2015-09-15 11:37:54.019; ERROR: Error threshold breached! Too many errors occured processing data
id: 5 chain: 0 group: 0
javaDetail: com.lavastorm.brain.node.lal.changeMetadata.Change Metadata.outputUnconverted(ChangeMetadata.java@600 )
dataDetail:
metadata changes(in) row: 4
columns: ['NewNameField', 'java.lang.String'], ['NewTypeField', 'java.lang.String'], ['OldNameField', 'java.lang.String']
records:
[Null, Null, Null]
errors(out) row: 1
columns: ['EFFECTIVE TIME', 'java.lang.String'], ['Expiration Time', 'java.lang.String'], ['Subscription Effective Time', 'java.lang.String'], ['Subscription Expiration Time', 'java.lang.String'], ['_Error', 'java.lang.String'], ['_ErrorCode', 'java.lang.String']
records:
[01/01/2000, 01/01/2037, 01/07/2014, 01/01/2037, Field 'EFFECTIVE TIME', Record#1 - Could not convert EFFECTIVE TIME to date; java.text.ParseException: Unparseable date: "01/01/2000", ls.brain.node.changeMetadata.conversionError]
changed data(out) row: 0
columns: ['EFFECTIVETIME', 'com.lavastorm.lang.Date'], ['EXPIRATIONTIME', 'com.lavastorm.lang.Date'], ['SUBSCRIPTIONEFFECTIVETIME', 'com.lavastorm.lang.Date'], ['SUBSCRIPTIONEXPIRATIONTIME', 'com.lavastorm.lang.Date']
input data(in) row: 1
columns: ['EFFECTIVE TIME', 'java.lang.String'], ['Expiration Time', 'java.lang.String'], ['Subscription Effective Time', 'java.lang.String'], ['Subscription Expiration Time', 'java.lang.String']
records:
[01/01/2000, 01/01/2037, 01/07/2014, 01/01/2037]
"
If i specify the date format as dd/mm/yyyy then is running but the output data is wrong like this
in the input's oreder
2000-01-15
2015-01-21
2015-01-04
2015-01-05
2014-01-01
Please advice what can i do to solve the issue to treat as much cases posible without hardcoding something for each column!