Provides minisql executor join facilities for this project.
Package: minisql.executor.join
Reachable from entry: yes
minisql/common/endian.mlasendian→ src/minisql/common/endian.mlminisql/executor/projection.mlasprojection→ src/minisql/executor/projection.mlminisql/executor/scan.mlasscan→ src/minisql/executor/scan.mlminisql/executor/sort.mlassort→ src/minisql/executor/sort.mlminisql/platform/file.mlasfile_api→ src/minisql/platform/file.mlminisql/server/database_manager.mlasdatabase_manager→ src/minisql/server/database_manager.mlminisql/sql/ast.mlasast→ src/minisql/sql/ast.mlminisql/sql/expressions.mlasexpressions→ src/minisql/sql/expressions.mlminisql/sql/types.mlastypes→ src/minisql/sql/types.mlminisql/sql/values.mlasvalues→ src/minisql/sql/values.mlstd/concurrent/thread_pool.mlasthread_pool→../MiniLangCompilerML/std/concurrent/thread_pool.ml— external dependency
function apply(leftRows, rightRows, boundJoin)Executes the semantic nested-loop fallback for every supported join type. Tracks matched right rows for RIGHT/FULL padding and emits typed NULL padding for unmatched outer rows. Returns rows in deterministic left-major order.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
function applyHash(leftRows, rightRows, boundJoin)Backward-compatible entry point used by direct executor tests.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
function applyHashBuild(leftRows, rightRows, boundJoin, buildRight)Selects a direct hash-build orientation without a server query token.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
buildRight |
dynamic |
— | buildRight value consumed by this operation. |
function applyHashBuildCore(leftRows, rightRows, boundJoin, buildRight, database, sessionId)Executes the optimizer-selected hash build orientation. LEFT joins keep the right build side because unmatched-left tracking is part of that algorithm.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
buildRight |
dynamic |
— | buildRight value consumed by this operation. |
database |
dynamic |
— | database value consumed by this operation. |
sessionId |
dynamic |
— | Identifier of session. |
function applyHashBuildWithSpill(leftRows, rightRows, boundJoin, buildRight, temporaryRoot, threshold)Historical direct API retains behavior without a cooperative server token.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
buildRight |
dynamic |
— | buildRight value consumed by this operation. |
temporaryRoot |
dynamic |
— | temporaryRoot value consumed by this operation. |
threshold |
dynamic |
— | threshold value consumed by this operation. |
function applyHashBuildWithSpillControlled(leftRows, rightRows, boundJoin, buildRight, temporaryRoot, threshold, database, sessionId)Server execution path propagates cancellation/deadline state into spill workers.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
buildRight |
dynamic |
— | buildRight value consumed by this operation. |
temporaryRoot |
dynamic |
— | temporaryRoot value consumed by this operation. |
threshold |
dynamic |
— | threshold value consumed by this operation. |
database |
dynamic |
— | database value consumed by this operation. |
sessionId |
dynamic |
— | Identifier of session. |
function applyHashBuildWithSpillCore(leftRows, rightRows, boundJoin, buildRight, temporaryRoot, threshold, database, sessionId)Executes a grace-style partitioned hash join when the selected build input exceeds the row threshold. Each partition is CRC/shape validated by the shared spill codec and removed on both success and failure paths.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
buildRight |
dynamic |
— | buildRight value consumed by this operation. |
temporaryRoot |
dynamic |
— | temporaryRoot value consumed by this operation. |
threshold |
dynamic |
— | threshold value consumed by this operation. |
database |
dynamic |
— | database value consumed by this operation. |
sessionId |
dynamic |
— | Identifier of session. |
function applyHashLeft(leftRows, rightRows, boundJoin)Preserves left-build hash joins for callers without a server query token.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
function applyHashLeftCore(leftRows, rightRows, boundJoin, database, sessionId)Executes an INNER equi-join with the left input as the hash-build side. The emitted row remains left.values + right.values, so choosing the smaller build side never changes bound column indexes.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
database |
dynamic |
— | database value consumed by this operation. |
sessionId |
dynamic |
— | Identifier of session. |
function applyHashRight(leftRows, rightRows, boundJoin)Preserves right-build hash joins for callers without a server query token.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
function applyHashRightCore(leftRows, rightRows, boundJoin, database, sessionId)Executes an INNER or LEFT equi-join with a right-side hash table. NULL keys never match, full value comparison resolves collisions, and the original predicate is rechecked before emission. Unsupported shapes fall back.
| Parameter | Type | Default | Description |
|---|---|---|---|
leftRows |
dynamic |
— | leftRows value consumed by this operation. |
rightRows |
dynamic |
— | rightRows value consumed by this operation. |
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
database |
dynamic |
— | database value consumed by this operation. |
sessionId |
dynamic |
— | Identifier of session. |
function applySpilledPartition(task)Reads and joins one pair of hash partitions on a native worker. Runs are deleted by their owning task on both successful and failed reads.
| Parameter | Type | Default | Description |
|---|---|---|---|
task |
dynamic |
— | task value consumed by this operation. |
function canHash(boundJoin)Returns whether the supplied value satisfies the hash condition. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
function cleanupPartitionTasks(tasks)Removes every spill run already owned by not-yet-submitted partition tasks.
| Parameter | Type | Default | Description |
|---|---|---|---|
tasks |
dynamic |
— | tasks value consumed by this operation. |
function combine(left, right)Implements combine for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
left |
dynamic |
— | left value consumed by this operation. |
right |
dynamic |
— | right value consumed by this operation. |
function componentName()Performs the componentName operation for the minisql executor join module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
function conditionPasses(condition, row)Implements condition passes for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
condition |
dynamic |
— | condition value consumed by this operation. |
row |
dynamic |
— | row value consumed by this operation. |
function equalityColumns(boundJoin)Implements equality columns for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
boundJoin |
dynamic |
— | boundJoin value consumed by this operation. |
function fail(code, operation, message)Performs the fail operation for the minisql executor join module. Returns its result or propagates a structured error from validation or a dependency. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
code |
dynamic |
— | code value consumed by this operation. |
operation |
dynamic |
— | operation value consumed by this operation. |
message |
dynamic |
— | Human-readable message associated with the operation. |
const HASH_BUCKET_COUNT = 257Defines the hash bucket count constant used by the minisql executor join module.
const HASH_MASK = 2147483647Defines the hash mask constant used by the minisql executor join module.
function hashBytes(input, seed)Implements hash bytes for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
input |
dynamic |
— | input value consumed by this operation. |
seed |
dynamic |
— | seed value consumed by this operation. |
- minisql.executor.join.HashJoinEntry — struct
function hashValue(value)Implements hash value for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function integerDivide(numerator, denominator)Computes non-negative truncating integer division without losing precision.
| Parameter | Type | Default | Description |
|---|---|---|---|
numerator |
dynamic |
— | numerator value consumed by this operation. |
denominator |
dynamic |
— | denominator value consumed by this operation. |
const INTRA_QUERY_WORKERS = 4Defines the intra query workers constant used by the minisql executor join module.
const INVALID_ARGUMENT = 9001Join executor. M16 provides the correctness-first nested-loop implementation.
function isImplemented()Returns whether implemented satisfies the condition required by the minisql executor join module. Returns the computed value or operation status. Does not modify its inputs.
function nullValues(table)Implements null values for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
table |
dynamic |
— | table value consumed by this operation. |
function nullValuesForTypes(typeInfos)Implements null values for types for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
typeInfos |
dynamic |
— | typeInfos value consumed by this operation. |
function pollJoinControl(database, sessionId, counter, operation)Polls a server-owned query at bounded hash-operator intervals. Direct module tests pass a void database and retain the dependency-free historical API.
| Parameter | Type | Default | Description |
|---|---|---|---|
database |
dynamic |
— | database value consumed by this operation. |
sessionId |
dynamic |
— | Identifier of session. |
counter |
dynamic |
— | counter value consumed by this operation. |
operation |
dynamic |
— | operation value consumed by this operation. |
function projectedSpillRows(rows)Converts scanned rows to the generic validated spill-run representation.
| Parameter | Type | Default | Description |
|---|---|---|---|
rows |
dynamic |
— | rows value consumed by this operation. |
function scannedSpillRows(rows)Restores value-only scanned rows after a validated spill-run read.
| Parameter | Type | Default | Description |
|---|---|---|---|
rows |
dynamic |
— | rows value consumed by this operation. |
function targetMilestone()Performs the targetMilestone operation for the minisql executor join module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.