MCPcopy Create free account
hub / github.com/questdb/questdb / parse

Method parse

core/src/main/java/io/questdb/griffin/SqlParser.java:5430–5479  ·  view source on GitHub ↗
(GenericLexer lexer, SqlExecutionContext executionContext, SqlParserCallback sqlParserCallback)

Source from the content-addressed store, hash-verified

5428 }
5429
5430 ExecutionModel parse(GenericLexer lexer, SqlExecutionContext executionContext, SqlParserCallback sqlParserCallback) throws SqlException {
5431 final CharSequence tok = tok(lexer, "'create', 'rename' or 'select'");
5432
5433 if (isExplainKeyword(tok)) {
5434 int format = parseExplainOptions(lexer, tok);
5435 ExecutionModel model = parseExplain(lexer, executionContext, sqlParserCallback);
5436 ExplainModel explainModel = explainModelPool.next();
5437 explainModel.setFormat(format);
5438 explainModel.setModel(model);
5439 return explainModel;
5440 }
5441
5442 if (isSelectKeyword(tok)) {
5443 return parseSelect(lexer, sqlParserCallback, null);
5444 }
5445
5446 if (isCreateKeyword(tok)) {
5447 return parseCreate(lexer, executionContext, sqlParserCallback);
5448 }
5449
5450 if (isUpdateKeyword(tok)) {
5451 return parseUpdate(lexer, sqlParserCallback, null);
5452 }
5453
5454 if (isRenameKeyword(tok)) {
5455 return parseRenameStatement(lexer);
5456 }
5457
5458 if (isInsertKeyword(tok)) {
5459 return parseInsert(lexer, sqlParserCallback, null);
5460 }
5461
5462 if (isCopyKeyword(tok)) {
5463 return parseCopy(lexer, sqlParserCallback);
5464 }
5465
5466 if (isWithKeyword(tok)) {
5467 return parseWith(lexer, sqlParserCallback, null);
5468 }
5469
5470 if (isCompileKeyword(tok)) {
5471 return parseCompileView(lexer);
5472 }
5473
5474 if (isFromKeyword(tok)) {
5475 throw SqlException.$(lexer.lastTokenPosition(), "Did you mean 'select * from'?");
5476 }
5477
5478 return parseSelect(lexer, sqlParserCallback, null);
5479 }
5480
5481 IQueryModel parseAsSubQuery(
5482 GenericLexer lexer,

Callers

nothing calls this directly

Calls 15

tokMethod · 0.95
parseExplainOptionsMethod · 0.95
parseExplainMethod · 0.95
setFormatMethod · 0.95
setModelMethod · 0.95
parseSelectMethod · 0.95
parseCreateMethod · 0.95
parseUpdateMethod · 0.95
parseRenameStatementMethod · 0.95
parseInsertMethod · 0.95
parseCopyMethod · 0.95
parseWithMethod · 0.95

Tested by

no test coverage detected