-
Notifications
You must be signed in to change notification settings - Fork 422
Support NullEQ join keys #11052
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
base: master
Are you sure you want to change the base?
Support NullEQ join keys #11052
Changes from all commits
de5cd10
c216966
278ba0c
6f41df3
10c7c69
1eddaf3
3397194
23c4cd6
a470446
48ce862
0a013bd
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 |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ class JoinBinder : public ExecutorBinder | |
| const DAGSchema & output_schema_, | ||
| tipb::JoinType tp_, | ||
| const ASTs & join_cols_, | ||
| const std::vector<UInt8> & is_null_eq_, | ||
| const ASTs & l_conds, | ||
| const ASTs & r_conds, | ||
| const ASTs & o_conds, | ||
|
|
@@ -39,6 +40,7 @@ class JoinBinder : public ExecutorBinder | |
| : ExecutorBinder(index_, "Join_" + std::to_string(index_), output_schema_) | ||
| , tp(tp_) | ||
| , join_cols(join_cols_) | ||
| , is_null_eq(is_null_eq_) | ||
| , left_conds(l_conds) | ||
| , right_conds(r_conds) | ||
| , other_conds(o_conds) | ||
|
|
@@ -77,6 +79,7 @@ class JoinBinder : public ExecutorBinder | |
| tipb::JoinType tp; | ||
|
|
||
| const ASTs join_cols{}; | ||
| const std::vector<UInt8> is_null_eq{}; | ||
| const ASTs left_conds{}; | ||
| const ASTs right_conds{}; | ||
| const ASTs other_conds{}; | ||
|
|
@@ -93,6 +96,7 @@ ExecutorBinderPtr compileJoin( | |
| ExecutorBinderPtr right, | ||
| tipb::JoinType tp, | ||
| const ASTs & join_cols, | ||
| const std::vector<UInt8> & is_null_eq = {}, | ||
|
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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
ast-grep outline dbms/src/Debug/MockExecutor/JoinBinder.h --items all --type function --match compileJoin
rg -n -C 4 --glob '*.{cpp,h,hpp}' '\bcompileJoin\s*\(' dbmsRepository: pingcap/tiflash Length of output: 5478 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- JoinBinder.h declaration ---'
sed -n '92,112p' dbms/src/Debug/MockExecutor/JoinBinder.h
printf '%s\n' '--- JoinBinder.cpp definition ---'
sed -n '341,383p' dbms/src/Debug/MockExecutor/JoinBinder.cpp
printf '%s\n' '--- compileJoin call sites ---'
rg -n -U -C 8 --glob '*.{cpp,h,hpp}' 'compileJoin\s*\(' dbms/src
printf '%s\n' '--- relevant diff ---'
git diff -- dbms/src/Debug/MockExecutor/JoinBinder.h dbms/src/Debug/MockExecutor/JoinBinder.cppRepository: pingcap/tiflash Length of output: 11938 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- current revision ---'
git rev-parse HEAD
printf '%s\n' '--- recent file history ---'
git log --oneline -8 -- dbms/src/Debug/MockExecutor/JoinBinder.h dbms/src/Debug/MockExecutor/JoinBinder.cpp
printf '%s\n' '--- parent declaration ---'
git show HEAD^:dbms/src/Debug/MockExecutor/JoinBinder.h | sed -n '88,110p'
printf '%s\n' '--- parent definition ---'
git show HEAD^:dbms/src/Debug/MockExecutor/JoinBinder.cpp | sed -n '338,374p'
printf '%s\n' '--- TestUtils API and call ---'
sed -n '300,355p' dbms/src/TestUtils/mockExecutor.cpp
rg -n -C 5 'MockExecutorBuilder::.*Join|is_null_eq|compileJoin' dbms/src/TestUtils/mockExecutor.cpp dbms/src/TestUtilsRepository: pingcap/tiflash Length of output: 8953 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
commit=365b845c9
file_h=dbms/src/Debug/MockExecutor/JoinBinder.h
file_cpp=dbms/src/Debug/MockExecutor/JoinBinder.cpp
printf '%s\n' '--- null-eq commit summary ---'
git show --stat --oneline "$commit"
printf '%s\n' '--- null-eq commit changes ---'
git show --format= --unified=12 "$commit" -- "$file_h" "$file_cpp" dbms/src/TestUtils/mockExecutor.h dbms/src/TestUtils/mockExecutor.cpp
printf '%s\n' '--- predecessor declaration ---'
git show "$commit^:$file_h" | sed -n '88,110p'
printf '%s\n' '--- predecessor compileJoin calls ---'
git grep -n -C 5 'compileJoin' "$commit^" -- 'dbms/src/**/*.{cpp,h,hpp}' 'dbms/src/*.cpp' 'dbms/src/*.h' || true
printf '%s\n' '--- ASTs definition ---'
rg -n -C 3 'using ASTs|typedef .*ASTs' dbms/srcRepository: pingcap/tiflash Length of output: 20550 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
python3 - <<'PY'
import re
import subprocess
header = "dbms/src/Debug/MockExecutor/JoinBinder.h"
commit = "365b845c9"
current = open(header, encoding="utf-8").read()
previous = subprocess.check_output(
["git", "show", f"{commit}^:{header}"], text=True
)
def compile_join_params(text):
match = re.search(
r"ExecutorBinderPtr\s+compileJoin\s*\((.*?)\);",
text,
re.S,
)
assert match, "compileJoin declaration not found"
return [
re.sub(r"\s+", " ", line.strip())
for line in match.group(1).splitlines()
if line.strip()
]
old_params = compile_join_params(previous)
new_params = compile_join_params(current)
assert "const ASTs & left_conds" in old_params[5]
assert "const std::vector<UInt8> & is_null_eq" in new_params[5]
assert "const ASTs & left_conds" in new_params[6]
# The old positional call supplies an ASTs value as argument six.
assert "ASTs" in old_params[5]
assert "std::vector<UInt8>" in new_params[5]
assert "ASTs" in open("dbms/src/Parsers/IAST_fwd.h", encoding="utf-8").read()
print("old sixth parameter: ", old_params[5])
print("new sixth parameter: ", new_params[5])
print("new seventh parameter:", new_params[6])
print("ASTs is a distinct vector type; old positional argument six no longer matches.")
PYRepository: pingcap/tiflash Length of output: 403 Restore positional compatibility for
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| const ASTs & left_conds = {}, | ||
| const ASTs & right_conds = {}, | ||
| const ASTs & other_conds = {}, | ||
|
|
||
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use runtime validation for
is_null_eq.Line 205 is removed in release builds. A mismatched flag vector can then serialize an invalid join request and fail only during later request processing. Replace
assertwithRUNTIME_CHECK_MSG.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents