1

I have below field configuration:

@Parsed(field="TEST_ID", defaultNullRead="000000")
private Long testId

now when the input file (csv parsing) contains value as NULL, it is not converting to default long value of 0, rather throws LongConversion exception for "NULL"

e.g. row in csv file: (5th column containing NULL is an issue)

7777|ab|444|PENDING|NULL|VESRION|TEST|11

I am using csvRoutines for parsing the input csv file

Rakesh
  • 235
  • 2
  • 10

1 Answers1

1

NULL in your input is actually text and not Java's null. You need to tell the parser to translate the string NULL to java null.

Add the following annotation (you can give it more than one string that represents null:

@NullString(nulls = {"NULL", "N/A", "?"})

Hope this helps

Jeronimo Backes
  • 6,141
  • 2
  • 25
  • 29