-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle LIMIT ALL queries using a sentinel value in FetchRel::count
FetchRels with no count set could not be distinguished from FetchRels with count set to 0. To account for this, the spec now uses -1 as a sentinel value for this.
- Loading branch information
Showing
4 changed files
with
65 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.substrait.isthmus; | ||
|
||
import io.substrait.dsl.SubstraitBuilder; | ||
import io.substrait.relation.Rel; | ||
import io.substrait.type.TypeCreator; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class FetchTest extends PlanTestBase { | ||
|
||
static final TypeCreator R = TypeCreator.of(false); | ||
|
||
final SubstraitBuilder b = new SubstraitBuilder(extensions); | ||
|
||
final Rel TABLE = b.namedScan(List.of("test"), List.of("col1"), List.of(R.STRING)); | ||
|
||
@Test | ||
void limitOnly() { | ||
Rel rel = b.limit(50, TABLE); | ||
assertFullRoundTrip(rel); | ||
} | ||
|
||
@Test | ||
void offsetOnly() { | ||
Rel rel = b.offset(50, TABLE); | ||
assertFullRoundTrip(rel); | ||
} | ||
|
||
@Test | ||
void offsetAndLimit() { | ||
Rel rel = b.fetch(50, 10, TABLE); | ||
assertFullRoundTrip(rel); | ||
} | ||
} |