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

should control sortmode be file-level or global? #55

Open
xxchan opened this issue Jun 30, 2022 · 10 comments
Open

should control sortmode be file-level or global? #55

xxchan opened this issue Jun 30, 2022 · 10 comments
Labels
A-include related to the behavior of include

Comments

@xxchan
Copy link
Member

xxchan commented Jun 30, 2022

One more thing. Do you feel set VARIABLE in sqllogictest is a file-level or statement or a statement affecting global state? Now it's implemented as latter, so if someone do:

include a.slt
include b.slt

If a.slt sets a row sort mode, b.slt will also be affected. If you feel this is counter-intuitive, maybe we can change the behavior of sqllogictest.

Originally posted by @skyzh in risingwavelabs/risingwave#3582 (comment)

@wangrunji0408
Copy link
Member

+1 for file-level

@xxchan
Copy link
Member Author

xxchan commented Jul 1, 2022

btw, this includes slt's internal config (control sortmode), and DB session's config (SET xxx) 🤔

It may be confusing if we only let one of them file-level. But the latter one seems tricky if we want to let include inherit from parent file, but isolated from other include. We cannot inherit session..?

control sortmode rowsort
SET RW_IMPLICIT_FLUSH TO false;

include a.slt
# have these inside
# control sortmode nosort
# SET RW_IMPLICIT_FLUSH TO true;

include b.slt

@xxchan
Copy link
Member Author

xxchan commented Jul 1, 2022

Actually include by design propagates side-effect (for CREATE, INSERT). So if the user forgets to clean up (DELETE) in a.slt, they will also have problem in b.slt. But this isn't a problem since CREATE in b.slt will have error and reminds the user.

For variable side-effects, it's more error-prone.

@skyzh
Copy link
Member

skyzh commented Jul 2, 2022

We can only allow control statements in top-level files 😋

@skyzh
Copy link
Member

skyzh commented Jul 2, 2022

I remembered that LaTeX have both \input and \include macros. I think the include is more like \input 🤣

@skyzh
Copy link
Member

skyzh commented Jul 2, 2022

And test cases should be as short as possible. I believe current RisingWave’s batch test is a bad example. Include should be used to include things in common, instead of including new test cases. This is where the confusion originates: each test case share a different session level setting. By the way, parallelism is exploited on file level, which means that sqllogictest cannot parallelize RisingWave’s batch test.

@xxchan
Copy link
Member Author

xxchan commented Jul 2, 2022

We can have a style suggestion document first 🥸

@xxchan
Copy link
Member Author

xxchan commented Aug 15, 2022

When file-level behavior is expected, I guess a different semantics for include (described here risingwavelabs/risingwave#3629 (comment)) is actually expected.

@BugenZhao
Copy link
Collaborator

We may treat the root file with its inclusions as a single session, and make the control session-level, which will be consistent with the database's session configurations if we use different sessions per-file.

@xxchan
Copy link
Member Author

xxchan commented Aug 19, 2022

We may treat the root file with its inclusions as a single session, and make the control session-level, which will be consistent with the database's session configurations if we use different sessions per-file.

Isn't this already the current behavior? (... for parallel mode -j1)

@xxchan xxchan added the A-include related to the behavior of include label Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-include related to the behavior of include
Projects
None yet
Development

No branches or pull requests

4 participants