You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2021/01/04 03:42:46 UTC

[GitHub] [kylin] zhengshengjun commented on a change in pull request #1532: KYLIN-4853 QueryPreparedStatementCache invalid in Spark Query Engine.

zhengshengjun commented on a change in pull request #1532:
URL: https://github.com/apache/kylin/pull/1532#discussion_r551104943



##########
File path: server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java
##########
@@ -708,6 +708,22 @@ private SQLResponse queryWithSqlMassage(SQLRequest sqlRequest) throws Exception
                         borrowPrepareContext = false;
                         preparedContext = createPreparedContext(sqlRequest.getProject(), sqlRequest.getSql());
                     }
+
+                    // when SparkEngine enabled, Execution Plan was created from RelNode directly, RelNode should be cached
+                    if (getConfig().isSparkEngineEnabled()) {
+                        // preparedContext initialized by current thread, put relNode into cache
+                        if (preparedContext.olapRel == null) {
+                            preparedContext.olapRel = QueryContextFacade.current().getOlapRel();
+                            preparedContext.resultType = (QueryContextFacade.current().getResultType());

Review comment:
       NoSuchElementException will no be thrown, because PreparedContextFactory will create one




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org