[
https://issues.apache.org/jira/browse/BEAM-7051?focusedWorklogId=226481&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-226481
]
ASF GitHub Bot logged work on BEAM-7051:
----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Apr/19 05:04
Start Date: 12/Apr/19 05:04
Worklog Time Spent: 10m
Work Description: kennknowles commented on pull request #8290:
[BEAM-7051] Support LIMIT OFFSET
URL: https://github.com/apache/beam/pull/8290#discussion_r274760539
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamSortRel.java
##########
@@ -210,33 +211,57 @@ public int getCount() {
}
private class LimitTransform<T> extends PTransform<PCollection<T>,
PCollection<T>> {
+ private int startIndex;
+
+ public LimitTransform(int startIndex) {
+ this.startIndex = startIndex;
+ }
+
@Override
public PCollection<T> expand(PCollection<T> input) {
Coder<T> coder = input.getCoder();
PCollection<KV<String, T>> keyedRow =
input.apply(WithKeys.of("DummyKey")).setCoder(KvCoder.of(StringUtf8Coder.of(),
coder));
- return keyedRow.apply(ParDo.of(new LimitFn<T>(getCount())));
+ return keyedRow.apply(ParDo.of(new LimitFn<T>(getCount(), startIndex)));
}
}
private static class LimitFn<T> extends DoFn<KV<String, T>, T> {
private final Integer limitCount;
+ private final Integer startIndex;
- public LimitFn(int c) {
+ public LimitFn(int c, int s) {
limitCount = c;
+ startIndex = s;
}
@StateId("counter")
private final StateSpec<ValueState<Integer>> counterState =
StateSpecs.value(VarIntCoder.of());
+ @StateId("skipped_rows")
+ private final StateSpec<ValueState<Integer>> skippedRowsState =
Review comment:
I don't think there is. That is a good feature! It would have to be
serialized w/ the coder for graph submission. Totally doable. Maybe good
starter task.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 226481)
Time Spent: 40m (was: 0.5h)
> Support LIMIT OFFSET
> --------------------
>
> Key: BEAM-7051
> URL: https://issues.apache.org/jira/browse/BEAM-7051
> Project: Beam
> Issue Type: Bug
> Components: dsl-sql
> Reporter: Rui Wang
> Assignee: Rui Wang
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)