public SqlConverter(SqlConverter parent, DremioCatalogReader catalog) { this.nestingLevel = parent.nestingLevel + 1; // since this is level 1 or deeper, we need to use system defaults instead of any overridden edge parser. this.parserConfig = parent.parserConfig.cloneWithSystemDefault(); this.substitutions = parent.substitutions; this.functions = parent.functions; this.session = parent.session; this.functionContext = parent.functionContext; this.isInnerQuery = true; this.observer = parent.observer; this.typeFactory = parent.typeFactory; this.costFactory = parent.costFactory; this.settings = parent.settings; this.flattenCounter = parent.flattenCounter; this.cluster = parent.cluster; this.catalogReader = catalog; this.opTab = parent.opTab; this.planner = parent.planner; this.materializations = parent.materializations; this.validator = new SqlValidatorImpl(parent.flattenCounter, opTab, catalog, typeFactory, DremioSqlConformance.INSTANCE); validator.setIdentifierExpansion(true); this.viewExpansionContext = parent.viewExpansionContext; this.config = parent.config; this.scanResult = parent.scanResult; }
this.opTab = new ChainedSqlOperatorTable(ImmutableList.<SqlOperatorTable>of(operatorTable, this.catalogReader)); this.costFactory = (settings.useDefaultCosting()) ? null : new DremioCost.Factory(); this.validator = new SqlValidatorImpl(flattenCounter, opTab, this.catalogReader, typeFactory, DremioSqlConformance.INSTANCE); validator.setIdentifierExpansion(true); this.materializations = new MaterializationList(this, session, materializationProvider);