OmniSciDB  2e3a973ef4
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.*;
6 import org.apache.calcite.sql.parser.SqlParserPos;
7 
8 import java.util.ArrayList;
9 import java.util.List;
10 
11 public class SqlShowForeignServers extends SqlShowCommand {
12  private static final SqlOperator OPERATOR =
13  new SqlSpecialOperator("SHOW_SERVERS", SqlKind.OTHER_DDL);
14 
15  public static class Builder {
16  private List<SqlFilter> filters;
17  private SqlParserPos pos;
18  private SqlNode where;
19  public void setPos(SqlParserPos pos) {
20  this.pos = pos;
21  }
22 
23  public void addFilter(final String attribute,
24  final String value,
25  final SqlFilter.Operation operation,
26  final SqlFilter.Chain chain) {
27  if (filters == null) {
28  filters = new ArrayList<>();
29  }
30 
31  OmniSqlSanitizedString sanitizedValue = new OmniSqlSanitizedString(value);
32  filters.add(new SqlFilter(attribute, sanitizedValue.toString(), operation, chain));
33  }
34 
36  return new SqlShowForeignServers(pos, filters, where);
37  }
38  }
39 
40  @Expose
41  private List<SqlFilter> filters;
42 
44  final SqlParserPos pos, final List<SqlFilter> filters, final SqlNode where) {
45  super(OPERATOR, pos);
46  this.filters = filters;
47  }
48 }
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)