text: #include <Processors/QueryPlan/Optimizations/QueryPlanOptimizationSettings.h>
  #include <Core/Settings.h>
  #include <Interpreters/Context.h>
  
  namespace DB
  {
  
  QueryPlanOptimizationSettings QueryPlanOptimizationSettings::fromSettings(const Settings & from)
  {
      QueryPlanOptimizationSettings settings;
      settings.optimize_plan = from.query_plan_enable_optimizations;
      settings.max_optimizations_to_apply = from.query_plan_max_optimizations_to_apply;
      settings.filter_push_down = from.query_plan_filter_push_down;
      return settings;
  }
  
  QueryPlanOptimizationSettings QueryPlanOptimizationSettings::fromContext(const Context & from)
  {
      return fromSettings(from.getSettingsRef());
  }
  
  }
  