class FakeTrinoRuntime
Skeleton Trino engine for development/tests. Immediately “ready” and returns canned metrics so the orchestrator can be exercised end-to-end.
Public Instance Methods
Source
# File app/services/fake_trino_runtime.rb, line 12 def ensure_running end
No-op: the fake engine never needs starting.
Source
# File app/services/fake_trino_runtime.rb, line 16 def ensure_stopped end
No-op: the fake engine never needs stopping.
# File app/services/fake_trino_runtime.rb, line 26 def execute(sql, execution_id:, execution: nil, step: nil) { "executed_sql" => sql, "execution_history_id" => execution_id, "status" => "success", "affected_rows" => 0 } end
Returns a canned success result for any SQL.
@param sql [String] the SQL to “execute” @param execution_id [Integer] the execution id echoed in the result @param execution [ExecutionHistory, nil] unused @param step [ExecutionStep, nil] unused @return [Hash] a canned success payload
# File app/services/fake_trino_runtime.rb, line 41 def query_rows(_sql, execution_id:) [ [ "2026-01-01" ], [ "2026-01-02" ] ] end
Returns canned partition values so the planner can be exercised end-to-end. Overridable in specs via expect(…).to receive(:query_rows).
@param _sql [String] the query (unused) @param execution_id [Integer] the execution id (unused) @return [Array<Array>] a small set of distinct partition values
Source
# File app/services/fake_trino_runtime.rb, line 7 def ready? true end
The fake engine is always ready.
@return [Boolean] always true