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

Add setting of stream properties support #39

Closed
jurieotto opened this issue Sep 22, 2018 · 3 comments
Closed

Add setting of stream properties support #39

jurieotto opened this issue Sep 22, 2018 · 3 comments

Comments

@jurieotto
Copy link
Contributor

For example it is not possible to run the KSQL query:
SELECT * FROM pageviews;
with the properties:
SET 'auto.offset.reset' = 'earliest';

In this example, allowing the configuration of the 'auto.offset.reset' property, allows for queries from the start of the data and not just from the current data position.

The KSQL JSON format does support the setting of the stream properties and can be set as follows:

POST /query HTTP/1.1
Accept: application/vnd.ksql.v1+json
Content-Type: application/vnd.ksql.v1+json

{
  "ksql": "SELECT * FROM pageviews;",
  "streamsProperties": {
    "ksql.streams.auto.offset.reset": "earliest"
  }
}

I propose the following interface for this feature:
client.query("SELECT * FROM pageviews;", streams_properties={'auto.offset.reset': 'earliest'})

I am busy working on this feature, because it is quite useful for me.

@jurieotto jurieotto changed the title The ksql queries cannot supply stream properties Add setting of stream properties support Sep 22, 2018
@jurieotto
Copy link
Contributor Author

jurieotto commented Oct 3, 2018

I have closed my pull request for this implementation, because I see this pull request also contains an implementation for this feature.

@bryanyang0528
Copy link
Owner

Because #31 is merged, I will close this issue.

@kaiwaehner
Copy link
Contributor

Seems like this feature is implemented. But how do you use it?

The following does not work:

client.query("SELECT * FROM pageviews;", streams_properties={'auto.offset.reset': 'earliest'})

Can you please add the right syntax to the readme?

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

No branches or pull requests

3 participants