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
Constructor
Description
`ParseHandler()`

## Method Summary

Modifier and Type
Method
Description
`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 compressAlgorithm, String compressLevel, String format, String file, 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 Details

### ParseHandler

public ParseHandler()

## Method Details

### 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 compressAlgorithm, String compressLevel, String format, String file, 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
  `compressAlgorithm` - compression algorithm
  `compressLevel` - compression level
  `format` - format
  `input` - input
  `file` - infile or outfile
  `parameters` - positions of parameters
  `positions` - keyword positions
  `settings` - settings
  `tempTables` - temporary tables
Returns:
  sql statement, or null means no change