Skip to content

Add ReadRel LocalFiles#96

Merged
jacques-n merged 2 commits intosubstrait-io:mainfrom
baibaichen:feature/LocalFiles
Nov 25, 2022
Merged

Add ReadRel LocalFiles#96
jacques-n merged 2 commits intosubstrait-io:mainfrom
baibaichen:feature/LocalFiles

Conversation

@baibaichen
Copy link
Copy Markdown
Contributor

@baibaichen baibaichen commented Oct 22, 2022

Currently substrait-java doesn't implement LocalFiles ReadRel, this patch adds this missing Rel.

How to test

Add a new UT LocalFilesRoundtripTest

@baibaichen
Copy link
Copy Markdown
Contributor Author

cc @jacques-n

Copy link
Copy Markdown
Collaborator

@jacques-n jacques-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally looks good. I think it probably makes sense to make each of the formats empty classes instead of enums so that we can introduce options on each of those formats later without having breaking changes. Can you make that change?

@baibaichen
Copy link
Copy Markdown
Contributor Author

This generally looks good. I think it probably makes sense to make each of the formats empty classes instead of enums so that we can introduce options on each of those formats later without having breaking changes. Can you make that change?

Sure, let me first verify it in the gluten and see whther it's ok or not, it could take me a while.

Copy link
Copy Markdown
Collaborator

@jacques-n jacques-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add roundtrip tests to this?


@Override
public RelNode visit(LocalFiles localFiles) throws RuntimeException {
throw new UnsupportedOperationException("LocalFiles is not supported");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you throwing here?

Copy link
Copy Markdown
Contributor Author

@baibaichen baibaichen Nov 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you throwing here?

using visitFallback instead of throwing an exception directly for unsupported rel

import java.util.Arrays;
import org.junit.jupiter.api.Test;

public class LocalFilesRoundtripTest {
Copy link
Copy Markdown
Contributor Author

@baibaichen baibaichen Nov 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacques-n

Can you please add roundtrip tests to this?

Do you mean this?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, apparently missed that on first pass. Thanks

@jacques-n jacques-n merged commit 55d47d5 into substrait-io:main Nov 25, 2022
@baibaichen baibaichen deleted the feature/LocalFiles branch November 25, 2022 05:17
ajegou pushed a commit to ajegou/substrait-java that referenced this pull request Mar 29, 2024
* feat(relation): add read relation LocalFiles

* fix: using visitFallback instead of throwing an exception directly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants