Menu

dateFormat does not work

Help
2016-01-05
2016-01-06
  • Sunil Kamath

    Sunil Kamath - 2016-01-05

    I am setting a custom dateFormat in the driver and it is not detecting the data type of the column.
    When I examine the source code, the bug is in CsvReader.java in the inferColumnTypes function:

                else if (value.equals(("" + converter.parseDate(value) + "          ").substring(0, 10)))
                {
                    typeName = "Date";
                }
    

    This condition will NEVER return true unless the default ISO date format is used.
    Instead it should be:

                else if (converter.parseDate(value) != null)
                {
                    typeName = "Date";
                }
    
     
  • Simon Chenery

    Simon Chenery - 2016-01-06

    Logged as CsvJdbc Bug #119 Date, Time column types not inferred correctly.

     

Log in to post a comment.