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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.2.0
    • Java
    • 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

            Unassigned Unassigned
            icexelloss Li Jin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: