Class: Kumi::Core::Analyzer::Passes::JoinReducePlanningPass

Inherits:
PassBase
  • Object
show all
Includes:
Kumi::Core::Analyzer::Plans
Defined in:
lib/kumi/core/analyzer/passes/join_reduce_planning_pass.rb

Overview

Plans join and reduce operations for declarations. Determines reduction axes, flattening requirements, and join policies.

DEPENDENCIES: :broadcasts, :scope_plans, :decl_shapes, :declarations, :input_metadata PRODUCES: :join_reduce_plans

Instance Method Summary collapse

Methods inherited from PassBase

#debug, #debug_enabled?, #initialize

Methods included from ErrorReporting

#inferred_location, #raise_localized_error, #raise_syntax_error, #raise_type_error, #report_enhanced_error, #report_error, #report_semantic_error, #report_syntax_error, #report_type_error

Constructor Details

This class inherits a constructor from Kumi::Core::Analyzer::Passes::PassBase

Instance Method Details

#run(_errors) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/kumi/core/analyzer/passes/join_reduce_planning_pass.rb', line 15

def run(_errors)
  broadcasts = get_state(:broadcasts, required: false) || {}
  scope_plans = get_state(:scope_plans, required: false) || {}
  declarations = get_state(:declarations, required: true)
   = get_state(:input_metadata, required: true)

  plans = {}

  # Process reduction operations
  process_reductions(broadcasts, scope_plans, declarations, , plans)

  # Process join operations (for non-reduction vectorized operations)
  process_joins(broadcasts, scope_plans, declarations, plans)

  # Return new state with join/reduce plans
  state.with(:join_reduce_plans, plans.freeze)
end