Package com.clickhouse.jdbc.parser

## Class ParseHandler

- java.lang.Object
- - com.clickhouse.jdbc.parser.ParseHandler

Direct Known Subclasses:
  `JdbcParseHandler`

    public abstract class ParseHandler
    extends Object

### Constructor Summary

Constructors
`ParseHandler()`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `handleMacro​(String name, List<String> parameters)` Handle macro like "#include('/tmp/template.sql')".
`String` `handleParameter​(String cluster, String database, String table, int columnIndex)` Handle parameter.
`ClickHouseSqlStatement` `handleStatement​(String sql, StatementType stmtType, String cluster, String database, String table, String input, String format, String outfile, List<Integer> parameters, Map<String,​Integer> positions, Map<String,​String> settings, Set<String> tempTables)` Hanlde statemenet.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ParseHandler

    public ParseHandler()

### Method Detail

#### handleMacro

    public String handleMacro​(String name,
                              List<String> parameters)

Handle macro like "#include('/tmp/template.sql')".

Parameters:
  `name` - name of the macro
  `parameters` - parameters
Returns:
  output of the macro, could be null or empty string

#### handleParameter

    public String handleParameter​(String cluster,
                                  String database,
                                  String table,
                                  int columnIndex)

Handle parameter.

Parameters:
  `cluster` - cluster
  `database` - database
  `table` - table
  `columnIndex` - columnIndex(starts from 1 not 0)
Returns:
  parameter value

#### handleStatement

    public ClickHouseSqlStatement handleStatement​(String sql,
                                                  StatementType stmtType,
                                                  String cluster,
                                                  String database,
                                                  String table,
                                                  String input,
                                                  String format,
                                                  String outfile,
                                                  List<Integer> parameters,
                                                  Map<String,​Integer> positions,
                                                  Map<String,​String> settings,
                                                  Set<String> tempTables)

Hanlde statemenet.

Parameters:
  `sql` - sql statement
  `stmtType` - statement type
  `cluster` - cluster
  `database` - database
  `table` - table
  `format` - format
  `input` - input
  `outfile` - outfile
  `parameters` - positions of parameters
  `positions` - keyword positions
  `settings` - settings
  `tempTables` - temporary tables
Returns:
  sql statement, or null means no change