Class: Pinot::Client::QueryOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/pinot/client/query_options.rb

Defined Under Namespace

Classes: InvalidOption

Constant Summary collapse

OPTIONS =
[:timeout_ms, :enable_null_handling, :explain_plan_verbose, :use_multistage_engine, :max_execution_threads, :num_replica_groups_to_query, :min_segment_group_trim_size, :min_server_group_trim_size, :skip_indexes, :skip_upsert, :use_star_tree, :and_scan_reordering, :max_rows_in_join, :in_predicate_pre_sorted, :in_predicate_lookup_algorithm, :max_server_response_size_bytes, :max_query_response_size_bytes]

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ QueryOptions

Returns a new instance of QueryOptions.



12
13
14
# File 'lib/pinot/client/query_options.rb', line 12

def initialize(options = {})
  process_options_hash(options)
end

Instance Method Details

#available_optionsObject



16
17
18
# File 'lib/pinot/client/query_options.rb', line 16

def available_options
  OPTIONS
end

#to_query_optionsObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/pinot/client/query_options.rb', line 20

def to_query_options
  query_options = []
  available_options.each do |opt|
    if (value = send(opt))
      query_options << "#{camelize_option(opt)}=#{value}"
    end
  end

  return nil if query_options.empty?

  query_options.join(";")
end