Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-888

DateFormatTransformer cannot convert non-string type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3
    • 1.4
    • None
    • any

    Description

      When using the DateFormatTransformer, if the source column is of type java.sql.TimeStamp, an exception is thrown converting this to a String. Solution is to not typecast to a String but rather invoke the .toString() method of the object to retrieve the string representation of the object.

      (About line 68)
      } else

      { String value = (String) o; aRow.put(column, process(value, fmt)); }

      should be
      } else

      { String value = o.toString(); aRow.put(column, process(value, fmt)); }

      Attachments

        1. DateFormatTransformer.java
          3 kB
          Amit Nithian

        Activity

          People

            shalin Shalin Shekhar Mangar
            anithian Amit Nithian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1m
                1m
                Remaining:
                Remaining Estimate - 1m
                1m
                Logged:
                Time Spent - Not Specified
                Not Specified