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

KSqlDB Session Variables support to enable parametric artefacts #545

Closed
nachomdo opened this issue Oct 4, 2022 · 0 comments
Closed

KSqlDB Session Variables support to enable parametric artefacts #545

nachomdo opened this issue Oct 4, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@nachomdo
Copy link
Contributor

nachomdo commented Oct 4, 2022

Is your feature request related to a problem? Please describe.
KSqlDB added support for session variables on version 0.18 to make it easier to parameterise queries. More information about variables interpolation can be found here

Describe the solution you'd like
A potential solution would be to add an entry to the descriptor file to specify those variables as shown below:

projects:
  - name: "foo"
    ksql:
      artefacts:
        vars:
          partitions: 1
          format: JSON
        streams:
          - path: "ksql/riderlocations.sql"
            name: "riderLocations"

Describe alternatives you've considered

Another alternative would be to specify these variables as a CLI argument (e.g. ksql-migrations tool follow this approach using a --define flag). Also, we can define session vars per each artefact, however, this could end up being too verbose and repetitive even though it could be mitigated with YAML references syntax.

 ksql:
      artefacts:
        streams:
          - path: "ksql/riderlocations.sql"
            name: "riderLocations"
            vars:
               partitions: 1
               format: JSON
          - path: "ksql/orders.sql"
            name: "ordersStream"
            vars:
                partitions: 1
                format: JSON
@nachomdo nachomdo added the enhancement New feature or request label Oct 4, 2022
@purbon purbon closed this as completed Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants