Package com.clickhouse.jdbc.parser
Class ClickHouseSqlParser
java.lang.Object
com.clickhouse.jdbc.parser.ClickHouseSqlParser
- All Implemented Interfaces:
ClickHouseSqlParserConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionNext token.Current token.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
ConstructorsConstructorDescriptionConstructor with generated Token Manager.ClickHouseSqlParser(InputStream stream) Constructor with InputStream.ClickHouseSqlParser(InputStream stream, Charset encoding) Constructor with InputStream and supplied encodingClickHouseSqlParser(Reader stream) Constructor with InputStream.ClickHouseSqlParser(String sql, ClickHouseConfig config, ParseHandler handler) -
Method Summary
Modifier and TypeMethodDescriptionvoidfinal Tokenfinal voidfinal voidfinal voidfinal voidanyExpr()final voidfinal Tokenfinal Tokenfinal voidfinal voidfinal voidfinal voidcalcExpr()final voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voiddatabaseIdentifier(boolean record) final voidfinal Tokenfinal voidfinal voidfinal voidfinal voidDisable tracing.final voiddropStmt()final voidEnable tracing.final voidfinal voidfinal voidfinal voidGenerate ParseException.final Tokenfinal TokengetToken(int index) final voidfinal Tokenfinal voidfinal voidfinal voidinterval()final Tokenkeyword()final voidkillStmt()final Tokenliteral()final voidmacro()final voidfinal voidfinal Tokenfinal voidoperator()final voidfinal voidstatic ClickHouseSqlStatement[]parse(String sql, ClickHouseConfig config) static ClickHouseSqlStatement[]parse(String sql, ClickHouseConfig config, ParseHandler handler) voidReinitialisevoidReInit(InputStream stream) ReinitialisevoidReInit(InputStream stream, Charset encoding) ReinitialisevoidReinitialisefinal voidfinal voidfinal voidfinal voidsetStmt()final voidfinal voidfinal voidfinal voidshowStmt()final ClickHouseSqlStatement[]sql()final voidstmt()final voidstmts()final voidfinal voidtableClause(boolean record) final voidtableIdentifier(boolean record) final voidfinal booleanfinal voidfinal voidtxStmt()final voidfinal voiduseStmt()final Tokenvariable()final voidfinal voidfinal voidwithExpr()final void
-
Field Details
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token.
-
-
Constructor Details
-
ClickHouseSqlParser
-
ClickHouseSqlParser
Constructor with InputStream.- Parameters:
stream- input stream
-
ClickHouseSqlParser
Constructor with InputStream and supplied encoding- Parameters:
stream- input streamencoding- charset to be used
-
ClickHouseSqlParser
Constructor with InputStream.- Parameters:
stream- char stream
-
ClickHouseSqlParser
Constructor with generated Token Manager.- Parameters:
tm- Token manager to use
-
-
Method Details
-
parse
-
parse
public static ClickHouseSqlStatement[] parse(String sql, ClickHouseConfig config, ParseHandler handler) -
addStatement
public void addStatement() -
sql
- Throws:
ParseException
-
stmts
- Throws:
ParseException
-
stmt
- Throws:
ParseException
-
alterStmt
- Throws:
ParseException
-
clusterClause
- Throws:
ParseException
-
attachStmt
- Throws:
ParseException
-
checkStmt
- Throws:
ParseException
-
createStmt
- Throws:
ParseException
-
deleteStmt
- Throws:
ParseException
-
describeStmt
- Throws:
ParseException
-
detachStmt
- Throws:
ParseException
-
dropStmt
- Throws:
ParseException
-
existsStmt
- Throws:
ParseException
-
explainStmt
- Throws:
ParseException
-
grantStmt
- Throws:
ParseException
-
insertStmt
- Throws:
ParseException
-
dataClause
- Throws:
ParseException
-
killStmt
- Throws:
ParseException
-
optimizeStmt
- Throws:
ParseException
-
renameStmt
- Throws:
ParseException
-
revokeStmt
- Throws:
ParseException
-
selectStmt
- Throws:
ParseException
-
withClause
- Throws:
ParseException
-
topClause
- Throws:
ParseException
-
tableClause
- Throws:
ParseException
-
setStmt
- Throws:
ParseException
-
showStmt
- Throws:
ParseException
-
systemStmt
- Throws:
ParseException
-
truncateStmt
- Throws:
ParseException
-
updateStmt
- Throws:
ParseException
-
useStmt
- Throws:
ParseException
-
watchStmt
- Throws:
ParseException
-
txStmt
- Throws:
ParseException
-
columnExprList
- Throws:
ParseException
-
withExpr
- Throws:
ParseException
-
columnsExpr
- Throws:
ParseException
-
allColumnsExpr
- Throws:
ParseException
-
nestedExpr
- Throws:
ParseException
-
calcExpr
- Throws:
ParseException
-
betweenExpr
- Throws:
ParseException
-
functionExpr
- Throws:
ParseException
-
columnExpr
- Throws:
ParseException
-
compressionPart
- Throws:
ParseException
-
formatPart
- Throws:
ParseException
-
infilePart
- Throws:
ParseException
-
outfilePart
- Throws:
ParseException
-
settingsPart
- Throws:
ParseException
-
withTotalPart
- Throws:
ParseException
-
anyExprList
- Throws:
ParseException
-
anyExpr
- Throws:
ParseException
-
anyNestedExpr
- Throws:
ParseException
-
anyColumnExpr
- Throws:
ParseException
-
aliasExpr
- Throws:
ParseException
-
nestedIdentifier
- Throws:
ParseException
-
tableIdentifier
- Throws:
ParseException
-
databaseIdentifier
- Throws:
ParseException
-
settingExprList
- Throws:
ParseException
-
settingExpr
- Throws:
ParseException
-
anyIdentifier
- Throws:
ParseException
-
identifier
- Throws:
ParseException
-
interval
- Throws:
ParseException
-
literal
- Throws:
ParseException
-
dateLiteral
- Throws:
ParseException
-
numberLiteral
- Throws:
ParseException
-
operator
- Throws:
ParseException
-
macro
- Throws:
ParseException
-
variable
- Throws:
ParseException
-
anyKeyword
- Throws:
ParseException
-
keyword
- Throws:
ParseException
-
ReInit
Reinitialise- Parameters:
stream- input stream
-
ReInit
Reinitialise- Parameters:
stream- input streamencoding- charset to be used
-
ReInit
Reinitialise- Parameters:
stream- char stream
-
ReInit
Reinitialise- Parameters:
tm- Token manager to use
-
getNextToken
- Returns:
- the next Token.
-
getToken
- Parameters:
index- index to be retrieved- Returns:
- the specific Token.
-
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.
-