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

Creating Subframe of Frame with zero rows #492

Closed
tomschw opened this issue Apr 5, 2023 · 2 comments · Fixed by #496
Closed

Creating Subframe of Frame with zero rows #492

tomschw opened this issue Apr 5, 2023 · 2 comments · Fixed by #496
Assignees
Labels
bug A mistake in the code.

Comments

@tomschw
Copy link
Contributor

tomschw commented Apr 5, 2023

The constructor, which creates a Frame around the sub-frame of another Frame, throws an error, if the Frame has no rows, even if the new Frame should also have zero rows.

Code example:

f = createFrame(
    [1, 10, 20],
    "temp");

registerView("sample", f);

k = sql("select sample.temp from sample
 where sample.temp <= 0;");

print(k);

The compiler first creates a filter row Kernel, which returns a frame with zero rows. Then it calls Kernel to extract the column temp from that frame, which throws the aforementioned error.

@pdamme
Copy link
Collaborator

pdamme commented Apr 11, 2023

Thanks for reporting this bug, @tomschw. I can reproduce it.

pdamme pushed a commit that referenced this issue Apr 11, 2023
- Add test to check for crashes when creating sub-frame from Frame with zero rows.
- Add fix to enable creation of a sub-frame with zero rows from a Frame with zero rows, by excluding the assertions.
- Closes #492.
@pdamme
Copy link
Collaborator

pdamme commented Apr 11, 2023

JFYI: While looking into this issue and your PR #496, I discovered that this is actually just a special case of a more general bug. I've opened a new issue #504 specifically for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A mistake in the code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants