Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] DenseUnionWriter#setPosition fails with NullPointerException #399

Open
asfimport opened this issue May 1, 2020 · 9 comments
Open
Labels
good first issue Good for newcomers help wanted Extra attention is needed Type: bug Something isn't working

Comments

@asfimport
Copy link

The writer always iterates through all BaseWriters, and an array of 128 BaseWriters is allocated. So if you do not have 128 typeIds and do not touch all of them, setPosition will give you an exception.

Reporter: David Li / @lidavidm

Note: This issue was originally created as ARROW-8665. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Liya Fan / @liyafan82:
@lidavidm Sorry for the problem. I will provide a patch for it.

@asfimport
Copy link
Author

David Li / @lidavidm:
No worries! I ran into this while trying to find a way to get the validity buffer to be resized when trying to work around ARROW-8666. But thanks to your suggestion there I should be set for our use case.

@asfimport
Copy link
Author

Todd Farmer / @toddfarmer:
This issue was last updated over 90 days ago, which may be an indication it is no longer being actively worked. To better reflect the current state, the issue is being unassigned. Please feel free to re-take assignment of the issue if it is being actively worked, or if you plan to start that work soon.

@assignUser assignUser transferred this issue from apache/arrow Nov 27, 2024
@nbauernfeind
Copy link
Contributor

This issue still persists.

Notably:

  @Override
  public void setPosition(int index) {
    super.setPosition(index);
    for (BaseWriter writer : writers) {
      writer.setPosition(index);
    }
  }

But, writers is an array of length 128 and each writer is lazily initialized - in that every writer is null.

The result is that it is impossible to write Lists of Unions using this library. Noting that UnionListWriter#startList invokes setPosition:

  @Override
  public void startList() {
    vector.startNewValue(idx());
    writer.setPosition(vector.getOffsetBuffer().getInt((idx() + 1L) * OFFSET_WIDTH));
    listStarted = true;
  }

@lidavidm lidavidm added good first issue Good for newcomers help wanted Extra attention is needed labels Feb 9, 2025
@lidavidm
Copy link
Member

lidavidm commented Feb 9, 2025

@jbonofre @kou I think there are a lot of little bugs like this that Nate has been reporting or re-raising...maybe let's organize them with a label/project and see if we can tackle them over time? At least I don't want to lose track of the and Nate has been doing us a favor showing where we've overlooked things 😅

@jbonofre
Copy link
Member

jbonofre commented Feb 9, 2025

I think it's OK to re-add step by step this kind of issues. On some other ASF projects, we started with the issues specific for the first release (after a move from a repo to another). Then, we can add the "old" issues. I think it's ok 😄 (a bit of work/script).

@lidavidm
Copy link
Member

lidavidm commented Feb 9, 2025

I'm just going to start labeling with help-wanted (and good-first-issue if appropriate)

@jbonofre
Copy link
Member

jbonofre commented Feb 9, 2025

I'm just going to start labeling with help-wanted (and good-first-issue if appropriate)

It sounds good. I will help on that front 😄

@kou
Copy link
Member

kou commented Feb 9, 2025

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed Type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants