-
Notifications
You must be signed in to change notification settings - Fork 0
Debug: GROUP BY ordering trace #158
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -720,6 +720,18 @@ class VectorizedGroupByOperator : public VectorizedOperator { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [this](size_t a, size_t b) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return hash_group_keys_[a] < hash_group_keys_[b]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fprintf(stderr, "DEBUG: VectorizedGroupBy sorted %zu groups\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hash_group_keys_.size()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (size_t i = 0; i < sorted_indices_.size() && i < 5; ++i) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fprintf(stderr, "DEBUG: sorted_indices_[%zu]=%zu key=", i, sorted_indices_[i]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const auto& key = hash_group_keys_[sorted_indices_[i]]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (const auto& k : key) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fprintf(stderr, "%s ", k.to_string().c_str()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fprintf(stderr, "\n"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fprintf(stderr, "DEBUG: VectorizedGroupBy hash_group_keys_ is empty\n"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+723
to
735
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard and sanitize this debug logging before merge. This path now emits raw group-key values to Suggested change- fprintf(stderr, "DEBUG: VectorizedGroupBy sorted %zu groups\n",
- hash_group_keys_.size());
- for (size_t i = 0; i < sorted_indices_.size() && i < 5; ++i) {
- fprintf(stderr, "DEBUG: sorted_indices_[%zu]=%zu key=", i, sorted_indices_[i]);
- const auto& key = hash_group_keys_[sorted_indices_[i]];
- for (const auto& k : key) {
- fprintf(stderr, "%s ", k.to_string().c_str());
- }
- fprintf(stderr, "\n");
- }
+#ifdef CLOUDSQL_DEBUG_GROUPBY
+ std::fprintf(stderr, "DEBUG: VectorizedGroupBy sorted %zu groups\n",
+ hash_group_keys_.size());
+ for (size_t i = 0; i < sorted_indices_.size() && i < 5; ++i) {
+ std::fprintf(stderr, "DEBUG: sorted_indices_[%zu]=%zu key=", i,
+ sorted_indices_[i]);
+ const auto& key = hash_group_keys_[sorted_indices_[i]];
+ for (const auto& k : key) {
+ // Consider redacting or truncating values if they may contain sensitive data.
+ std::fprintf(stderr, "%s ", k.to_string().c_str());
+ }
+ std::fprintf(stderr, "\n");
+ }
+#endif📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: poyrazK/cloudSQL
Length of output: 890
Add the proper C stdio header for
fprintf/stderr.include/executor/vectorized_operator.hppusesfprintf(stderr, ...)in theVectorizedGroupBydebug path (lines 723-734) but does not include<cstdio>(or<stdio.h>), so relying on transitive includes is non-portable—add#include <cstdio>and (optionally) usestd::fprintf.🤖 Prompt for AI Agents