Skip to content

Conversation

@dahbka-lis
Copy link
Member

Changelog entry

...

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

...

Проблема в следующем.

Есть запрос:

```sql
CREATE TABLE series_with_families (
  series_id Uint64,
  title Utf8,
  series_info Utf8  NOT NULL FAMILY family_large,
  release_date Uint64,
  PRIMARY KEY (series_id),
  FAMILY default (
    DATA = "ssd",
    COMPRESSION = "off"
  ),
  FAMILY family_large (
    DATA = "rot",
    COMPRESSION = "lz4"
  )
);
```

Такой запрос является на данный момент неверным на уровне грамматики. Ругается на строку \``series_info Utf8  NOT NULL FAMILY family_large`\` Однако запрос, в котором NOT NULL и FAMILY поменяны местами, отрабатывает корректно:

```sql
CREATE TABLE series_with_families (
  series_id Uint64,
  title Utf8,
  series_info Utf8 FAMILY family_large NOT NULL,
  release_date Uint64,
  PRIMARY KEY (series_id),
  FAMILY default (
    DATA = "ssd",
    COMPRESSION = "off"
  ),
  FAMILY family_large (
    DATA = "rot",
    COMPRESSION = "lz4"
  )
);
```

В этом Pull Request'е  я меняю грамматику таким образом, чтобы была возможность задавать "опции" колонки (DEFAULT, NOT NULL, FAMILY).

Особое внимание стоит обратить внимание на тест `CreateTableDefaultAndNotNullInOrderSpace`: в нем показывается, что можно использовать синтаксис

```sql
CREATE TABLE tbl (
    k Uint64,
    v Bool DEFAULT false NOT NULL,
    PRIMARY KEY (k)
);
```

И такое поведение означает именно DEFAULT (false NOT NULL), то есть DEFAULT true. Дело в том, что выражение "false NOT NULL" эквивалентно "false IS NOT NULL", что является, безусловно, истиной. Ровно для того, чтобы была вообще возможность одновременно указать и default, и not null, было добавлено расширение синтаксиса: теперь можно указывать скобки для указания опций столбца, а сами опции внутри них можно перечислять через запятую:

```sql
CREATE TABLE tbl (
    k Uint64,
    v Bool (DEFAULT false, NOT NULL),
    PRIMARY KEY (k)
);
```

Запрос выше означает, что столбец должен по умолчанию заполняться false'ами, но при этом он должен быть NOT NULL.
commit_hash:67cc27a5fe6ae73f8725b051b232c2ca0d1ec54f
@dahbka-lis dahbka-lis requested a review from a team as a code owner December 4, 2025 15:08
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

🟢 2025-12-04 15:09:43 UTC The validation of the Pull Request description is successful.

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

2025-12-04 15:10:55 UTC Pre-commit check linux-x86_64-relwithdebinfo for 64c1a81 has started.
2025-12-04 15:11:32 UTC Artifacts will be uploaded here
2025-12-04 15:15:47 UTC ya make is running...
🟡 2025-12-04 16:49:52 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
38718 36040 0 8 2651 19

2025-12-04 16:53:03 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-12-04 17:07:33 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
791 (only retried tests) 773 0 3 0 15

2025-12-04 17:37:58 UTC ya make is running... (failed tests rerun, try 3)
🔴 2025-12-04 17:54:19 UTC Some tests failed, follow the links below.

Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
540 (only retried tests) 524 0 3 0 13

🟢 2025-12-04 17:54:28 UTC Build successful.
🟡 2025-12-04 17:54:47 UTC ydbd size 2.3 GiB changed* by +440.1 KiB, which is >= 100.0 KiB vs stable-25-3-1: Warning

ydbd size dash stable-25-3-1: 0a4b372 merge: 64c1a81 diff diff %
ydbd size 2 437 102 784 Bytes 2 437 553 400 Bytes +440.1 KiB +0.018%
ydbd stripped size 521 877 736 Bytes 522 013 384 Bytes +132.5 KiB +0.026%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

2025-12-04 15:11:03 UTC Pre-commit check linux-x86_64-release-asan for 64c1a81 has started.
2025-12-04 15:11:18 UTC Artifacts will be uploaded here
2025-12-04 15:15:03 UTC ya make is running...
🟡 2025-12-04 17:25:50 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16012 15488 0 191 319 14

🟢 2025-12-04 17:27:04 UTC Build successful.
🟡 2025-12-04 17:27:28 UTC ydbd size 3.8 GiB changed* by +826.8 KiB, which is >= 100.0 KiB vs stable-25-3-1: Warning

ydbd size dash stable-25-3-1: 0a4b372 merge: 64c1a81 diff diff %
ydbd size 4 055 129 112 Bytes 4 055 975 736 Bytes +826.8 KiB +0.021%
ydbd stripped size 1 511 174 976 Bytes 1 511 540 832 Bytes +357.3 KiB +0.024%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@dahbka-lis dahbka-lis added the rebase-and-check Rebase PR with the current base branch and check label Dec 4, 2025
@github-actions github-actions bot removed the rebase-and-check Rebase PR with the current base branch and check label Dec 4, 2025
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

2025-12-04 18:28:02 UTC Pre-commit check linux-x86_64-release-asan for 64c1a81 has started.
2025-12-04 18:29:48 UTC Artifacts will be uploaded here
2025-12-04 18:34:02 UTC ya make is running...
🟡 2025-12-04 20:37:11 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16012 15594 0 150 252 16

🟢 2025-12-04 20:38:27 UTC Build successful.
🟡 2025-12-04 20:38:57 UTC ydbd size 3.8 GiB changed* by +826.8 KiB, which is >= 100.0 KiB vs stable-25-3-1: Warning

ydbd size dash stable-25-3-1: 0a4b372 merge: 64c1a81 diff diff %
ydbd size 4 055 129 112 Bytes 4 055 975 736 Bytes +826.8 KiB +0.021%
ydbd stripped size 1 511 174 976 Bytes 1 511 540 832 Bytes +357.3 KiB +0.024%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

2025-12-04 18:31:54 UTC Pre-commit check linux-x86_64-relwithdebinfo for 64c1a81 has started.
2025-12-04 18:32:09 UTC Artifacts will be uploaded here
2025-12-04 18:35:57 UTC ya make is running...
🟡 2025-12-04 20:05:04 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
38718 36044 0 8 2650 16

2025-12-04 20:08:07 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-12-04 20:28:51 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
578 (only retried tests) 557 0 2 1 18

2025-12-04 20:29:00 UTC ya make is running... (failed tests rerun, try 3)
🟢 2025-12-04 20:42:43 UTC Tests successful.

Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
534 (only retried tests) 522 0 0 0 12

🟢 2025-12-04 20:42:55 UTC Build successful.
🟡 2025-12-04 20:43:11 UTC ydbd size 2.3 GiB changed* by +440.1 KiB, which is >= 100.0 KiB vs stable-25-3-1: Warning

ydbd size dash stable-25-3-1: 0a4b372 merge: 64c1a81 diff diff %
ydbd size 2 437 102 784 Bytes 2 437 553 400 Bytes +440.1 KiB +0.018%
ydbd stripped size 521 877 736 Bytes 522 013 384 Bytes +132.5 KiB +0.026%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

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

Successfully merging this pull request may close these issues.

1 participant