final CreateTableEntry createTableEntry = context.getCatalog() .resolveCatalog(SystemUser.SYSTEM_USERNAME) .createNewTable(new NamespaceKey(storeTable), WriterOptions.DEFAULT, storageOptions);
ExpansionHelper(QueryContext context) { this.context = Preconditions.checkNotNull(context, "query context required"); converter = new SqlConverter( context.getPlannerSettings(), context.getOperatorTable(), context, MaterializationDescriptorProvider.EMPTY, context.getFunctionRegistry(), context.getSession(), AbstractAttemptObserver.NOOP, context.getCatalog(), context.getSubstitutionProviderFactory(), context.getConfig(), context.getScanResult()); }
final CreateTableEntry createTableEntry = context.getCatalog() .resolveCatalog(SystemUser.SYSTEM_USERNAME) .createNewTable(new NamespaceKey(storeTable), writerOptions, storageOptions);
final RelNode intermediateNode = transform(config, PlannerType.VOLCANO, PlannerPhase.LOGICAL, preLog, logicalTraits, true); final Catalog catalog = config.getContext().getCatalog(); if (catalog instanceof CachingCatalog) { config.getObserver().tablesCollected(catalog.getAllRequestedTables());
final RelNode queryRelNode = convertedRelNode.getConvertedNode(); final RelNode newViewRelNode = SqlHandlerUtil.resolveNewTableRel(true, createView.getFieldNames(), validatedRowType, queryRelNode); Catalog catalog = config.getContext().getCatalog(); NamespaceKey viewPath = catalog.resolveSingle(createView.getPath()); NamespaceKey defaultSchema = catalog.getDefaultSchema(); final DremioTable existingTable = config.getContext().getCatalog().getTableNoResolve(viewPath); List<String> viewContext = defaultSchema == null ? null : defaultSchema.getPathComponents(); config.getContext().getCatalog().updateView(viewPath, view); replaced = true; } else { config.getContext().getCatalog().createView(viewPath, view);
Iterable<DremioTable> requestedTables = sqlHandlerConfig.getContext().getCatalog().getAllRequestedTables();
final long ringCount = config.getContext().getOptions().getOption(PlannerSettings.RING_COUNT); final Rel writerDrel = new WriterRel(drel.getCluster(), drel.getCluster().traitSet().plus(Rel.LOGICAL), drel, config.getContext().getCatalog().createNewTable( new NamespaceKey(ReflectionUtils.getMaterializationPath(newMaterialization)), getWriterOptions((int) ringCount, goal, fields), ImmutableMap.of()),
optionManager.getOption(PlannerSettings.INCLUDE_DATASET_PROFILE), this.queryContext.getCatalog());
private SqlConverter getNewConverter(QueryContext context, SqlQuery query, AttemptObserver observerForSubstitution) { Catalog catalog = context.getCatalog(); final List<String> sqlContext = query.getContext(); if(sqlContext != null){ NamespaceKey path = new NamespaceKey(sqlContext); try { catalog = catalog.resolveCatalog(path); } catch (Exception e) { throw UserException.validationError(e) .message("Unable to resolve schema path [%s]. Failure resolving [%s] portion of path.", sqlContext, path) .build(logger); } } return new SqlConverter( context.getPlannerSettings(), context.getOperatorTable(), context, context.getMaterializationProvider(), context.getFunctionRegistry(), context.getSession(), observerForSubstitution, catalog, context.getSubstitutionProviderFactory(), context.getConfig(), context.getScanResult()); }
drel, config.getContext().getCatalog().createNewTable( new NamespaceKey(tablePath), getWriterOptions(0, goal, fields), ImmutableMap.of()
queryContext.getSession(), observer, queryContext.getCatalog(), queryContext.getSubstitutionProviderFactory(), queryContext.getConfig(),
protected ElasticsearchGroupScan generate(String sql) throws Exception { AttemptObserver observer = new PassthroughQueryObserver(ExecTest.mockUserClientConnection(null)); SqlConverter converter = new SqlConverter(context.getPlannerSettings(), context.getOperatorTable(), context, context.getMaterializationProvider(), context.getFunctionRegistry(), context.getSession(), observer, context.getCatalog(), context.getSubstitutionProviderFactory(), context.getConfig(), context.getScanResult()); SqlNode node = converter.parse(sql); SqlHandlerConfig config = new SqlHandlerConfig(context, converter, observer, null); NormalHandler handler = new NormalHandler(); PhysicalPlan plan = handler.getPlan(config, sql, node); List<PhysicalOperator> operators = plan.getSortedOperators(); ElasticsearchGroupScan scan = find(operators); assertNotNull("Physical plan does not contain an elasticsearch scan for query: " + sql, scan); return scan; }
queryContext.getSession(), observer, queryContext.getCatalog(), queryContext.getSubstitutionProviderFactory(), queryContext.getConfig(),
final Catalog catalog = config.getContext().getCatalog(); final NamespaceKey path = catalog.resolveSingle(sqlCreateTable.getPath()); DremioTable table = catalog.getTableNoResolve(path);
context.getSession(), observer, context.getCatalog(), context.getSubstitutionProviderFactory(), context.getConfig(), final Catalog catalog = context.getCatalog(); final SqlNode sqlNode = parser.parse(sql); final SqlHandlerConfig config = new SqlHandlerConfig(context, parser, observer, parser.getMaterializations());