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

chore: add extra bracket for and and or to make explain clear #16494

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

xudong963
Copy link
Member

@xudong963 xudong963 commented Sep 23, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 23, 2024
@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Sep 23, 2024
@dosubot dosubot bot added the A-query Area: databend query label Sep 23, 2024
@BohuTANG
Copy link
Member

Some tests still need to fix the format.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 23, 2024
@andylokandy
Copy link
Collaborator

What bug does this fix? maybe add a test.

@xudong963 xudong963 changed the title fix: add extra bracket for and or chore: add extra bracket for and and or to make explain clear Sep 23, 2024
@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Sep 23, 2024
@xudong963
Copy link
Member Author

What bug does this fix? maybe add a test.

In fact, there is no bug, and has a higher priority than or (I changed the title).

By adding () can make explain clearer.

@ZhiHanZ
Copy link
Collaborator

ZhiHanZ commented Sep 24, 2024

Hi @xudong963
Could you add the following logic tests on https://github.com/datafuselabs/databend/blob/main/tests/sqllogictests/suites/task/task_dag_test.test for this PR.

statement ok
DROP TASK IF EXISTS mytaskchild2

statement ok 
CREATE TASK mytaskchild2
  WAREHOUSE = 'mywh'
  AFTER 'mytaskroot'
  WHEN ((SYSTEM$STREAM_HAS_DATA('stream1') AND SYSTEM$STREAM_HAS_DATA('stream2')) OR (SYSTEM$STREAM_HAS_DATA('stream3') AND SYSTEM$STREAM_HAS_DATA('stream4'))) AND SYSTEM$STREAM_HAS_DATA('stream5')
  AS SELECT 1;



query SSSS
select name, warehouse, schedule, definition, condition_text, after from system.tasks where name = 'mytaskchild2'
----
mytaskchild2 mywh NULL SELECT 1 ((SYSTEM$STREAM_HAS_DATA('stream1') AND SYSTEM$STREAM_HAS_DATA('stream2')) OR (SYSTEM$STREAM_HAS_DATA('stream3') AND SYSTEM$STREAM_HAS_DATA('stream4'))) AND SYSTEM$STREAM_HAS_DATA('stream5') mytaskroot

@xudong963 xudong963 added this pull request to the merge queue Sep 24, 2024
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Sep 24, 2024
@BohuTANG BohuTANG merged commit 7cd13ba into databendlabs:main Sep 24, 2024
71 checks passed
@xudong963 xudong963 deleted the fix_1 branch September 24, 2024 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query Area: databend query lgtm This PR has been approved by a maintainer pr-bugfix this PR patches a bug in codebase pr-chore this PR only has small changes that no need to record, like coding styles. size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants