OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SqlShowForeignServers.java
Go to the documentation of this file.
1 package com.mapd.parser.extension.ddl;
2 import com.google.gson.annotations.Expose;
4 
5 import org.apache.calcite.sql.SqlKind;
6 import org.apache.calcite.sql.SqlNode;
7 import org.apache.calcite.sql.SqlOperator;
8 import org.apache.calcite.sql.SqlSpecialOperator;
9 import org.apache.calcite.sql.parser.SqlParserPos;
10 
11 import java.util.ArrayList;
12 import java.util.List;
13 
14 public class SqlShowForeignServers extends SqlCustomDdl {
15  private static final SqlOperator OPERATOR =
16  new SqlSpecialOperator("SHOW_SERVERS", SqlKind.OTHER_DDL);
17 
18  public static class Builder {
19  private List<SqlFilter> filters;
20  private SqlParserPos pos;
21  private SqlNode where;
22  public void setPos(SqlParserPos pos) {
23  this.pos = pos;
24  }
25 
26  public void addFilter(final String attribute,
27  final String value,
28  final SqlFilter.Operation operation,
29  final SqlFilter.Chain chain) {
30  if (filters == null) {
31  filters = new ArrayList<>();
32  }
33 
34  HeavySqlSanitizedString sanitizedValue = new HeavySqlSanitizedString(value);
35  filters.add(new SqlFilter(attribute, sanitizedValue.toString(), operation, chain));
36  }
37 
39  return new SqlShowForeignServers(pos, filters, where);
40  }
41  }
42 
43  @Expose
44  private List<SqlFilter> filters;
45 
47  final SqlParserPos pos, final List<SqlFilter> filters, final SqlNode where) {
48  super(OPERATOR, pos);
49  this.filters = filters;
50  }
51 }
SqlShowForeignServers(final SqlParserPos pos, final List< SqlFilter > filters, final SqlNode where)
void addFilter(final String attribute, final String value, final SqlFilter.Operation operation, final SqlFilter.Chain chain)