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

SET 'execution.runtime-mode' runs on every statement #62

Open
zqWu opened this issue Mar 23, 2023 · 2 comments
Open

SET 'execution.runtime-mode' runs on every statement #62

zqWu opened this issue Mar 23, 2023 · 2 comments

Comments

@zqWu
Copy link
Contributor

zqWu commented Mar 23, 2023

for example

{{ config( 
    materialized='table',
    pre_hook=[
        "SET 'execution.runtime-mode' = 'streaming';",
        "set 'execution.checkpointing.interval'='20s';",
        "set 'execution.checkpointing.mode'='AT_LEAST_ONCE';"
    ]
  ) 
}}

select * from {{ source('my_source', 'topic01') }}

this will be translated into

SET 'execution.runtime-mode' = 'batch'
SET 'execution.runtime-mode' = 'streaming';
SET 'execution.runtime-mode' = 'batch'
set 'execution.checkpointing.interval'='20s';
SET 'execution.runtime-mode' = 'batch'
set 'execution.checkpointing.mode'='AT_LEAST_ONCE';
SET 'execution.runtime-mode' = 'batch'
create  table xxxx_balabala

2 ways to handle this:

  1. when see "set xx=yy" , do not automatic add another " SET 'execution.runtime-mode' ='batch'"

    this will not help when many model, like model-1 is batch, and model-2 is streaming
    when run create mode1-1, it will set to batch
    then run create model-2, it will not guarante current mode is streaming

  2. simply leave mode to user control
    eg, in model's config, pre_hook = "set xx=xx"
    i prefer this solution, it leaves all things transparent, despite somehow inconvenient

@gliter
Copy link
Collaborator

gliter commented Mar 23, 2023

Ad 1. That definitely be an improvment. It could be even made to set it only when executing the main statatmenet

I would add approach 3. to allow pipeline configuration to be defined in yaml as well.

@zqWu
Copy link
Contributor Author

zqWu commented Mar 24, 2023

great, explicit yet convienient

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

2 participants