mirror of
https://gitee.com/devlive-community/datacap.git
synced 2024-11-29 18:48:23 +08:00
Feature plugin kafka (#270)
This commit is contained in:
commit
edabab88c9
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -4,12 +4,29 @@ singleStatement:(statement)*;
|
||||
|
||||
SHOW: [Ss][Hh][Oo][Ww];
|
||||
PATHS: [Pp][Aa][Tt][Hh][Ss];
|
||||
TOPICS: 'TOPICS';
|
||||
CONSUMERS: 'CONSUMERS';
|
||||
SELECT: [Ss][Ee][Ll][Ee][Cc][Tt];
|
||||
FROM: [Ff][Rr][Oo][Mm];
|
||||
|
||||
statement
|
||||
: SHOW childPathStatement
|
||||
| SELECT columnStatement fromClause
|
||||
| kafkaStatement
|
||||
;
|
||||
|
||||
// -------------------- Kafka Statement --------------------
|
||||
kafkaQueryTopicStatement: SHOW TOPICS;
|
||||
kafkaQueryConsumerStatement
|
||||
: SHOW CONSUMERS
|
||||
| SHOW CONSUMERS fromClause
|
||||
;
|
||||
kafkaQueryStatement
|
||||
: kafkaQueryTopicStatement
|
||||
| kafkaQueryConsumerStatement
|
||||
;
|
||||
kafkaStatement
|
||||
: kafkaQueryStatement
|
||||
;
|
||||
|
||||
// SHOW PATHS, SHOW PATHS FROM ...
|
||||
|
@ -1,14 +1,18 @@
|
||||
T__0=1
|
||||
SHOW=2
|
||||
PATHS=3
|
||||
SELECT=4
|
||||
FROM=5
|
||||
STRING=6
|
||||
IDENTIFIER=7
|
||||
BACKQUOTED_IDENTIFIER=8
|
||||
SIMPLE_COMMENT=9
|
||||
BRACKETED_EMPTY_COMMENT=10
|
||||
BRACKETED_COMMENT=11
|
||||
WS=12
|
||||
TOPICS=4
|
||||
CONSUMERS=5
|
||||
SELECT=6
|
||||
FROM=7
|
||||
STRING=8
|
||||
IDENTIFIER=9
|
||||
BACKQUOTED_IDENTIFIER=10
|
||||
SIMPLE_COMMENT=11
|
||||
BRACKETED_EMPTY_COMMENT=12
|
||||
BRACKETED_COMMENT=13
|
||||
WS=14
|
||||
'.'=1
|
||||
'/**/'=10
|
||||
'TOPICS'=4
|
||||
'CONSUMERS'=5
|
||||
'/**/'=12
|
||||
|
@ -1,14 +1,18 @@
|
||||
T__0=1
|
||||
SHOW=2
|
||||
PATHS=3
|
||||
SELECT=4
|
||||
FROM=5
|
||||
STRING=6
|
||||
IDENTIFIER=7
|
||||
BACKQUOTED_IDENTIFIER=8
|
||||
SIMPLE_COMMENT=9
|
||||
BRACKETED_EMPTY_COMMENT=10
|
||||
BRACKETED_COMMENT=11
|
||||
WS=12
|
||||
TOPICS=4
|
||||
CONSUMERS=5
|
||||
SELECT=6
|
||||
FROM=7
|
||||
STRING=8
|
||||
IDENTIFIER=9
|
||||
BACKQUOTED_IDENTIFIER=10
|
||||
SIMPLE_COMMENT=11
|
||||
BRACKETED_EMPTY_COMMENT=12
|
||||
BRACKETED_COMMENT=13
|
||||
WS=14
|
||||
'.'=1
|
||||
'/**/'=10
|
||||
'TOPICS'=4
|
||||
'CONSUMERS'=5
|
||||
'/**/'=12
|
||||
|
@ -4,5 +4,8 @@ public enum SqlBaseToken
|
||||
{
|
||||
SHOW,
|
||||
PATHS,
|
||||
SELECT
|
||||
SELECT,
|
||||
// ------ Kafka ------
|
||||
TOPICS,
|
||||
CONSUMERS,
|
||||
}
|
||||
|
@ -60,7 +60,11 @@ public class SqlBaseVisitor
|
||||
int i = 0;
|
||||
for (; i < childCount; i++) {
|
||||
ParseTree child = statementContext.getChild(i);
|
||||
if (child instanceof SqlBaseParser.ColumnStatementContext) {
|
||||
/* Kafka Statement */
|
||||
if (child instanceof SqlBaseParser.KafkaStatementContext) {
|
||||
this.handlerWithKafkaStatement((SqlBaseParser.KafkaStatementContext) child);
|
||||
}
|
||||
else if (child instanceof SqlBaseParser.ColumnStatementContext) {
|
||||
configure.setColumns(Arrays.asList(child.getText()));
|
||||
}
|
||||
else if (child instanceof SqlBaseParser.FromClauseContext) {
|
||||
@ -90,6 +94,26 @@ public class SqlBaseVisitor
|
||||
}
|
||||
}
|
||||
|
||||
private void handlerWithKafkaStatement(SqlBaseParser.KafkaStatementContext context)
|
||||
{
|
||||
ParseTree node = context.getChild(0);
|
||||
if (node instanceof SqlBaseParser.KafkaQueryStatementContext) {
|
||||
ParseTree queryNode = node.getChild(0);
|
||||
if (queryNode instanceof SqlBaseParser.KafkaQueryTopicStatementContext | queryNode instanceof SqlBaseParser.KafkaQueryConsumerStatementContext) {
|
||||
int count = queryNode.getChildCount();
|
||||
this.applyToken(queryNode.getChild(0).getText(), false);
|
||||
this.applyToken(queryNode.getChild(1).getText(), true);
|
||||
// If the total number is greater than 2, the mark specifies the topic, which is the table name
|
||||
if (count > 2) {
|
||||
ParseTree fromNode = queryNode.getChild(count - 1);
|
||||
if (fromNode instanceof SqlBaseParser.FromClauseContext) {
|
||||
configure.setTable(fromNode.getChild(1).getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void applyToken(String token, boolean isChild)
|
||||
{
|
||||
try {
|
||||
|
@ -3,6 +3,8 @@ null
|
||||
'.'
|
||||
null
|
||||
null
|
||||
'TOPICS'
|
||||
'CONSUMERS'
|
||||
null
|
||||
null
|
||||
null
|
||||
@ -18,6 +20,8 @@ null
|
||||
null
|
||||
SHOW
|
||||
PATHS
|
||||
TOPICS
|
||||
CONSUMERS
|
||||
SELECT
|
||||
FROM
|
||||
STRING
|
||||
@ -31,6 +35,10 @@ WS
|
||||
rule names:
|
||||
singleStatement
|
||||
statement
|
||||
kafkaQueryTopicStatement
|
||||
kafkaQueryConsumerStatement
|
||||
kafkaQueryStatement
|
||||
kafkaStatement
|
||||
childPathStatement
|
||||
columnStatement
|
||||
fromClause
|
||||
@ -40,4 +48,4 @@ quotedIdentifier
|
||||
|
||||
|
||||
atn:
|
||||
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 14, 61, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 3, 2, 7, 2, 20, 10, 2, 12, 2, 14, 2, 23, 11, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 31, 10, 3, 3, 4, 3, 4, 3, 4, 5, 4, 36, 10, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 7, 7, 46, 10, 7, 12, 7, 14, 7, 49, 11, 7, 3, 8, 3, 8, 3, 8, 7, 8, 54, 10, 8, 12, 8, 14, 8, 57, 11, 8, 3, 9, 3, 9, 3, 9, 2, 2, 10, 2, 4, 6, 8, 10, 12, 14, 16, 2, 2, 2, 59, 2, 21, 3, 2, 2, 2, 4, 30, 3, 2, 2, 2, 6, 35, 3, 2, 2, 2, 8, 37, 3, 2, 2, 2, 10, 39, 3, 2, 2, 2, 12, 42, 3, 2, 2, 2, 14, 55, 3, 2, 2, 2, 16, 58, 3, 2, 2, 2, 18, 20, 5, 4, 3, 2, 19, 18, 3, 2, 2, 2, 20, 23, 3, 2, 2, 2, 21, 19, 3, 2, 2, 2, 21, 22, 3, 2, 2, 2, 22, 3, 3, 2, 2, 2, 23, 21, 3, 2, 2, 2, 24, 25, 7, 4, 2, 2, 25, 31, 5, 6, 4, 2, 26, 27, 7, 6, 2, 2, 27, 28, 5, 8, 5, 2, 28, 29, 5, 10, 6, 2, 29, 31, 3, 2, 2, 2, 30, 24, 3, 2, 2, 2, 30, 26, 3, 2, 2, 2, 31, 5, 3, 2, 2, 2, 32, 36, 7, 5, 2, 2, 33, 34, 7, 5, 2, 2, 34, 36, 5, 10, 6, 2, 35, 32, 3, 2, 2, 2, 35, 33, 3, 2, 2, 2, 36, 7, 3, 2, 2, 2, 37, 38, 5, 14, 8, 2, 38, 9, 3, 2, 2, 2, 39, 40, 7, 7, 2, 2, 40, 41, 5, 12, 7, 2, 41, 11, 3, 2, 2, 2, 42, 47, 5, 14, 8, 2, 43, 44, 7, 3, 2, 2, 44, 46, 5, 14, 8, 2, 45, 43, 3, 2, 2, 2, 46, 49, 3, 2, 2, 2, 47, 45, 3, 2, 2, 2, 47, 48, 3, 2, 2, 2, 48, 13, 3, 2, 2, 2, 49, 47, 3, 2, 2, 2, 50, 54, 7, 9, 2, 2, 51, 54, 7, 8, 2, 2, 52, 54, 5, 16, 9, 2, 53, 50, 3, 2, 2, 2, 53, 51, 3, 2, 2, 2, 53, 52, 3, 2, 2, 2, 54, 57, 3, 2, 2, 2, 55, 53, 3, 2, 2, 2, 55, 56, 3, 2, 2, 2, 56, 15, 3, 2, 2, 2, 57, 55, 3, 2, 2, 2, 58, 59, 7, 10, 2, 2, 59, 17, 3, 2, 2, 2, 8, 21, 30, 35, 47, 53, 55]
|
||||
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 16, 86, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 3, 2, 7, 2, 28, 10, 2, 12, 2, 14, 2, 31, 11, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 40, 10, 3, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 50, 10, 5, 3, 6, 3, 6, 5, 6, 54, 10, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 5, 8, 61, 10, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 7, 11, 71, 10, 11, 12, 11, 14, 11, 74, 11, 11, 3, 12, 3, 12, 3, 12, 7, 12, 79, 10, 12, 12, 12, 14, 12, 82, 11, 12, 3, 13, 3, 13, 3, 13, 2, 2, 14, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 2, 2, 2, 83, 2, 29, 3, 2, 2, 2, 4, 39, 3, 2, 2, 2, 6, 41, 3, 2, 2, 2, 8, 49, 3, 2, 2, 2, 10, 53, 3, 2, 2, 2, 12, 55, 3, 2, 2, 2, 14, 60, 3, 2, 2, 2, 16, 62, 3, 2, 2, 2, 18, 64, 3, 2, 2, 2, 20, 67, 3, 2, 2, 2, 22, 80, 3, 2, 2, 2, 24, 83, 3, 2, 2, 2, 26, 28, 5, 4, 3, 2, 27, 26, 3, 2, 2, 2, 28, 31, 3, 2, 2, 2, 29, 27, 3, 2, 2, 2, 29, 30, 3, 2, 2, 2, 30, 3, 3, 2, 2, 2, 31, 29, 3, 2, 2, 2, 32, 33, 7, 4, 2, 2, 33, 40, 5, 14, 8, 2, 34, 35, 7, 8, 2, 2, 35, 36, 5, 16, 9, 2, 36, 37, 5, 18, 10, 2, 37, 40, 3, 2, 2, 2, 38, 40, 5, 12, 7, 2, 39, 32, 3, 2, 2, 2, 39, 34, 3, 2, 2, 2, 39, 38, 3, 2, 2, 2, 40, 5, 3, 2, 2, 2, 41, 42, 7, 4, 2, 2, 42, 43, 7, 6, 2, 2, 43, 7, 3, 2, 2, 2, 44, 45, 7, 4, 2, 2, 45, 50, 7, 7, 2, 2, 46, 47, 7, 4, 2, 2, 47, 48, 7, 7, 2, 2, 48, 50, 5, 18, 10, 2, 49, 44, 3, 2, 2, 2, 49, 46, 3, 2, 2, 2, 50, 9, 3, 2, 2, 2, 51, 54, 5, 6, 4, 2, 52, 54, 5, 8, 5, 2, 53, 51, 3, 2, 2, 2, 53, 52, 3, 2, 2, 2, 54, 11, 3, 2, 2, 2, 55, 56, 5, 10, 6, 2, 56, 13, 3, 2, 2, 2, 57, 61, 7, 5, 2, 2, 58, 59, 7, 5, 2, 2, 59, 61, 5, 18, 10, 2, 60, 57, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 61, 15, 3, 2, 2, 2, 62, 63, 5, 22, 12, 2, 63, 17, 3, 2, 2, 2, 64, 65, 7, 9, 2, 2, 65, 66, 5, 20, 11, 2, 66, 19, 3, 2, 2, 2, 67, 72, 5, 22, 12, 2, 68, 69, 7, 3, 2, 2, 69, 71, 5, 22, 12, 2, 70, 68, 3, 2, 2, 2, 71, 74, 3, 2, 2, 2, 72, 70, 3, 2, 2, 2, 72, 73, 3, 2, 2, 2, 73, 21, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, 75, 79, 7, 11, 2, 2, 76, 79, 7, 10, 2, 2, 77, 79, 5, 24, 13, 2, 78, 75, 3, 2, 2, 2, 78, 76, 3, 2, 2, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 23, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 84, 7, 12, 2, 2, 84, 25, 3, 2, 2, 2, 10, 29, 39, 49, 53, 60, 72, 78, 80]
|
@ -35,6 +35,54 @@ public class SqlBaseBaseListener implements SqlBaseListener {
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitStatement(SqlBaseParser.StatementContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterKafkaQueryTopicStatement(SqlBaseParser.KafkaQueryTopicStatementContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitKafkaQueryTopicStatement(SqlBaseParser.KafkaQueryTopicStatementContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterKafkaQueryConsumerStatement(SqlBaseParser.KafkaQueryConsumerStatementContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitKafkaQueryConsumerStatement(SqlBaseParser.KafkaQueryConsumerStatementContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterKafkaQueryStatement(SqlBaseParser.KafkaQueryStatementContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitKafkaQueryStatement(SqlBaseParser.KafkaQueryStatementContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterKafkaStatement(SqlBaseParser.KafkaStatementContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitKafkaStatement(SqlBaseParser.KafkaStatementContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
|
@ -25,6 +25,34 @@ public class SqlBaseBaseVisitor<T> extends AbstractParseTreeVisitor<T> implement
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitStatement(SqlBaseParser.StatementContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitKafkaQueryTopicStatement(SqlBaseParser.KafkaQueryTopicStatementContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitKafkaQueryConsumerStatement(SqlBaseParser.KafkaQueryConsumerStatementContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitKafkaQueryStatement(SqlBaseParser.KafkaQueryStatementContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitKafkaStatement(SqlBaseParser.KafkaStatementContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
|
File diff suppressed because one or more lines are too long
@ -17,8 +17,9 @@ public class SqlBaseLexer extends Lexer {
|
||||
protected static final PredictionContextCache _sharedContextCache =
|
||||
new PredictionContextCache();
|
||||
public static final int
|
||||
T__0=1, SHOW=2, PATHS=3, SELECT=4, FROM=5, STRING=6, IDENTIFIER=7, BACKQUOTED_IDENTIFIER=8,
|
||||
SIMPLE_COMMENT=9, BRACKETED_EMPTY_COMMENT=10, BRACKETED_COMMENT=11, WS=12;
|
||||
T__0=1, SHOW=2, PATHS=3, TOPICS=4, CONSUMERS=5, SELECT=6, FROM=7, STRING=8,
|
||||
IDENTIFIER=9, BACKQUOTED_IDENTIFIER=10, SIMPLE_COMMENT=11, BRACKETED_EMPTY_COMMENT=12,
|
||||
BRACKETED_COMMENT=13, WS=14;
|
||||
public static String[] channelNames = {
|
||||
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
|
||||
};
|
||||
@ -29,23 +30,24 @@ public class SqlBaseLexer extends Lexer {
|
||||
|
||||
private static String[] makeRuleNames() {
|
||||
return new String[] {
|
||||
"T__0", "SHOW", "PATHS", "SELECT", "FROM", "DIGIT", "LETTER", "STRING",
|
||||
"IDENTIFIER", "BACKQUOTED_IDENTIFIER", "SIMPLE_COMMENT", "BRACKETED_EMPTY_COMMENT",
|
||||
"BRACKETED_COMMENT", "WS"
|
||||
"T__0", "SHOW", "PATHS", "TOPICS", "CONSUMERS", "SELECT", "FROM", "DIGIT",
|
||||
"LETTER", "STRING", "IDENTIFIER", "BACKQUOTED_IDENTIFIER", "SIMPLE_COMMENT",
|
||||
"BRACKETED_EMPTY_COMMENT", "BRACKETED_COMMENT", "WS"
|
||||
};
|
||||
}
|
||||
public static final String[] ruleNames = makeRuleNames();
|
||||
|
||||
private static String[] makeLiteralNames() {
|
||||
return new String[] {
|
||||
null, "'.'", null, null, null, null, null, null, null, null, "'/**/'"
|
||||
null, "'.'", null, null, "'TOPICS'", "'CONSUMERS'", null, null, null,
|
||||
null, null, null, "'/**/'"
|
||||
};
|
||||
}
|
||||
private static final String[] _LITERAL_NAMES = makeLiteralNames();
|
||||
private static String[] makeSymbolicNames() {
|
||||
return new String[] {
|
||||
null, null, "SHOW", "PATHS", "SELECT", "FROM", "STRING", "IDENTIFIER",
|
||||
"BACKQUOTED_IDENTIFIER", "SIMPLE_COMMENT", "BRACKETED_EMPTY_COMMENT",
|
||||
null, null, "SHOW", "PATHS", "TOPICS", "CONSUMERS", "SELECT", "FROM",
|
||||
"STRING", "IDENTIFIER", "BACKQUOTED_IDENTIFIER", "SIMPLE_COMMENT", "BRACKETED_EMPTY_COMMENT",
|
||||
"BRACKETED_COMMENT", "WS"
|
||||
};
|
||||
}
|
||||
@ -108,49 +110,58 @@ public class SqlBaseLexer extends Lexer {
|
||||
public ATN getATN() { return _ATN; }
|
||||
|
||||
public static final String _serializedATN =
|
||||
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\16\u0093\b\1\4\2"+
|
||||
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\20\u00a8\b\1\4\2"+
|
||||
"\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4"+
|
||||
"\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\3\2\3\2\3\3\3\3\3\3\3\3\3"+
|
||||
"\3\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6"+
|
||||
"\3\6\3\7\3\7\3\b\3\b\3\t\3\t\3\t\3\t\7\tA\n\t\f\t\16\tD\13\t\3\t\3\t\3"+
|
||||
"\t\3\t\3\t\7\tK\n\t\f\t\16\tN\13\t\3\t\3\t\5\tR\n\t\3\n\3\n\3\n\6\nW\n"+
|
||||
"\n\r\n\16\nX\3\13\3\13\3\13\3\13\7\13_\n\13\f\13\16\13b\13\13\3\13\3\13"+
|
||||
"\3\f\3\f\3\f\3\f\7\fj\n\f\f\f\16\fm\13\f\3\f\5\fp\n\f\3\f\5\fs\n\f\3\f"+
|
||||
"\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\7\16\u0083\n"+
|
||||
"\16\f\16\16\16\u0086\13\16\3\16\3\16\3\16\3\16\3\16\3\17\6\17\u008e\n"+
|
||||
"\17\r\17\16\17\u008f\3\17\3\17\3\u0084\2\20\3\3\5\4\7\5\t\6\13\7\r\2\17"+
|
||||
"\2\21\b\23\t\25\n\27\13\31\f\33\r\35\16\3\2\27\4\2UUuu\4\2JJjj\4\2QQq"+
|
||||
"q\4\2YYyy\4\2RRrr\4\2CCcc\4\2VVvv\4\2GGgg\4\2NNnn\4\2EEee\4\2HHhh\4\2"+
|
||||
"TTtt\4\2OOoo\3\2\62;\4\2C\\c|\4\2))^^\4\2$$^^\3\2bb\4\2\f\f\17\17\3\2"+
|
||||
"--\5\2\13\f\17\17\"\"\2\u00a0\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t"+
|
||||
"\3\2\2\2\2\13\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2"+
|
||||
"\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\3\37\3\2\2\2\5!\3\2\2\2\7"+
|
||||
"&\3\2\2\2\t,\3\2\2\2\13\63\3\2\2\2\r8\3\2\2\2\17:\3\2\2\2\21Q\3\2\2\2"+
|
||||
"\23V\3\2\2\2\25Z\3\2\2\2\27e\3\2\2\2\31v\3\2\2\2\33}\3\2\2\2\35\u008d"+
|
||||
"\3\2\2\2\37 \7\60\2\2 \4\3\2\2\2!\"\t\2\2\2\"#\t\3\2\2#$\t\4\2\2$%\t\5"+
|
||||
"\2\2%\6\3\2\2\2&\'\t\6\2\2\'(\t\7\2\2()\t\b\2\2)*\t\3\2\2*+\t\2\2\2+\b"+
|
||||
"\3\2\2\2,-\t\2\2\2-.\t\t\2\2./\t\n\2\2/\60\t\t\2\2\60\61\t\13\2\2\61\62"+
|
||||
"\t\b\2\2\62\n\3\2\2\2\63\64\t\f\2\2\64\65\t\r\2\2\65\66\t\4\2\2\66\67"+
|
||||
"\t\16\2\2\67\f\3\2\2\289\t\17\2\29\16\3\2\2\2:;\t\20\2\2;\20\3\2\2\2<"+
|
||||
"B\7)\2\2=A\n\21\2\2>?\7^\2\2?A\13\2\2\2@=\3\2\2\2@>\3\2\2\2AD\3\2\2\2"+
|
||||
"B@\3\2\2\2BC\3\2\2\2CE\3\2\2\2DB\3\2\2\2ER\7)\2\2FL\7$\2\2GK\n\22\2\2"+
|
||||
"HI\7^\2\2IK\13\2\2\2JG\3\2\2\2JH\3\2\2\2KN\3\2\2\2LJ\3\2\2\2LM\3\2\2\2"+
|
||||
"MO\3\2\2\2NL\3\2\2\2OR\7$\2\2PR\7,\2\2Q<\3\2\2\2QF\3\2\2\2QP\3\2\2\2R"+
|
||||
"\22\3\2\2\2SW\5\17\b\2TW\5\r\7\2UW\7a\2\2VS\3\2\2\2VT\3\2\2\2VU\3\2\2"+
|
||||
"\2WX\3\2\2\2XV\3\2\2\2XY\3\2\2\2Y\24\3\2\2\2Z`\7b\2\2[_\n\23\2\2\\]\7"+
|
||||
"b\2\2]_\7b\2\2^[\3\2\2\2^\\\3\2\2\2_b\3\2\2\2`^\3\2\2\2`a\3\2\2\2ac\3"+
|
||||
"\2\2\2b`\3\2\2\2cd\7b\2\2d\26\3\2\2\2ef\7/\2\2fg\7/\2\2gk\3\2\2\2hj\n"+
|
||||
"\24\2\2ih\3\2\2\2jm\3\2\2\2ki\3\2\2\2kl\3\2\2\2lo\3\2\2\2mk\3\2\2\2np"+
|
||||
"\7\17\2\2on\3\2\2\2op\3\2\2\2pr\3\2\2\2qs\7\f\2\2rq\3\2\2\2rs\3\2\2\2"+
|
||||
"st\3\2\2\2tu\b\f\2\2u\30\3\2\2\2vw\7\61\2\2wx\7,\2\2xy\7,\2\2yz\7\61\2"+
|
||||
"\2z{\3\2\2\2{|\b\r\2\2|\32\3\2\2\2}~\7\61\2\2~\177\7,\2\2\177\u0080\3"+
|
||||
"\2\2\2\u0080\u0084\n\25\2\2\u0081\u0083\13\2\2\2\u0082\u0081\3\2\2\2\u0083"+
|
||||
"\u0086\3\2\2\2\u0084\u0085\3\2\2\2\u0084\u0082\3\2\2\2\u0085\u0087\3\2"+
|
||||
"\2\2\u0086\u0084\3\2\2\2\u0087\u0088\7,\2\2\u0088\u0089\7\61\2\2\u0089"+
|
||||
"\u008a\3\2\2\2\u008a\u008b\b\16\2\2\u008b\34\3\2\2\2\u008c\u008e\t\26"+
|
||||
"\2\2\u008d\u008c\3\2\2\2\u008e\u008f\3\2\2\2\u008f\u008d\3\2\2\2\u008f"+
|
||||
"\u0090\3\2\2\2\u0090\u0091\3\2\2\2\u0091\u0092\b\17\2\2\u0092\36\3\2\2"+
|
||||
"\2\21\2@BJLQVX^`kor\u0084\u008f\3\2\3\2";
|
||||
"\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\3\2\3"+
|
||||
"\2\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5"+
|
||||
"\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3"+
|
||||
"\7\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\n\3\n\3\13\3\13\3\13\3\13\7\13V\n\13"+
|
||||
"\f\13\16\13Y\13\13\3\13\3\13\3\13\3\13\3\13\7\13`\n\13\f\13\16\13c\13"+
|
||||
"\13\3\13\3\13\5\13g\n\13\3\f\3\f\3\f\6\fl\n\f\r\f\16\fm\3\r\3\r\3\r\3"+
|
||||
"\r\7\rt\n\r\f\r\16\rw\13\r\3\r\3\r\3\16\3\16\3\16\3\16\7\16\177\n\16\f"+
|
||||
"\16\16\16\u0082\13\16\3\16\5\16\u0085\n\16\3\16\5\16\u0088\n\16\3\16\3"+
|
||||
"\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\7\20\u0098"+
|
||||
"\n\20\f\20\16\20\u009b\13\20\3\20\3\20\3\20\3\20\3\20\3\21\6\21\u00a3"+
|
||||
"\n\21\r\21\16\21\u00a4\3\21\3\21\3\u0099\2\22\3\3\5\4\7\5\t\6\13\7\r\b"+
|
||||
"\17\t\21\2\23\2\25\n\27\13\31\f\33\r\35\16\37\17!\20\3\2\27\4\2UUuu\4"+
|
||||
"\2JJjj\4\2QQqq\4\2YYyy\4\2RRrr\4\2CCcc\4\2VVvv\4\2GGgg\4\2NNnn\4\2EEe"+
|
||||
"e\4\2HHhh\4\2TTtt\4\2OOoo\3\2\62;\4\2C\\c|\4\2))^^\4\2$$^^\3\2bb\4\2\f"+
|
||||
"\f\17\17\3\2--\5\2\13\f\17\17\"\"\2\u00b5\2\3\3\2\2\2\2\5\3\2\2\2\2\7"+
|
||||
"\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\25\3\2\2"+
|
||||
"\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2"+
|
||||
"!\3\2\2\2\3#\3\2\2\2\5%\3\2\2\2\7*\3\2\2\2\t\60\3\2\2\2\13\67\3\2\2\2"+
|
||||
"\rA\3\2\2\2\17H\3\2\2\2\21M\3\2\2\2\23O\3\2\2\2\25f\3\2\2\2\27k\3\2\2"+
|
||||
"\2\31o\3\2\2\2\33z\3\2\2\2\35\u008b\3\2\2\2\37\u0092\3\2\2\2!\u00a2\3"+
|
||||
"\2\2\2#$\7\60\2\2$\4\3\2\2\2%&\t\2\2\2&\'\t\3\2\2\'(\t\4\2\2()\t\5\2\2"+
|
||||
")\6\3\2\2\2*+\t\6\2\2+,\t\7\2\2,-\t\b\2\2-.\t\3\2\2./\t\2\2\2/\b\3\2\2"+
|
||||
"\2\60\61\7V\2\2\61\62\7Q\2\2\62\63\7R\2\2\63\64\7K\2\2\64\65\7E\2\2\65"+
|
||||
"\66\7U\2\2\66\n\3\2\2\2\678\7E\2\289\7Q\2\29:\7P\2\2:;\7U\2\2;<\7W\2\2"+
|
||||
"<=\7O\2\2=>\7G\2\2>?\7T\2\2?@\7U\2\2@\f\3\2\2\2AB\t\2\2\2BC\t\t\2\2CD"+
|
||||
"\t\n\2\2DE\t\t\2\2EF\t\13\2\2FG\t\b\2\2G\16\3\2\2\2HI\t\f\2\2IJ\t\r\2"+
|
||||
"\2JK\t\4\2\2KL\t\16\2\2L\20\3\2\2\2MN\t\17\2\2N\22\3\2\2\2OP\t\20\2\2"+
|
||||
"P\24\3\2\2\2QW\7)\2\2RV\n\21\2\2ST\7^\2\2TV\13\2\2\2UR\3\2\2\2US\3\2\2"+
|
||||
"\2VY\3\2\2\2WU\3\2\2\2WX\3\2\2\2XZ\3\2\2\2YW\3\2\2\2Zg\7)\2\2[a\7$\2\2"+
|
||||
"\\`\n\22\2\2]^\7^\2\2^`\13\2\2\2_\\\3\2\2\2_]\3\2\2\2`c\3\2\2\2a_\3\2"+
|
||||
"\2\2ab\3\2\2\2bd\3\2\2\2ca\3\2\2\2dg\7$\2\2eg\7,\2\2fQ\3\2\2\2f[\3\2\2"+
|
||||
"\2fe\3\2\2\2g\26\3\2\2\2hl\5\23\n\2il\5\21\t\2jl\7a\2\2kh\3\2\2\2ki\3"+
|
||||
"\2\2\2kj\3\2\2\2lm\3\2\2\2mk\3\2\2\2mn\3\2\2\2n\30\3\2\2\2ou\7b\2\2pt"+
|
||||
"\n\23\2\2qr\7b\2\2rt\7b\2\2sp\3\2\2\2sq\3\2\2\2tw\3\2\2\2us\3\2\2\2uv"+
|
||||
"\3\2\2\2vx\3\2\2\2wu\3\2\2\2xy\7b\2\2y\32\3\2\2\2z{\7/\2\2{|\7/\2\2|\u0080"+
|
||||
"\3\2\2\2}\177\n\24\2\2~}\3\2\2\2\177\u0082\3\2\2\2\u0080~\3\2\2\2\u0080"+
|
||||
"\u0081\3\2\2\2\u0081\u0084\3\2\2\2\u0082\u0080\3\2\2\2\u0083\u0085\7\17"+
|
||||
"\2\2\u0084\u0083\3\2\2\2\u0084\u0085\3\2\2\2\u0085\u0087\3\2\2\2\u0086"+
|
||||
"\u0088\7\f\2\2\u0087\u0086\3\2\2\2\u0087\u0088\3\2\2\2\u0088\u0089\3\2"+
|
||||
"\2\2\u0089\u008a\b\16\2\2\u008a\34\3\2\2\2\u008b\u008c\7\61\2\2\u008c"+
|
||||
"\u008d\7,\2\2\u008d\u008e\7,\2\2\u008e\u008f\7\61\2\2\u008f\u0090\3\2"+
|
||||
"\2\2\u0090\u0091\b\17\2\2\u0091\36\3\2\2\2\u0092\u0093\7\61\2\2\u0093"+
|
||||
"\u0094\7,\2\2\u0094\u0095\3\2\2\2\u0095\u0099\n\25\2\2\u0096\u0098\13"+
|
||||
"\2\2\2\u0097\u0096\3\2\2\2\u0098\u009b\3\2\2\2\u0099\u009a\3\2\2\2\u0099"+
|
||||
"\u0097\3\2\2\2\u009a\u009c\3\2\2\2\u009b\u0099\3\2\2\2\u009c\u009d\7,"+
|
||||
"\2\2\u009d\u009e\7\61\2\2\u009e\u009f\3\2\2\2\u009f\u00a0\b\20\2\2\u00a0"+
|
||||
" \3\2\2\2\u00a1\u00a3\t\26\2\2\u00a2\u00a1\3\2\2\2\u00a3\u00a4\3\2\2\2"+
|
||||
"\u00a4\u00a2\3\2\2\2\u00a4\u00a5\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6\u00a7"+
|
||||
"\b\21\2\2\u00a7\"\3\2\2\2\21\2UW_afkmsu\u0080\u0084\u0087\u0099\u00a4"+
|
||||
"\3\2\3\2";
|
||||
public static final ATN _ATN =
|
||||
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
||||
static {
|
||||
|
@ -27,6 +27,46 @@ public interface SqlBaseListener extends ParseTreeListener {
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitStatement(SqlBaseParser.StatementContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link SqlBaseParser#kafkaQueryTopicStatement}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterKafkaQueryTopicStatement(SqlBaseParser.KafkaQueryTopicStatementContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link SqlBaseParser#kafkaQueryTopicStatement}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitKafkaQueryTopicStatement(SqlBaseParser.KafkaQueryTopicStatementContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link SqlBaseParser#kafkaQueryConsumerStatement}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterKafkaQueryConsumerStatement(SqlBaseParser.KafkaQueryConsumerStatementContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link SqlBaseParser#kafkaQueryConsumerStatement}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitKafkaQueryConsumerStatement(SqlBaseParser.KafkaQueryConsumerStatementContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link SqlBaseParser#kafkaQueryStatement}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterKafkaQueryStatement(SqlBaseParser.KafkaQueryStatementContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link SqlBaseParser#kafkaQueryStatement}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitKafkaQueryStatement(SqlBaseParser.KafkaQueryStatementContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link SqlBaseParser#kafkaStatement}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterKafkaStatement(SqlBaseParser.KafkaStatementContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link SqlBaseParser#kafkaStatement}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitKafkaStatement(SqlBaseParser.KafkaStatementContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link SqlBaseParser#childPathStatement}.
|
||||
* @param ctx the parse tree
|
||||
|
@ -17,15 +17,18 @@ public class SqlBaseParser extends Parser {
|
||||
protected static final PredictionContextCache _sharedContextCache =
|
||||
new PredictionContextCache();
|
||||
public static final int
|
||||
T__0=1, SHOW=2, PATHS=3, SELECT=4, FROM=5, STRING=6, IDENTIFIER=7, BACKQUOTED_IDENTIFIER=8,
|
||||
SIMPLE_COMMENT=9, BRACKETED_EMPTY_COMMENT=10, BRACKETED_COMMENT=11, WS=12;
|
||||
T__0=1, SHOW=2, PATHS=3, TOPICS=4, CONSUMERS=5, SELECT=6, FROM=7, STRING=8,
|
||||
IDENTIFIER=9, BACKQUOTED_IDENTIFIER=10, SIMPLE_COMMENT=11, BRACKETED_EMPTY_COMMENT=12,
|
||||
BRACKETED_COMMENT=13, WS=14;
|
||||
public static final int
|
||||
RULE_singleStatement = 0, RULE_statement = 1, RULE_childPathStatement = 2,
|
||||
RULE_columnStatement = 3, RULE_fromClause = 4, RULE_tableName = 5, RULE_identifier = 6,
|
||||
RULE_quotedIdentifier = 7;
|
||||
RULE_singleStatement = 0, RULE_statement = 1, RULE_kafkaQueryTopicStatement = 2,
|
||||
RULE_kafkaQueryConsumerStatement = 3, RULE_kafkaQueryStatement = 4, RULE_kafkaStatement = 5,
|
||||
RULE_childPathStatement = 6, RULE_columnStatement = 7, RULE_fromClause = 8,
|
||||
RULE_tableName = 9, RULE_identifier = 10, RULE_quotedIdentifier = 11;
|
||||
private static String[] makeRuleNames() {
|
||||
return new String[] {
|
||||
"singleStatement", "statement", "childPathStatement", "columnStatement",
|
||||
"singleStatement", "statement", "kafkaQueryTopicStatement", "kafkaQueryConsumerStatement",
|
||||
"kafkaQueryStatement", "kafkaStatement", "childPathStatement", "columnStatement",
|
||||
"fromClause", "tableName", "identifier", "quotedIdentifier"
|
||||
};
|
||||
}
|
||||
@ -33,14 +36,15 @@ public class SqlBaseParser extends Parser {
|
||||
|
||||
private static String[] makeLiteralNames() {
|
||||
return new String[] {
|
||||
null, "'.'", null, null, null, null, null, null, null, null, "'/**/'"
|
||||
null, "'.'", null, null, "'TOPICS'", "'CONSUMERS'", null, null, null,
|
||||
null, null, null, "'/**/'"
|
||||
};
|
||||
}
|
||||
private static final String[] _LITERAL_NAMES = makeLiteralNames();
|
||||
private static String[] makeSymbolicNames() {
|
||||
return new String[] {
|
||||
null, null, "SHOW", "PATHS", "SELECT", "FROM", "STRING", "IDENTIFIER",
|
||||
"BACKQUOTED_IDENTIFIER", "SIMPLE_COMMENT", "BRACKETED_EMPTY_COMMENT",
|
||||
null, null, "SHOW", "PATHS", "TOPICS", "CONSUMERS", "SELECT", "FROM",
|
||||
"STRING", "IDENTIFIER", "BACKQUOTED_IDENTIFIER", "SIMPLE_COMMENT", "BRACKETED_EMPTY_COMMENT",
|
||||
"BRACKETED_COMMENT", "WS"
|
||||
};
|
||||
}
|
||||
@ -128,17 +132,17 @@ public class SqlBaseParser extends Parser {
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(19);
|
||||
setState(27);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
while (_la==SHOW || _la==SELECT) {
|
||||
{
|
||||
{
|
||||
setState(16);
|
||||
setState(24);
|
||||
statement();
|
||||
}
|
||||
}
|
||||
setState(21);
|
||||
setState(29);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
}
|
||||
@ -167,6 +171,9 @@ public class SqlBaseParser extends Parser {
|
||||
public FromClauseContext fromClause() {
|
||||
return getRuleContext(FromClauseContext.class,0);
|
||||
}
|
||||
public KafkaStatementContext kafkaStatement() {
|
||||
return getRuleContext(KafkaStatementContext.class,0);
|
||||
}
|
||||
public StatementContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@ -190,31 +197,250 @@ public class SqlBaseParser extends Parser {
|
||||
StatementContext _localctx = new StatementContext(_ctx, getState());
|
||||
enterRule(_localctx, 2, RULE_statement);
|
||||
try {
|
||||
setState(28);
|
||||
setState(37);
|
||||
_errHandler.sync(this);
|
||||
switch (_input.LA(1)) {
|
||||
case SHOW:
|
||||
switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
|
||||
case 1:
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(22);
|
||||
setState(30);
|
||||
match(SHOW);
|
||||
setState(23);
|
||||
setState(31);
|
||||
childPathStatement();
|
||||
}
|
||||
break;
|
||||
case SELECT:
|
||||
case 2:
|
||||
enterOuterAlt(_localctx, 2);
|
||||
{
|
||||
setState(24);
|
||||
setState(32);
|
||||
match(SELECT);
|
||||
setState(25);
|
||||
setState(33);
|
||||
columnStatement();
|
||||
setState(26);
|
||||
setState(34);
|
||||
fromClause();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new NoViableAltException(this);
|
||||
case 3:
|
||||
enterOuterAlt(_localctx, 3);
|
||||
{
|
||||
setState(36);
|
||||
kafkaStatement();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class KafkaQueryTopicStatementContext extends ParserRuleContext {
|
||||
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
|
||||
public TerminalNode TOPICS() { return getToken(SqlBaseParser.TOPICS, 0); }
|
||||
public KafkaQueryTopicStatementContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_kafkaQueryTopicStatement; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterKafkaQueryTopicStatement(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitKafkaQueryTopicStatement(this);
|
||||
}
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor<? extends T>)visitor).visitKafkaQueryTopicStatement(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final KafkaQueryTopicStatementContext kafkaQueryTopicStatement() throws RecognitionException {
|
||||
KafkaQueryTopicStatementContext _localctx = new KafkaQueryTopicStatementContext(_ctx, getState());
|
||||
enterRule(_localctx, 4, RULE_kafkaQueryTopicStatement);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(39);
|
||||
match(SHOW);
|
||||
setState(40);
|
||||
match(TOPICS);
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class KafkaQueryConsumerStatementContext extends ParserRuleContext {
|
||||
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
|
||||
public TerminalNode CONSUMERS() { return getToken(SqlBaseParser.CONSUMERS, 0); }
|
||||
public FromClauseContext fromClause() {
|
||||
return getRuleContext(FromClauseContext.class,0);
|
||||
}
|
||||
public KafkaQueryConsumerStatementContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_kafkaQueryConsumerStatement; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterKafkaQueryConsumerStatement(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitKafkaQueryConsumerStatement(this);
|
||||
}
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor<? extends T>)visitor).visitKafkaQueryConsumerStatement(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final KafkaQueryConsumerStatementContext kafkaQueryConsumerStatement() throws RecognitionException {
|
||||
KafkaQueryConsumerStatementContext _localctx = new KafkaQueryConsumerStatementContext(_ctx, getState());
|
||||
enterRule(_localctx, 6, RULE_kafkaQueryConsumerStatement);
|
||||
try {
|
||||
setState(47);
|
||||
_errHandler.sync(this);
|
||||
switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) {
|
||||
case 1:
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(42);
|
||||
match(SHOW);
|
||||
setState(43);
|
||||
match(CONSUMERS);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
enterOuterAlt(_localctx, 2);
|
||||
{
|
||||
setState(44);
|
||||
match(SHOW);
|
||||
setState(45);
|
||||
match(CONSUMERS);
|
||||
setState(46);
|
||||
fromClause();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class KafkaQueryStatementContext extends ParserRuleContext {
|
||||
public KafkaQueryTopicStatementContext kafkaQueryTopicStatement() {
|
||||
return getRuleContext(KafkaQueryTopicStatementContext.class,0);
|
||||
}
|
||||
public KafkaQueryConsumerStatementContext kafkaQueryConsumerStatement() {
|
||||
return getRuleContext(KafkaQueryConsumerStatementContext.class,0);
|
||||
}
|
||||
public KafkaQueryStatementContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_kafkaQueryStatement; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterKafkaQueryStatement(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitKafkaQueryStatement(this);
|
||||
}
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor<? extends T>)visitor).visitKafkaQueryStatement(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final KafkaQueryStatementContext kafkaQueryStatement() throws RecognitionException {
|
||||
KafkaQueryStatementContext _localctx = new KafkaQueryStatementContext(_ctx, getState());
|
||||
enterRule(_localctx, 8, RULE_kafkaQueryStatement);
|
||||
try {
|
||||
setState(51);
|
||||
_errHandler.sync(this);
|
||||
switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) {
|
||||
case 1:
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(49);
|
||||
kafkaQueryTopicStatement();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
enterOuterAlt(_localctx, 2);
|
||||
{
|
||||
setState(50);
|
||||
kafkaQueryConsumerStatement();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class KafkaStatementContext extends ParserRuleContext {
|
||||
public KafkaQueryStatementContext kafkaQueryStatement() {
|
||||
return getRuleContext(KafkaQueryStatementContext.class,0);
|
||||
}
|
||||
public KafkaStatementContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_kafkaStatement; }
|
||||
@Override
|
||||
public void enterRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterKafkaStatement(this);
|
||||
}
|
||||
@Override
|
||||
public void exitRule(ParseTreeListener listener) {
|
||||
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitKafkaStatement(this);
|
||||
}
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor<? extends T>)visitor).visitKafkaStatement(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final KafkaStatementContext kafkaStatement() throws RecognitionException {
|
||||
KafkaStatementContext _localctx = new KafkaStatementContext(_ctx, getState());
|
||||
enterRule(_localctx, 10, RULE_kafkaStatement);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(53);
|
||||
kafkaQueryStatement();
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
@ -254,24 +480,24 @@ public class SqlBaseParser extends Parser {
|
||||
|
||||
public final ChildPathStatementContext childPathStatement() throws RecognitionException {
|
||||
ChildPathStatementContext _localctx = new ChildPathStatementContext(_ctx, getState());
|
||||
enterRule(_localctx, 4, RULE_childPathStatement);
|
||||
enterRule(_localctx, 12, RULE_childPathStatement);
|
||||
try {
|
||||
setState(33);
|
||||
setState(58);
|
||||
_errHandler.sync(this);
|
||||
switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) {
|
||||
switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
|
||||
case 1:
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(30);
|
||||
setState(55);
|
||||
match(PATHS);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
enterOuterAlt(_localctx, 2);
|
||||
{
|
||||
setState(31);
|
||||
setState(56);
|
||||
match(PATHS);
|
||||
setState(32);
|
||||
setState(57);
|
||||
fromClause();
|
||||
}
|
||||
break;
|
||||
@ -313,11 +539,11 @@ public class SqlBaseParser extends Parser {
|
||||
|
||||
public final ColumnStatementContext columnStatement() throws RecognitionException {
|
||||
ColumnStatementContext _localctx = new ColumnStatementContext(_ctx, getState());
|
||||
enterRule(_localctx, 6, RULE_columnStatement);
|
||||
enterRule(_localctx, 14, RULE_columnStatement);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(35);
|
||||
setState(60);
|
||||
identifier();
|
||||
}
|
||||
}
|
||||
@ -358,13 +584,13 @@ public class SqlBaseParser extends Parser {
|
||||
|
||||
public final FromClauseContext fromClause() throws RecognitionException {
|
||||
FromClauseContext _localctx = new FromClauseContext(_ctx, getState());
|
||||
enterRule(_localctx, 8, RULE_fromClause);
|
||||
enterRule(_localctx, 16, RULE_fromClause);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(37);
|
||||
setState(62);
|
||||
match(FROM);
|
||||
setState(38);
|
||||
setState(63);
|
||||
tableName();
|
||||
}
|
||||
}
|
||||
@ -407,26 +633,26 @@ public class SqlBaseParser extends Parser {
|
||||
|
||||
public final TableNameContext tableName() throws RecognitionException {
|
||||
TableNameContext _localctx = new TableNameContext(_ctx, getState());
|
||||
enterRule(_localctx, 10, RULE_tableName);
|
||||
enterRule(_localctx, 18, RULE_tableName);
|
||||
int _la;
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(40);
|
||||
setState(65);
|
||||
identifier();
|
||||
setState(45);
|
||||
setState(70);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
while (_la==T__0) {
|
||||
{
|
||||
{
|
||||
setState(41);
|
||||
setState(66);
|
||||
match(T__0);
|
||||
setState(42);
|
||||
setState(67);
|
||||
identifier();
|
||||
}
|
||||
}
|
||||
setState(47);
|
||||
setState(72);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
}
|
||||
@ -479,34 +705,34 @@ public class SqlBaseParser extends Parser {
|
||||
|
||||
public final IdentifierContext identifier() throws RecognitionException {
|
||||
IdentifierContext _localctx = new IdentifierContext(_ctx, getState());
|
||||
enterRule(_localctx, 12, RULE_identifier);
|
||||
enterRule(_localctx, 20, RULE_identifier);
|
||||
int _la;
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(53);
|
||||
setState(78);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << STRING) | (1L << IDENTIFIER) | (1L << BACKQUOTED_IDENTIFIER))) != 0)) {
|
||||
{
|
||||
setState(51);
|
||||
setState(76);
|
||||
_errHandler.sync(this);
|
||||
switch (_input.LA(1)) {
|
||||
case IDENTIFIER:
|
||||
{
|
||||
setState(48);
|
||||
setState(73);
|
||||
match(IDENTIFIER);
|
||||
}
|
||||
break;
|
||||
case STRING:
|
||||
{
|
||||
setState(49);
|
||||
setState(74);
|
||||
match(STRING);
|
||||
}
|
||||
break;
|
||||
case BACKQUOTED_IDENTIFIER:
|
||||
{
|
||||
setState(50);
|
||||
setState(75);
|
||||
quotedIdentifier();
|
||||
}
|
||||
break;
|
||||
@ -514,7 +740,7 @@ public class SqlBaseParser extends Parser {
|
||||
throw new NoViableAltException(this);
|
||||
}
|
||||
}
|
||||
setState(55);
|
||||
setState(80);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
}
|
||||
@ -554,11 +780,11 @@ public class SqlBaseParser extends Parser {
|
||||
|
||||
public final QuotedIdentifierContext quotedIdentifier() throws RecognitionException {
|
||||
QuotedIdentifierContext _localctx = new QuotedIdentifierContext(_ctx, getState());
|
||||
enterRule(_localctx, 14, RULE_quotedIdentifier);
|
||||
enterRule(_localctx, 22, RULE_quotedIdentifier);
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(56);
|
||||
setState(81);
|
||||
match(BACKQUOTED_IDENTIFIER);
|
||||
}
|
||||
}
|
||||
@ -574,22 +800,27 @@ public class SqlBaseParser extends Parser {
|
||||
}
|
||||
|
||||
public static final String _serializedATN =
|
||||
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\16=\4\2\t\2\4\3\t"+
|
||||
"\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\3\2\7\2\24\n\2\f\2"+
|
||||
"\16\2\27\13\2\3\3\3\3\3\3\3\3\3\3\3\3\5\3\37\n\3\3\4\3\4\3\4\5\4$\n\4"+
|
||||
"\3\5\3\5\3\6\3\6\3\6\3\7\3\7\3\7\7\7.\n\7\f\7\16\7\61\13\7\3\b\3\b\3\b"+
|
||||
"\7\b\66\n\b\f\b\16\b9\13\b\3\t\3\t\3\t\2\2\n\2\4\6\b\n\f\16\20\2\2\2;"+
|
||||
"\2\25\3\2\2\2\4\36\3\2\2\2\6#\3\2\2\2\b%\3\2\2\2\n\'\3\2\2\2\f*\3\2\2"+
|
||||
"\2\16\67\3\2\2\2\20:\3\2\2\2\22\24\5\4\3\2\23\22\3\2\2\2\24\27\3\2\2\2"+
|
||||
"\25\23\3\2\2\2\25\26\3\2\2\2\26\3\3\2\2\2\27\25\3\2\2\2\30\31\7\4\2\2"+
|
||||
"\31\37\5\6\4\2\32\33\7\6\2\2\33\34\5\b\5\2\34\35\5\n\6\2\35\37\3\2\2\2"+
|
||||
"\36\30\3\2\2\2\36\32\3\2\2\2\37\5\3\2\2\2 $\7\5\2\2!\"\7\5\2\2\"$\5\n"+
|
||||
"\6\2# \3\2\2\2#!\3\2\2\2$\7\3\2\2\2%&\5\16\b\2&\t\3\2\2\2\'(\7\7\2\2("+
|
||||
")\5\f\7\2)\13\3\2\2\2*/\5\16\b\2+,\7\3\2\2,.\5\16\b\2-+\3\2\2\2.\61\3"+
|
||||
"\2\2\2/-\3\2\2\2/\60\3\2\2\2\60\r\3\2\2\2\61/\3\2\2\2\62\66\7\t\2\2\63"+
|
||||
"\66\7\b\2\2\64\66\5\20\t\2\65\62\3\2\2\2\65\63\3\2\2\2\65\64\3\2\2\2\66"+
|
||||
"9\3\2\2\2\67\65\3\2\2\2\678\3\2\2\28\17\3\2\2\29\67\3\2\2\2:;\7\n\2\2"+
|
||||
";\21\3\2\2\2\b\25\36#/\65\67";
|
||||
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\20V\4\2\t\2\4\3\t"+
|
||||
"\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4"+
|
||||
"\f\t\f\4\r\t\r\3\2\7\2\34\n\2\f\2\16\2\37\13\2\3\3\3\3\3\3\3\3\3\3\3\3"+
|
||||
"\3\3\5\3(\n\3\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\5\5\62\n\5\3\6\3\6\5\6\66"+
|
||||
"\n\6\3\7\3\7\3\b\3\b\3\b\5\b=\n\b\3\t\3\t\3\n\3\n\3\n\3\13\3\13\3\13\7"+
|
||||
"\13G\n\13\f\13\16\13J\13\13\3\f\3\f\3\f\7\fO\n\f\f\f\16\fR\13\f\3\r\3"+
|
||||
"\r\3\r\2\2\16\2\4\6\b\n\f\16\20\22\24\26\30\2\2\2S\2\35\3\2\2\2\4\'\3"+
|
||||
"\2\2\2\6)\3\2\2\2\b\61\3\2\2\2\n\65\3\2\2\2\f\67\3\2\2\2\16<\3\2\2\2\20"+
|
||||
">\3\2\2\2\22@\3\2\2\2\24C\3\2\2\2\26P\3\2\2\2\30S\3\2\2\2\32\34\5\4\3"+
|
||||
"\2\33\32\3\2\2\2\34\37\3\2\2\2\35\33\3\2\2\2\35\36\3\2\2\2\36\3\3\2\2"+
|
||||
"\2\37\35\3\2\2\2 !\7\4\2\2!(\5\16\b\2\"#\7\b\2\2#$\5\20\t\2$%\5\22\n\2"+
|
||||
"%(\3\2\2\2&(\5\f\7\2\' \3\2\2\2\'\"\3\2\2\2\'&\3\2\2\2(\5\3\2\2\2)*\7"+
|
||||
"\4\2\2*+\7\6\2\2+\7\3\2\2\2,-\7\4\2\2-\62\7\7\2\2./\7\4\2\2/\60\7\7\2"+
|
||||
"\2\60\62\5\22\n\2\61,\3\2\2\2\61.\3\2\2\2\62\t\3\2\2\2\63\66\5\6\4\2\64"+
|
||||
"\66\5\b\5\2\65\63\3\2\2\2\65\64\3\2\2\2\66\13\3\2\2\2\678\5\n\6\28\r\3"+
|
||||
"\2\2\29=\7\5\2\2:;\7\5\2\2;=\5\22\n\2<9\3\2\2\2<:\3\2\2\2=\17\3\2\2\2"+
|
||||
">?\5\26\f\2?\21\3\2\2\2@A\7\t\2\2AB\5\24\13\2B\23\3\2\2\2CH\5\26\f\2D"+
|
||||
"E\7\3\2\2EG\5\26\f\2FD\3\2\2\2GJ\3\2\2\2HF\3\2\2\2HI\3\2\2\2I\25\3\2\2"+
|
||||
"\2JH\3\2\2\2KO\7\13\2\2LO\7\n\2\2MO\5\30\r\2NK\3\2\2\2NL\3\2\2\2NM\3\2"+
|
||||
"\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2Q\27\3\2\2\2RP\3\2\2\2ST\7\f\2\2T\31"+
|
||||
"\3\2\2\2\n\35\'\61\65<HNP";
|
||||
public static final ATN _ATN =
|
||||
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
||||
static {
|
||||
|
@ -22,6 +22,30 @@ public interface SqlBaseVisitor<T> extends ParseTreeVisitor<T> {
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitStatement(SqlBaseParser.StatementContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link SqlBaseParser#kafkaQueryTopicStatement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitKafkaQueryTopicStatement(SqlBaseParser.KafkaQueryTopicStatementContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link SqlBaseParser#kafkaQueryConsumerStatement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitKafkaQueryConsumerStatement(SqlBaseParser.KafkaQueryConsumerStatementContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link SqlBaseParser#kafkaQueryStatement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitKafkaQueryStatement(SqlBaseParser.KafkaQueryStatementContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link SqlBaseParser#kafkaStatement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitKafkaStatement(SqlBaseParser.KafkaStatementContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link SqlBaseParser#childPathStatement}.
|
||||
* @param ctx the parse tree
|
||||
|
@ -0,0 +1,26 @@
|
||||
package io.edurt.datacap.sql;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class KafkaParserTest
|
||||
{
|
||||
private String table = "aa";
|
||||
|
||||
@Test
|
||||
public void showTopic()
|
||||
{
|
||||
SqlBaseFormatter formatter = new SqlBaseFormatter("show topics");
|
||||
Assert.assertTrue(formatter.getParseResult().isSuccessful());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void showConsumers()
|
||||
{
|
||||
SqlBaseFormatter formatter = new SqlBaseFormatter("show Consumers");
|
||||
Assert.assertTrue(formatter.getParseResult().isSuccessful());
|
||||
|
||||
formatter = new SqlBaseFormatter("show Consumers from " + table);
|
||||
Assert.assertEquals(formatter.getParseResult().getTable(), table);
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "datacap-fe",
|
||||
"description": "DataCap console",
|
||||
"version": "1.6.0",
|
||||
"version": "1.7.0-SNAPSHOT",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
|
@ -58,6 +58,7 @@ export default defineComponent({
|
||||
methods: {
|
||||
handlerInitialize()
|
||||
{
|
||||
this.dataTreeArray = [];
|
||||
this.loading = true;
|
||||
MangerService.getDatabases(this.id)
|
||||
.then(response => {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<artifactId>datacap</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>datacap</artifactId>
|
||||
<groupId>io.edurt.datacap</groupId>
|
||||
<version>1.6.0</version>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
Loading…
Reference in New Issue
Block a user