Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-975

Null-on-exception option for cast functions

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

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • Future
    • Functions - Drill
    • None

    Description

      Currently, if a particular value cannot be cast to the target type, an exception is thrown and the query fails. We should have a mode that will treat the output of all cast functions as nullable, and return a null value if the cast fails, rather than throwing an exception.

      An important example where this is important is when using the Text reader. The text reader always produces a single, RepeatedVarChar column. The columns are then cast to the appropriate type. For the columns that are cast to numeric types, if there is no value (i.e. it's an empty string), currently this will throw NumberFormatException. What we really want is for it to produce a Null value.

      Attachments

        Issue Links

        Activity

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

          People

            Unassigned Unassigned
            sphillips Steven Phillips
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment