-
Notifications
You must be signed in to change notification settings - Fork 328
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
feat(fuzz): add create logical table target #3756
feat(fuzz): add create logical table target #3756
Conversation
We can start by mocking the usage of GreptimeDB as Prometheu's backend(https://docs.greptime.com/user-guide/write-data/prometheus) We always create two physical table with two columns: a timestamp(millisecond, datatypes) column and a value(double) column. The datatype is following the Prometheus document). i.e., CREATE TABLE phy (ts timestamp time index, val double) engine=metric with ("physical_metric_table" = ""); Then we will get a physical table. select column_name, data_type, semantic_type from information_schema.columns where table_name = 'phy';
+-------------+--------------+---------------+
| column_name | data_type | semantic_type |
+-------------+--------------+---------------+
| ts | timestamp(3) | TIMESTAMP |
| val | double | FIELD |
+-------------+--------------+---------------+ Then, the fuzz target randomly creates many logical tables and validates the datatypes of the logical and physical table. e.g.,
Validating the datatypes of the physical table. select column_name, data_type, semantic_type, column_default from information_schema.columns where table_name = 'phy';
+-------------+-----------------+---------------+----------------+
| column_name | data_type | semantic_type | column_default |
+-------------+-----------------+---------------+----------------+
| ts | timestamp(3) | FIELD | NULL |
| val | double | FIELD | NULL |
| __table_id | int unsigned | TAG | NULL |
| __tsid | bigint unsigned | TAG | NULL |
| host | string | TAG | NULL |
| idc | string | TAG | NULL |
+-------------+-----------------+---------------+----------------+ Validating the datatypes of the logical table. select column_name, data_type, semantic_type, column_default from information_schema.columns where table_name = 't2';
+-------------+--------------+---------------+----------------+
| column_name | data_type | semantic_type | column_default |
+-------------+--------------+---------------+----------------+
| host | string | TAG | NULL |
| idc | string | TAG | NULL |
| ts | timestamp(3) | TIMESTAMP | NULL |
| val | double | FIELD | NULL |
+-------------+--------------+---------------+----------------+ |
BTW, there is the bug. The semantic_type in the 1st row should be
|
b5652b3
to
56ac926
Compare
598f109
to
ead6ff2
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3756 +/- ##
==========================================
- Coverage 85.53% 85.32% -0.22%
==========================================
Files 946 953 +7
Lines 159564 163046 +3482
==========================================
+ Hits 136489 139120 +2631
- Misses 23075 23926 +851 |
The tests of #3772 may help you to build the fuzz test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
#3741 and #3174
What's changed and what's your intention?
Fuzz test for metric engine. Create some logical tables on the same physical table.
Checklist