class MaintenanceSqlBuilder
Builds the exact Trino maintenance statement for a chain step, per the unified ALTER TABLE ... EXECUTE syntax. Values come from the step’s config; when a field is left blank the Trino default is used (defaults below are the fallback only when the operator did not type anything).
Constants
- FILE_SIZE_THRESHOLD_DEFAULT
- RETENTION_THRESHOLD_DEFAULT
Public Class Methods
# File app/services/maintenance_sql_builder.rb, line 16 def self.build(table, step, where: nil) new(table, step, where: where).build end
Builds the maintenance statement for a table and chain step.
@param table [IcebergTable] the target table @param step [MaintenanceStep] the step describing the operation @param where [String, nil] an explicit WHERE predicate that overrides the step’s configured one (used by partition-batched OPTIMIZE) @return [String] the ALTER TABLE … EXECUTE statement
# File app/services/maintenance_sql_builder.rb, line 25 def initialize(table, step, where: nil) @table = table @step = step @where = where end
Creates the builder for a table and step.
@param table [IcebergTable] the target table @param step [MaintenanceStep] the step describing the operation @param where [String, nil] an explicit WHERE predicate
Public Instance Methods
Source
# File app/services/maintenance_sql_builder.rb, line 34 def build base = "ALTER TABLE #{qualified_table} EXECUTE #{operation}" base + arguments end
Builds the full ALTER TABLE statement including its arguments.
@return [String] the generated SQL