Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-20798

GenerateUnsafeProjection should check if value is null before calling the getter

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.1.2, 2.2.0
    • SQL
    • None

    Description

      GenerateUnsafeProjection.writeStructToBuffer() does not honor the assumption that one should first make sure the value is not null before calling the getter. This can lead to errors.

      An example of generated code:

      /* 059 */         final UTF8String fieldName = value.getUTF8String(0);
      /* 060 */         if (value.isNullAt(0)) {
      /* 061 */           rowWriter1.setNullAt(0);
      /* 062 */         } else {
      /* 063 */           rowWriter1.write(0, fieldName);
      /* 064 */         }
      

      Attachments

        Activity

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

          People

            ala.luszczak Ala Luszczak Assign to me
            ala.luszczak Ala Luszczak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment