OmniSciDB  04ee39c94c
MapDParserOptions.java
Go to the documentation of this file.
1 /*
2  * Copyright 2019 MapD Technologies, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.mapd.calcite.parser;
17 
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
20 
21 import java.util.ArrayList;
22 import java.util.List;
23 
28 public final class MapDParserOptions {
29  final static Logger MAPDLOGGER = LoggerFactory.getLogger(MapDParserOptions.class);
30 
31  private List<FilterPushDownInfo> filterPushDownInfo;
32  private boolean legacySyntax;
33  private boolean isExplain;
34  private boolean isViewOptimizeEnabled;
35 
36  public MapDParserOptions(List<FilterPushDownInfo> inFilterPushDownInfo,
37  boolean inLegacySyntax,
38  boolean inIsExplain,
39  boolean inIsViewOptimzeEnabled) {
40  filterPushDownInfo = inFilterPushDownInfo;
41  legacySyntax = inLegacySyntax;
42  isExplain = inIsExplain;
43  isViewOptimizeEnabled = inIsViewOptimzeEnabled;
44  }
45 
46  public MapDParserOptions() {
47  filterPushDownInfo = new ArrayList<>();
48  legacySyntax = true;
49  isExplain = false;
50  isViewOptimizeEnabled = false;
51  }
52 
56  public List<FilterPushDownInfo> getFilterPushDownInfo() {
57  return filterPushDownInfo;
58  }
59 
63  public void setFilterPushDownInfo(List<FilterPushDownInfo> filterPushDownInfo) {
64  this.filterPushDownInfo = filterPushDownInfo;
65  }
66 
70  public boolean isLegacySyntax() {
71  return legacySyntax;
72  }
73 
77  public void setLegacySyntax(boolean legacySyntax) {
78  this.legacySyntax = legacySyntax;
79  }
80 
84  public boolean isExplain() {
85  return isExplain;
86  }
87 
91  public void setExplain(boolean isExplain) {
92  this.isExplain = isExplain;
93  }
94 
95  public static class FilterPushDownInfo {
97  final int input_prev, final int input_start, final int input_next) {
98  this.input_prev = input_prev;
99  this.input_start = input_start;
100  this.input_next = input_next;
101  }
102 
103  public int input_prev;
104  public int input_start;
105  public int input_next;
106  }
107 
111  public boolean isViewOptimizeEnabled() {
112  return isViewOptimizeEnabled;
113  }
114 
118  public void setViewOptimizeEnabled(boolean isViewOptimizeEnabled) {
119  this.isViewOptimizeEnabled = isViewOptimizeEnabled;
120  }
121 }
List< FilterPushDownInfo > filterPushDownInfo
MapDParserOptions(List< FilterPushDownInfo > inFilterPushDownInfo, boolean inLegacySyntax, boolean inIsExplain, boolean inIsViewOptimzeEnabled)
FilterPushDownInfo(final int input_prev, final int input_start, final int input_next)
void setFilterPushDownInfo(List< FilterPushDownInfo > filterPushDownInfo)
List< FilterPushDownInfo > getFilterPushDownInfo()
void setViewOptimizeEnabled(boolean isViewOptimizeEnabled)