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)
| 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) { |