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

[Java] Users are required to initialize VariableLengthVectors.offsetVector before calling VariableLengthVectors.mutator.getSafe

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.2.0
    • Component/s: None
    • Labels:
      None

      Description

      https://github.com/apache/arrow/blob/master/java/vector/src/main/codegen/templates/VariableLengthVectors.java#L492

      Here VariableLengthVectors.getMutator().setSafe() calls:

      offsetVector.getAccessor().get(index)
      

      however, index 0 of offsetVector (which is always 0) is not initialized by VariableLengthVectors.

      As a result, user of the VariableLengthVectors needs to manually initialize
      the class by calling:

      VariableLengthVectors.getOffsetVector().getMutator().setSafe(0, 0)
      

      I wonder if this is necessary or should VariableLengthVectors initialize this for the user

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              icexelloss Li Jin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: