Commit af767e8
committed
fix(clickhouse): combine physical_properties into one SETTINGS clause
When a ClickHouse model declared more than one physical_property,
_build_table_properties_exp produced a separate exp.SettingsProperty
per key, which sqlglot renders as repeated 'SETTINGS k = v' keywords.
ClickHouse rejects that with a syntax error at execution time.
Refactor _build_settings_property to take the full settings mapping
and emit a single SettingsProperty with one EQ expression per entry,
yielding the expected 'SETTINGS k1 = v1, k2 = v2' form. The same fix
applies to view properties, which used the identical pattern.
Update the existing assertion that pinned the broken output, add a
three-entry regression test mirroring the issue reporter's model, and
cover the view-properties path that was silently affected.
Fixes #5803
Signed-off-by: mokashang <shangmengjiajiajia@gmail.com>1 parent 9d2ecea commit af767e8
2 files changed
Lines changed: 42 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
719 | | - | |
| 719 | + | |
720 | 720 | | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
721 | 725 | | |
722 | 726 | | |
723 | 727 | | |
| |||
726 | 730 | | |
727 | 731 | | |
728 | 732 | | |
| 733 | + | |
729 | 734 | | |
730 | 735 | | |
731 | 736 | | |
| |||
827 | 832 | | |
828 | 833 | | |
829 | 834 | | |
830 | | - | |
831 | | - | |
832 | | - | |
| 835 | + | |
833 | 836 | | |
834 | 837 | | |
835 | 838 | | |
| |||
858 | 861 | | |
859 | 862 | | |
860 | 863 | | |
861 | | - | |
862 | | - | |
863 | | - | |
| 864 | + | |
864 | 865 | | |
865 | 866 | | |
866 | 867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
319 | 322 | | |
320 | 323 | | |
321 | 324 | | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
325 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
326 | 345 | | |
327 | 346 | | |
328 | 347 | | |
| |||
345 | 364 | | |
346 | 365 | | |
347 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
348 | 381 | | |
349 | 382 | | |
350 | 383 | | |
| |||
0 commit comments