You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ulrich Kramer (Jira)" <ji...@apache.org> on 2021/06/17 08:46:00 UTC

[jira] [Created] (CALCITE-4654) CloneSchema doesn't cache

Ulrich Kramer created CALCITE-4654:
--------------------------------------

             Summary: CloneSchema doesn't cache
                 Key: CALCITE-4654
                 URL: https://issues.apache.org/jira/browse/CALCITE-4654
             Project: Calcite
          Issue Type: Improvement
          Components: core
    Affects Versions: 1.27.0, 1.26.0
         Environment: All
            Reporter: Ulrich Kramer


{{CloneSchema}} doesn't really cache the content of the source schema.
During the preparation of a SQL statement {{CloneSchema.getTableMap}} is called several times and each time all tables are reloaded.

The following callstack shows the problem

{code}
<init>:69, ArrayTable {org.apache.calcite.adapter.clone}
createCloneTable:119, CloneSchema {org.apache.calcite.adapter.clone}
createCloneTable:88, CloneSchema {org.apache.calcite.adapter.clone}
getTableMap:76, CloneSchema {org.apache.calcite.adapter.clone}
getTable:95, AbstractSchema {org.apache.calcite.schema.impl}
getImplicitTable:146, CachingCalciteSchema {org.apache.calcite.jdbc}
getTable:295, CalciteSchema {org.apache.calcite.jdbc}
resolve_:145, EmptyScope {org.apache.calcite.sql.validate}
resolveTable:101, EmptyScope {org.apache.calcite.sql.validate}
resolveTable:214, DelegatingScope {org.apache.calcite.sql.validate}
resolveImpl:116, IdentifierNamespace {org.apache.calcite.sql.validate}
validateImpl:188, IdentifierNamespace {org.apache.calcite.sql.validate}
validate:89, AbstractNamespace {org.apache.calcite.sql.validate}
validateNamespace:1098, SqlValidatorImpl {org.apache.calcite.sql.validate}
validateQuery:1069, SqlValidatorImpl {org.apache.calcite.sql.validate}
validateFrom:3380, SqlValidatorImpl {org.apache.calcite.sql.validate}
validateFrom:3362, SqlValidatorImpl {org.apache.calcite.sql.validate}
validateSelect:3644, SqlValidatorImpl {org.apache.calcite.sql.validate}
validateImpl:64, SelectNamespace {org.apache.calcite.sql.validate}
validate:89, AbstractNamespace {org.apache.calcite.sql.validate}
validateNamespace:1098, SqlValidatorImpl {org.apache.calcite.sql.validate}
validateQuery:1069, SqlValidatorImpl {org.apache.calcite.sql.validate}
validate:247, SqlSelect {org.apache.calcite.sql}
validateScopedExpression:1044, SqlValidatorImpl {org.apache.calcite.sql.validate}
validate:750, SqlValidatorImpl {org.apache.calcite.sql.validate}
convertQuery:585, SqlToRelConverter {org.apache.calcite.sql2rel}
prepareSql:251, Prepare {org.apache.calcite.prepare}
prepareSql:215, Prepare {org.apache.calcite.prepare}
prepare2_:647, CalcitePrepareImpl {org.apache.calcite.prepare}
prepare_:513, CalcitePrepareImpl {org.apache.calcite.prepare}
prepareSql:483, CalcitePrepareImpl {org.apache.calcite.prepare}
parseQuery:249, CalciteConnectionImpl {org.apache.calcite.jdbc}
prepareAndExecute:623, CalciteMetaImpl {org.apache.calcite.jdbc}
prepareAndExecuteInternal:675, AvaticaConnection {org.apache.calcite.avatica}
executeInternal:156, AvaticaStatement {org.apache.calcite.avatica}
executeQuery:227, AvaticaStatement {org.apache.calcite.avatica}
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)