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

Method parse

server/src/main/java/io/crate/session/Session.java:337–355  ·  view source on GitHub ↗

Parses the input query string into a statement and saves it under the given statement name (if parsing was successful). The method expects a single statement in the provided query string.

(String statementName, String query, List<DataType<?>> paramTypes)

Source from the content-addressed store, hash-verified

335 * The method expects a single statement in the provided query string.
336 */
337 public void parse(String statementName, String query, List<DataType<?>> paramTypes) {
338 TimeoutToken timeoutToken = newTimeoutToken();
339 if (LOGGER.isDebugEnabled()) {
340 LOGGER.debug("method=parse stmtName={} query={} paramTypes={}", statementName, query, paramTypes);
341 }
342
343 validateStatementLength(query);
344
345 Statement statement;
346 try {
347 statement = SqlParser.createStatement(query);
348 } catch (Throwable t) {
349 jobsLogs.logPreExecutionFailure(UUIDs.dirtyUUID(), id, query, SQLExceptions.messageOf(t), sessionSettings.sessionUser());
350 throw t;
351 }
352 timeoutToken.check("parse");
353
354 analyze(statementName, statement, paramTypes, query, timeoutToken);
355 }
356
357 private void validateStatementLength(String query) {
358 if (query.length() > statementMaxLength) {

Calls 9

newTimeoutTokenMethod · 0.95
createStatementMethod · 0.95
dirtyUUIDMethod · 0.95
messageOfMethod · 0.95
checkMethod · 0.95
analyzeMethod · 0.95
sessionUserMethod · 0.80