Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-1820

Bug in DoubleParser and FloatParser - empty String is not casted to 0

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.8.0, 0.9, 0.8.1
    • 0.9
    • None
    • None

    Description

      Hi,

      I found the bug, when I wanted to read a csv file, which had a line like:
      "||\n"

      If I treat it as a Tuple2<Long,Long>, I get as expected a tuple (0L,0L).

      But if I want to read it into a Double-Tuple or a Float-Tuple, I get the following error:

      java.lang.AssertionError: Test failed due to a org.apache.flink.api.common.io.ParseException: Line could not be parsed: '||'
      ParserError NUMERIC_VALUE_FORMAT_ERROR

      This error can be solved by adding an additional condition for empty strings in the FloatParser / DoubleParser.

      We definitely need the CSVReader to be able to read "empty values".

      I can fix it like described if there are no better ideas

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Felix Neutatz Felix Neutatz
            Felix Neutatz Felix Neutatz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment