-
Notifications
You must be signed in to change notification settings - Fork 88
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
Local results and perf comparisons for queries #6206
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
3d18cc9
to
e93971e
Compare
"params": { | ||
"shas": "String" | ||
}, | ||
"tests": [] |
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.
We will probably need a linter for this later to enforce this structure I guess, maybe put up a warning about having no test case
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.
Added a simple linter for the structure but it doesn't check much more than that. No warnings for test cases yet
for i, test in enumerate(tests): | ||
new_results = query_clickhouse(query, test) | ||
base_results = query_clickhouse(base_query, test) | ||
if new_results != base_results: |
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.
This comparison might be brittle if the results returned by the query is not sorted. But I think we could keep it simple with the current implementation.
A more complex approach would be to provide an option to compare the results in strict mode (same order) and relax mode (in any order)
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.
Weirdly, a lot of clickhouse results are ordered, probably because the table themselves have orderings.
Added an arg to sort the results when comparing
print(table) | ||
|
||
|
||
def results_compare(args: argparse.Namespace) -> None: |
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.
For the comparison, an edge case might be when adding a new query or, in rarer case, to delete one.
e93971e
to
bcddc84
Compare
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.
Awesome! This is a solid foundation for future improvements of CH queries
0fb6559
to
e367365
Compare
Second commit onwards are the actual changes. The first commit just changes all the formatting for the existing files.
This changes the formatting of the params.json file to allow for example inputs for the queries that can be used to compare results and performance to be used in the script mentioned below. The new format can be seen in the README.
This also adds a script to get compare time and memory a query uses between local and a specific commit. It can also compare what the query returns.