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

Allow to pass step length in Loki connector. #24862

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeschkies
Copy link
Member

@jeschkies jeschkies commented Jan 31, 2025

Description

The Loki API allows to pass the step length in seconds. This change updates the client and adds an optional STEP parameter to the query range table function.

This allows us to simplify the integration test as well.

Fixes #24861

Release notes

## Loki
* Add `step` parameter to `query_range` function. (#24861)

@cla-bot cla-bot bot added the cla-signed label Jan 31, 2025
@github-actions github-actions bot added the loki Loki connector label Jan 31, 2025
@@ -56,7 +56,7 @@
<dependency>
<groupId>io.github.jeschkies</groupId>
<artifactId>loki-client</artifactId>
<version>0.0.2</version>
<version>0.0.3</version>
Copy link
Member

Choose a reason for hiding this comment

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

Separate a commit.

@@ -22,7 +22,7 @@

import static java.util.Objects.requireNonNull;

public record LokiTableHandle(String query, Instant start, Instant end, List<ColumnHandle> columnHandles)
public record LokiTableHandle(String query, Instant start, Instant end, Long step, List<ColumnHandle> columnHandles)
Copy link
Member

Choose a reason for hiding this comment

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

Change Long to int.

Comment on lines +98 to +101
Long step = (Long) ((ScalarArgument) arguments.get("STEP")).getValue();
if (step == null) {
step = 0L;
}
Copy link
Member

Choose a reason for hiding this comment

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

What happens if we specify a negative value in step argument? Please add a test.

@ebyhr
Copy link
Member

ebyhr commented Jan 31, 2025

"Allow to pass step length in Loki connector."

https://trino.io/development/process.html#pull-request-and-commit-guidelines-

Do not end the subject line with a period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed loki Loki connector
Development

Successfully merging this pull request may close these issues.

The step query parameter should be configurable. This requires a change in the Loki java client first.
2 participants