Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-5583

[Java] When the isSet of a NullableValueHolder is 0, the buffer field should not be used

    XMLWordPrintableJSON

Details

    Description

      For each variable-width vector, like the VarCharVector, it has a set method that uses a NullableValueHolder as the input parameter. When the isSet field is set to 0, it means the value to set is null, so the buffer field of the NullableValueHolder is invalid, and should not be used.

      For example, the user may set a null value in the VarCharVector with the following code snippet:

      NullableVarCharHolder holder = new NullableVarCharHolder();
      holder.isSet = 0;
      ...
      varCharVector.set(i, holder);

      Please note that in the code above, the holder.buffer is not set, so it is null. According to the VarCharVector#set method, it will set the bytes using holder.buffer even if holder.isSet equals 0. This will lead to an exception.

      Attachments

        Issue Links

          Activity

            People

              fan_li_ya Liya Fan
              fan_li_ya Liya Fan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m