Package com.clickhouse.jdbc.parser

# Class ClickHouseSqlParser

java.lang.Object
com.clickhouse.jdbc.parser.ClickHouseSqlParser

All Implemented Interfaces:
  `ClickHouseSqlParserConstants`

public class ClickHouseSqlParser extends Object implements ClickHouseSqlParserConstants

## Field Summary

Fields
Modifier and Type
Field
Description
`Token`
`jj_nt`
Next token.
`Token`
`token`
Current token.
`ClickHouseSqlParserTokenManager`
`token_source`
Generated Token Manager.

### Fields inherited from interface com.clickhouse.jdbc.parser.ClickHouseSqlParserConstants

`A, ALL, ALTER, AND, APPLY, ARRAY, ARROW, AS, ASOF, ASTERISK, AT, ATTACH, B, BACK_QUOTE, BACK_QUOTED_NAME, BACK_SLASH, BEGIN, BETWEEN, C, CASE, CHECK, CLUSTER, COLON, COMMA, COMMIT, COMPRESSION, CONCAT, CONVERT, CREATE, D, DASH, DATABASE, DATABASES, DATE, DAY, DEC_DIGIT, DECIMAL_LITERAL, DEFAULT, DELETE, DESC, DESCRIBE, DETACH, DICTIONARIES, DICTIONARY, DISTINCT, DOLLAR, DOT, DOUBLE_QUOTE, DOUBLE_QUOTED_NAME, DROP, E, ELSE, END, EOF, EQ_DOUBLE, EQ_SINGLE, EXCEPT, EXISTS, EXPLAIN, F, FINAL, FLOATING_LITERAL, FORMAT, FROM, FULL, FUNCTION, G, GE, GLOBAL, GRANT, GROUP, GT, H, HASH, HAVING, HEX_DIGIT, HEXADECIMAL_LITERAL, HOUR, I, IDENTIFIER, IF, ILIKE, IN, INF, INFILE, INNER, INPUT, INSERT, INTERVAL, INTO, IS, J, JDBC_LITERAL, JOIN, K, KILL, L, LBRACE, LBRACKET, LE, LEFT, LETTER, LEVEL, LIKE, LIMIT, LIVE, LPAREN, LT, M, MATERIALIZED, MINUTE, MONTH, MULTI_LINE_COMMENT, N, NAN, NOT, NOT_EQ, NULL, O, OFFSET, ON, OPTIMIZE, OR, ORDER, OUTFILE, P, PERCENT, PLUS, POLICY, PREWHERE, PROFILE, Q, QUARTER, QUERY, QUOTA, R, RBRACE, RBRACKET, RENAME, REPLACE, REVOKE, RIGHT, ROLE, ROLLBACK, ROW, RPAREN, S, SAMPLE, SECOND, SELECT, SEMICOLON, SET, SETTINGS, SHOW, SINGLE_LINE_COMMENT, SINGLE_QUOTE, SLASH, STDOUT, STRING_LITERAL, SYSTEM, T, TABLE, TABLES, TEMPORARY, THEN, TIES, TIMESTAMP, tokenImage, TOP, TOTALS, TRANSACTION, TRUNCATE, U, UNDERSCORE, UNION, UPDATE, USE, USER, USING, V, VALUES, VIEW, W, WATCH, WEEK, WHEN, WHERE, WHITESPACE, WITH, X, Y, YEAR, Z, ZERO`

## Constructor Summary

Constructors
Constructor
Description
`ClickHouseSqlParser(ClickHouseSqlParserTokenManager tm)`
Constructor with generated Token Manager.
`ClickHouseSqlParser(InputStream stream)`
Constructor with InputStream.
`ClickHouseSqlParser(InputStream stream, Charset encoding)`
Constructor with InputStream and supplied encoding
`ClickHouseSqlParser(Reader stream)`
Constructor with InputStream.
`ClickHouseSqlParser(String sql, com.clickhouse.client.ClickHouseConfig config, ParseHandler handler)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addStatement()`
`final Token`
`aliasExpr()`
`final void`
`allColumnsExpr()`
`final void`
`alterStmt()`
`final void`
`anyColumnExpr()`
`final void`
`anyExpr()`
`final void`
`anyExprList()`
`final Token`
`anyIdentifier()`
`final Token`
`anyKeyword()`
`final void`
`anyNestedExpr()`
`final void`
`attachStmt()`
`final void`
`betweenExpr()`
`final void`
`calcExpr()`
`final void`
`checkStmt()`
`final void`
`clusterClause()`
`final void`
`columnExpr()`
`final void`
`columnExprList()`
`final void`
`columnsExpr()`
`final void`
`compressionPart()`
`final void`
`createStmt()`
`final void`
`databaseIdentifier(boolean record)`
`final void`
`dataClause()`
`final Token`
`dateLiteral()`
`final void`
`deleteStmt()`
`final void`
`describeStmt()`
`final void`
`detachStmt()`
`final void`
`disable_tracing()`
Disable tracing.
`final void`
`dropStmt()`
`final void`
`enable_tracing()`
Enable tracing.
`final void`
`existsStmt()`
`final void`
`explainStmt()`
`final void`
`formatPart()`
`final void`
`functionExpr()`
`ParseException`
`generateParseException()`
Generate ParseException.
`final Token`
`getNextToken()`
`final Token`
`getToken(int index)`
`final void`
`grantStmt()`
`final Token`
`identifier()`
`final void`
`infilePart()`
`final void`
`insertStmt()`
`final void`
`interval()`
`final Token`
`keyword()`
`final void`
`killStmt()`
`final Token`
`literal()`
`final void`
`macro()`
`final void`
`nestedExpr()`
`final void`
`nestedIdentifier()`
`final Token`
`numberLiteral()`
`final void`
`operator()`
`final void`
`optimizeStmt()`
`final void`
`outfilePart()`
`static ClickHouseSqlStatement[]`
`parse(String sql, com.clickhouse.client.ClickHouseConfig config)`
`static ClickHouseSqlStatement[]`
`parse(String sql, com.clickhouse.client.ClickHouseConfig config, ParseHandler handler)`
`void`
`ReInit(ClickHouseSqlParserTokenManager tm)`
Reinitialise
`void`
`ReInit(InputStream stream)`
Reinitialise
`void`
`ReInit(InputStream stream, Charset encoding)`
Reinitialise
`void`
`ReInit(Reader stream)`
Reinitialise
`final void`
`renameStmt()`
`final void`
`revokeStmt()`
`final void`
`selectStmt()`
`final void`
`setStmt()`
`final void`
`settingExpr()`
`final void`
`settingExprList()`
`final void`
`settingsPart()`
`final void`
`showStmt()`
`final ClickHouseSqlStatement[]`
`sql()`
`final void`
`stmt()`
`final void`
`stmts()`
`final void`
`systemStmt()`
`final void`
`tableClause(boolean record)`
`final void`
`tableIdentifier(boolean record)`
`final void`
`topClause()`
`final boolean`
`trace_enabled()`
`final void`
`truncateStmt()`
`final void`
`txStmt()`
`final void`
`updateStmt()`
`final void`
`useStmt()`
`final Token`
`variable()`
`final void`
`watchStmt()`
`final void`
`withClause()`
`final void`
`withExpr()`
`final void`
`withTotalPart()`

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

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

## Field Details

### token_source

public ClickHouseSqlParserTokenManager token_source
Generated Token Manager.

### token

public Token token
Current token.

### jj_nt

public Token jj_nt
Next token.

## Constructor Details

### ClickHouseSqlParser

public ClickHouseSqlParser(String sql, com.clickhouse.client.ClickHouseConfig config, ParseHandler handler)

### ClickHouseSqlParser

public ClickHouseSqlParser(InputStream stream)
Constructor with InputStream.

Parameters:
  `stream` - input stream

### ClickHouseSqlParser

public ClickHouseSqlParser(InputStream stream, Charset encoding)
Constructor with InputStream and supplied encoding

Parameters:
  `stream` - input stream
  `encoding` - charset to be used

### ClickHouseSqlParser

public ClickHouseSqlParser(Reader stream)
Constructor with InputStream.

Parameters:
  `stream` - char stream

### ClickHouseSqlParser

public ClickHouseSqlParser(ClickHouseSqlParserTokenManager tm)
Constructor with generated Token Manager.

Parameters:
  `tm` - Token manager to use

## Method Details

### parse

public static ClickHouseSqlStatement[] parse(String sql, com.clickhouse.client.ClickHouseConfig config)

### parse

public static ClickHouseSqlStatement[] parse(String sql, com.clickhouse.client.ClickHouseConfig config, ParseHandler handler)

### addStatement

public void addStatement()

### sql

public final ClickHouseSqlStatement[] sql() throws ParseException

Throws:
  `ParseException`

### stmts

public final void stmts() throws ParseException

Throws:
  `ParseException`

### stmt

public final void stmt() throws ParseException

Throws:
  `ParseException`

### alterStmt

public final void alterStmt() throws ParseException

Throws:
  `ParseException`

### clusterClause

public final void clusterClause() throws ParseException

Throws:
  `ParseException`

### attachStmt

public final void attachStmt() throws ParseException

Throws:
  `ParseException`

### checkStmt

public final void checkStmt() throws ParseException

Throws:
  `ParseException`

### createStmt

public final void createStmt() throws ParseException

Throws:
  `ParseException`

### deleteStmt

public final void deleteStmt() throws ParseException

Throws:
  `ParseException`

### describeStmt

public final void describeStmt() throws ParseException

Throws:
  `ParseException`

### detachStmt

public final void detachStmt() throws ParseException

Throws:
  `ParseException`

### dropStmt

public final void dropStmt() throws ParseException

Throws:
  `ParseException`

### existsStmt

public final void existsStmt() throws ParseException

Throws:
  `ParseException`

### explainStmt

public final void explainStmt() throws ParseException

Throws:
  `ParseException`

### grantStmt

public final void grantStmt() throws ParseException

Throws:
  `ParseException`

### insertStmt

public final void insertStmt() throws ParseException

Throws:
  `ParseException`

### dataClause

public final void dataClause() throws ParseException

Throws:
  `ParseException`

### killStmt

public final void killStmt() throws ParseException

Throws:
  `ParseException`

### optimizeStmt

public final void optimizeStmt() throws ParseException

Throws:
  `ParseException`

### renameStmt

public final void renameStmt() throws ParseException

Throws:
  `ParseException`

### revokeStmt

public final void revokeStmt() throws ParseException

Throws:
  `ParseException`

### selectStmt

public final void selectStmt() throws ParseException

Throws:
  `ParseException`

### withClause

public final void withClause() throws ParseException

Throws:
  `ParseException`

### topClause

public final void topClause() throws ParseException

Throws:
  `ParseException`

### tableClause

public final void tableClause(boolean record) throws ParseException

Throws:
  `ParseException`

### setStmt

public final void setStmt() throws ParseException

Throws:
  `ParseException`

### showStmt

public final void showStmt() throws ParseException

Throws:
  `ParseException`

### systemStmt

public final void systemStmt() throws ParseException

Throws:
  `ParseException`

### truncateStmt

public final void truncateStmt() throws ParseException

Throws:
  `ParseException`

### updateStmt

public final void updateStmt() throws ParseException

Throws:
  `ParseException`

### useStmt

public final void useStmt() throws ParseException

Throws:
  `ParseException`

### watchStmt

public final void watchStmt() throws ParseException

Throws:
  `ParseException`

### txStmt

public final void txStmt() throws ParseException

Throws:
  `ParseException`

### columnExprList

public final void columnExprList() throws ParseException

Throws:
  `ParseException`

### withExpr

public final void withExpr() throws ParseException

Throws:
  `ParseException`

### columnsExpr

public final void columnsExpr() throws ParseException

Throws:
  `ParseException`

### allColumnsExpr

public final void allColumnsExpr() throws ParseException

Throws:
  `ParseException`

### nestedExpr

public final void nestedExpr() throws ParseException

Throws:
  `ParseException`

### calcExpr

public final void calcExpr() throws ParseException

Throws:
  `ParseException`

### betweenExpr

public final void betweenExpr() throws ParseException

Throws:
  `ParseException`

### functionExpr

public final void functionExpr() throws ParseException

Throws:
  `ParseException`

### columnExpr

public final void columnExpr() throws ParseException

Throws:
  `ParseException`

### compressionPart

public final void compressionPart() throws ParseException

Throws:
  `ParseException`

### formatPart

public final void formatPart() throws ParseException

Throws:
  `ParseException`

### infilePart

public final void infilePart() throws ParseException

Throws:
  `ParseException`

### outfilePart

public final void outfilePart() throws ParseException

Throws:
  `ParseException`

### settingsPart

public final void settingsPart() throws ParseException

Throws:
  `ParseException`

### withTotalPart

public final void withTotalPart() throws ParseException

Throws:
  `ParseException`

### anyExprList

public final void anyExprList() throws ParseException

Throws:
  `ParseException`

### anyExpr

public final void anyExpr() throws ParseException

Throws:
  `ParseException`

### anyNestedExpr

public final void anyNestedExpr() throws ParseException

Throws:
  `ParseException`

### anyColumnExpr

public final void anyColumnExpr() throws ParseException

Throws:
  `ParseException`

### aliasExpr

public final Token aliasExpr() throws ParseException

Throws:
  `ParseException`

### nestedIdentifier

public final void nestedIdentifier() throws ParseException

Throws:
  `ParseException`

### tableIdentifier

public final void tableIdentifier(boolean record) throws ParseException

Throws:
  `ParseException`

### databaseIdentifier

public final void databaseIdentifier(boolean record) throws ParseException

Throws:
  `ParseException`

### settingExprList

public final void settingExprList() throws ParseException

Throws:
  `ParseException`

### settingExpr

public final void settingExpr() throws ParseException

Throws:
  `ParseException`

### anyIdentifier

public final Token anyIdentifier() throws ParseException

Throws:
  `ParseException`

### identifier

public final Token identifier() throws ParseException

Throws:
  `ParseException`

### interval

public final void interval() throws ParseException

Throws:
  `ParseException`

### literal

public final Token literal() throws ParseException

Throws:
  `ParseException`

### dateLiteral

public final Token dateLiteral() throws ParseException

Throws:
  `ParseException`

### numberLiteral

public final Token numberLiteral() throws ParseException

Throws:
  `ParseException`

### operator

public final void operator() throws ParseException

Throws:
  `ParseException`

### macro

public final void macro() throws ParseException

Throws:
  `ParseException`

### variable

public final Token variable() throws ParseException

Throws:
  `ParseException`

### anyKeyword

public final Token anyKeyword() throws ParseException

Throws:
  `ParseException`

### keyword

public final Token keyword() throws ParseException

Throws:
  `ParseException`

### ReInit

public void ReInit(InputStream stream)
Reinitialise

Parameters:
  `stream` - input stream

### ReInit

public void ReInit(InputStream stream, Charset encoding)
Reinitialise

Parameters:
  `stream` - input stream
  `encoding` - charset to be used

### ReInit

public void ReInit(Reader stream)
Reinitialise

Parameters:
  `stream` - char stream

### ReInit

public void ReInit(ClickHouseSqlParserTokenManager tm)
Reinitialise

Parameters:
  `tm` - Token manager to use

### getNextToken

public final Token getNextToken()

Returns:
  the next Token.

### getToken

public final Token getToken(int index)

Parameters:
  `index` - index to be retrieved
Returns:
  the specific Token.

### generateParseException

public ParseException generateParseException()
Generate ParseException.

### trace_enabled

public final boolean trace_enabled()

Returns:
  Always `false`.

### enable_tracing

public final void enable_tracing()
Enable tracing.

### disable_tracing

public final void disable_tracing()
Disable tracing.