lightdash / lightdash

Self-serve BI to 10x your data team ⚡️
https://lightdash.com
MIT License
4.04k stars 431 forks source link

Query builder should not join tables from empty filters #12656

Open ZeRego opened 4 days ago

ZeRego commented 4 days ago

Description

Query builder adds unnecessary joins and filters to the SQL. This can cause unexpected results depending on the join type "inner/outer".

Steps to Reproduce the Bug or Issue

  1. create query from explore with joined table
  2. select dimension from base table
  3. add filter for joined table string dimension but leave the value empty

Expect: SQL query does not include join or empty filter

Current: SQL query includes join and 1=1 filter

version

No response

Cloud or self-hosting

cloud

lightdash-bot commented 4 days ago

This issue was mentioned by a user in slack: https://lightdash.slack.com/archives/C04T5L766EM/p1732870802367999?thread_ts=1732870802.367999&cid=C04T5L766EM