Skip to content

[Proposal]: Add offset method to DataFrame #1789

@norberttech

Description

@norberttech

Describe the Proposal

We already have limit method handled by src/core/etl/src/Flow/ETL/Transformer/LimitTransformer.php.

Offset is equally beneficial allowing to skip certain amount of rows.

API Adjustments

Limit is implemented through transformer that throws limit exception when limit is reach so src/core/etl/src/Flow/ETL/Pipeline/SynchronousPipeline.php can tell extractor to stop extraction.

Offset should be implemented as src/core/etl/src/Flow/ETL/Pipeline.php, similarly to how src/core/etl/src/Flow/ETL/Pipeline/BatchingPipeline.php is implemented.

We want to keep skipping rows until we reach the offset.
Similarly to how SQL works.

When $offset is null, nothing should happen.

/**
 * @param ?int<0, max> $offset
 **/ 
DataFrame::offset(?int $offset) : self

Are you intenting to also work on proposed change?

Yes

Are you interested in sponsoring this change?

None

Integration & Dependencies

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions