OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HeavyDBHintStrategyTable.java
Go to the documentation of this file.
1 package com.mapd.parser.hint;
2 
3 import org.apache.calcite.rel.hint.HintPredicates;
4 import org.apache.calcite.rel.hint.HintStrategyTable;
5 
6 import java.util.ArrayList;
7 
9  public static final HintStrategyTable HINT_STRATEGY_TABLE = createHintStrategies();
10 
11  private static HintStrategyTable createHintStrategies() {
12  return createHintStrategies(HintStrategyTable.builder());
13  }
14 
15  static HintStrategyTable createHintStrategies(HintStrategyTable.Builder builder) {
16  ArrayList<String> supportedHints = new ArrayList<String>();
17  supportedHints.add("cpu_mode");
18  supportedHints.add("columnar_output");
19  supportedHints.add("rowwise_output");
20  supportedHints.add("bbox_intersect_bucket_threshold");
21  supportedHints.add("bbox_intersect_max_size");
22  supportedHints.add("bbox_intersect_allow_gpu_build");
23  supportedHints.add("bbox_intersect_no_cache");
24  supportedHints.add("bbox_intersect_keys_per_bin");
25  supportedHints.add("keep_result");
26  supportedHints.add("keep_table_function_result");
27  supportedHints.add("aggregate_tree_fanout");
28  supportedHints.add("cuda_block_size");
29  supportedHints.add("cuda_grid_size_multiplier");
30  supportedHints.add("cuda_opt_block_and_grid_sizes");
31  supportedHints.add("watchdog");
32  supportedHints.add("dynamic_watchdog");
33  supportedHints.add("watchdog_off");
34  supportedHints.add("dynamic_watchdog_off");
35  supportedHints.add("query_time_limit");
36  supportedHints.add("allow_loop_join");
37  supportedHints.add("disable_loop_join");
38  supportedHints.add("loop_join_inner_table_max_num_rows");
39  supportedHints.add("max_join_hashtable_size");
40  supportedHints.add("force_baseline_hash_join");
41  supportedHints.add("force_one_to_many_hash_join");
42  supportedHints.add("watchdog_max_projected_rows_per_device");
43  supportedHints.add("preflight_count_query_threshold");
44  supportedHints.add("table_reordering_off");
45  supportedHints.add("ndv_groups_estimator_multiplier");
46 
47  for (String hint_name : supportedHints) {
48  // add local / global hints, e.., cpu_mode / g_cpu_mode
49  builder = builder.hintStrategy(hint_name, HintPredicates.SET_VAR);
50  String globalHintName = "g_".concat(hint_name);
51  builder = builder.hintStrategy(globalHintName, HintPredicates.SET_VAR);
52  }
53  return builder.build();
54  }
55 }
static HintStrategyTable createHintStrategies(HintStrategyTable.Builder builder)