@Test public void canParseSelectLiteralWithAlias() { assertNotNull(parser.parse("SELECT (1 + 2) * 3 AS expr")); }
public ParseTree parse(String query) { OpenDistroSQLLexer lexer = new OpenDistroSQLLexer(new CaseInsensitiveCharStream(query)); OpenDistroSQLParser parser = new OpenDistroSQLParser(new CommonTokenStream(lexer)); parser.addErrorListener(new SyntaxAnalysisErrorListener()); return parser.root(); }
SQLSyntaxParser { public ParseTree parse(String query) { OpenDistroSQLLexer lexer = new OpenDistroSQLLexer(new CaseInsensitiveCharStream(query)); OpenDistroSQLParser parser = new OpenDistroSQLParser(new CommonTokenStream(lexer)); parser.addErrorListener(new SyntaxAnalysisErrorListener()); return parser.root(); } }
SQLSyntaxParser { public ParseTree parse(String query) { OpenDistroSQLLexer lexer = new OpenDistroSQLLexer(new CaseInsensitiveCharStream(query)); OpenDistroSQLParser parser = new OpenDistroSQLParser(new CommonTokenStream(lexer)); parser.addErrorListener(new SyntaxAnalysisErrorListener()); return parser.root(); }  }
SQLSyntaxParser { public ParseTree parse(String query) { OpenDistroSQLLexer lexer = new OpenDistroSQLLexer(new CaseInsensitiveCharStream(query)); OpenDistroSQLParser parser = new OpenDistroSQLParser(new CommonTokenStream(lexer)); parser.addErrorListener(new SyntaxAnalysisErrorListener()); return parser.root(); }  ParseTree parse(String query); }
SQLSyntaxParser { public ParseTree parse(String query) { OpenDistroSQLLexer lexer = new OpenDistroSQLLexer(new CaseInsensitiveCharStream(query)); OpenDistroSQLParser parser = new OpenDistroSQLParser(new CommonTokenStream(lexer)); parser.addErrorListener(new SyntaxAnalysisErrorListener()); return parser.root(); }  ParseTree parse(String query);  }