OmniSciDB  16c4e035a1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OmniSciHintStrategyTable.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("overlaps_bucket_threshold");
21  supportedHints.add("overlaps_max_size");
22  supportedHints.add("overlaps_allow_gpu_build");
23  supportedHints.add("overlaps_no_cache");
24  supportedHints.add("overlaps_keys_per_bin");
25  supportedHints.add("hash_join");
26 
27  for (String hint_name : supportedHints) {
28  // add local / global hints, e.., cpu_mode / g_cpu_mode
29  builder = builder.hintStrategy(hint_name, HintPredicates.SET_VAR);
30  String globalHintName = "g_".concat(hint_name);
31  builder = builder.hintStrategy(globalHintName, HintPredicates.SET_VAR);
32  }
33  return builder.build();
34  }
35 }
static HintStrategyTable createHintStrategies(HintStrategyTable.Builder builder)