-
Notifications
You must be signed in to change notification settings - Fork 333
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
refactor: validate constraints eagerly #3472
Conversation
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3472 +/- ##
==========================================
- Coverage 85.35% 84.93% -0.43%
==========================================
Files 903 903
Lines 149639 149637 -2
==========================================
- Hits 127726 127092 -634
- Misses 21913 22545 +632 |
Signed-off-by: tison <[email protected]>
Can you add a case for #3471 in sqlness test? |
@MichaelScofield This doesn't fix #3471. Just a front code refactor. Do you suggest we anyway add a case to indicate the current LTA manner described in #3471? |
What's the meaning of "LTA"? I mean to add a case in sqlness test that if inputting CREATE TABLE IF NOT EXIST t(`Hits` STRING NULL, ts TIMESTAMP(3) NOT NULL, TIME INDEX ("ts")); , the db returns msg indicating it's the "IF NOT EXIST" syntax error instead of "ERROR 1815 (HY000): Missing time index constraint". |
Less than awesome; but not a bug.
No. This patch doesn't fix #3471. It's a code refactor that possibly makes fixing #3471 easier. See #3471 (comment) for an explain. |
After this PR, what's the error msg if user inputs "create table foo if not exist ..."? |
public=> create table if not exists t(ts timestamp time index);
OK 0
public=> create table if not exist t(ts timestamp time index);
ERROR: Missing time index constraint
public=> |
This error message looks more confusing... Can we avoid it? |
This is what #3471 tracked and what I'd try to resolve later. Please read the background. I have explained this purpose many times here 🤣 |
Signed-off-by: tison <[email protected]>
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your intention?
TRIVIAL AS IS.
Previously, we can check time index constraint for CREATE EXTERNAL TABLE on parsing (but we do on execution).
Now we check constraints once the condition value are finalized.
Checklist