Package com.facebook.presto.sql.analyzer

Examples of com.facebook.presto.sql.analyzer.FeaturesConfig


    private final JsonCodec<ViewDefinition> viewCodec;

    @VisibleForTesting
    public MetadataManager()
    {
        this(new FeaturesConfig(), new TypeRegistry(), new SystemTablesMetadata());
    }
View Full Code Here


        // sys schema
        SystemTablesMetadata systemTablesMetadata = new SystemTablesMetadata();
        SystemSplitManager systemSplitManager = new SystemSplitManager(nodeManager);
        SystemRecordSetProvider systemRecordSetProvider = new SystemRecordSetProvider();

        this.metadata = new MetadataManager(new FeaturesConfig().setExperimentalSyntaxEnabled(true), typeRegistry, systemTablesMetadata);
        this.splitManager = new SplitManager(systemSplitManager);
        this.pageSourceManager = new PageSourceManager(systemRecordSetProvider);

        SystemTablesManager systemTablesManager = new SystemTablesManager(systemTablesMetadata, systemSplitManager, systemRecordSetProvider, ImmutableSet.<SystemTable>of());
View Full Code Here

        Statement statement = sqlParser.createStatement(sql);

        assertFormattedSql(sqlParser, statement);

        PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();
        FeaturesConfig featuresConfig = new FeaturesConfig()
                .setExperimentalSyntaxEnabled(true)
                .setDistributedIndexJoinsEnabled(false);
        PlanOptimizersFactory planOptimizersFactory = new PlanOptimizersFactory(metadata, sqlParser, splitManager, indexManager, featuresConfig);

        QueryExplainer queryExplainer = new QueryExplainer(session, planOptimizersFactory.get(), metadata, sqlParser, featuresConfig.isExperimentalSyntaxEnabled(), featuresConfig.isDistributedIndexJoinsEnabled(), featuresConfig.isDistributedJoinsEnabled());
        Analyzer analyzer = new Analyzer(session, metadata, sqlParser, Optional.of(queryExplainer), featuresConfig.isExperimentalSyntaxEnabled());

        Analysis analysis = analyzer.analyze(statement);

        Plan plan = new LogicalPlanner(session, planOptimizersFactory.get(), idAllocator, metadata).plan(analysis);
        if (printPlan) {
            System.out.println(PlanPrinter.textLogicalPlan(plan.getRoot(), plan.getTypes(), metadata));
        }

        SubPlan subplan = new DistributedLogicalPlanner(session, metadata, idAllocator).createSubPlans(plan, true, featuresConfig.isDistributedIndexJoinsEnabled(), featuresConfig.isDistributedJoinsEnabled());
        if (!subplan.getChildren().isEmpty()) {
            throw new AssertionError("Expected subplan to have no children");
        }

        LocalExecutionPlanner executionPlanner = new LocalExecutionPlanner(
View Full Code Here

        return explainer.getGraphvizPlan(sqlParser.createStatement(query), planType);
    }

    private QueryExplainer getQueryExplainer()
    {
        Metadata metadata = new MetadataManager(new FeaturesConfig().setExperimentalSyntaxEnabled(true), new TypeRegistry());
        FeaturesConfig featuresConfig = new FeaturesConfig().setExperimentalSyntaxEnabled(true);
        List<PlanOptimizer> optimizers = new PlanOptimizersFactory(metadata, sqlParser, new SplitManager(), new IndexManager(), featuresConfig).get();
        return new QueryExplainer(queryRunner.getDefaultSession(), optimizers, metadata, sqlParser, featuresConfig.isExperimentalSyntaxEnabled());
    }
View Full Code Here

    {
        this.session = checkNotNull(session, "session is null");
        this.executor = checkNotNull(executor, "executor is null");

        this.nodeManager = new InMemoryNodeManager();
        this.metadata = new MetadataManager(new FeaturesConfig().setExperimentalSyntaxEnabled(true));
        this.splitManager = new SplitManager(ImmutableSet.<ConnectorSplitManager>of());
        this.dataStreamProvider = new DataStreamManager();
        this.recordSinkManager = new RecordSinkManager();
        this.storageManager = MockLocalStorageManager.createMockLocalStorageManager();
View Full Code Here

        if (printPlan) {
            assertFormattedSql(statement);
        }

        PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();
        FeaturesConfig featuresConfig = new FeaturesConfig().setExperimentalSyntaxEnabled(true);
        PlanOptimizersFactory planOptimizersFactory = new PlanOptimizersFactory(metadata, splitManager, featuresConfig);

        QueryExplainer queryExplainer = new QueryExplainer(session, planOptimizersFactory.get(), metadata, featuresConfig.isExperimentalSyntaxEnabled());
        Analyzer analyzer = new Analyzer(session, metadata, Optional.of(queryExplainer), featuresConfig.isExperimentalSyntaxEnabled());

        Analysis analysis = analyzer.analyze(statement);

        Plan plan = new LogicalPlanner(session, planOptimizersFactory.get(), idAllocator, metadata).plan(analysis);
        if (printPlan) {
View Full Code Here

        columnHandle = dualMetadata.getColumnHandle(tableHandle, DualMetadata.COLUMN_NAME);
        assertNotNull(columnHandle, "columnHandle is null");
        symbol = new Symbol(DualMetadata.COLUMN_NAME);

        MetadataManager metadata = new MetadataManager(new FeaturesConfig());
        metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, dualMetadata);

        DualSplitManager dualSplitManager = new DualSplitManager(new InMemoryNodeManager());
        PartitionResult partitionResult = dualSplitManager.getPartitions(tableHandle, TupleDomain.all());
View Full Code Here

        ColumnHandle columnHandle = dualMetadata.getColumnHandle(tableHandle, DualMetadata.COLUMN_NAME);
        assertNotNull(columnHandle, "columnHandle is null");
        Symbol symbol = new Symbol(DualMetadata.COLUMN_NAME);

        MetadataManager metadata = new MetadataManager(new FeaturesConfig());
        metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, dualMetadata);

        DualSplitManager dualSplitManager = new DualSplitManager(new InMemoryNodeManager());
        PartitionResult partitionResult = dualSplitManager.getPartitions(tableHandle, TupleDomain.all());
View Full Code Here

        return explainer.getGraphvizPlan(SqlParser.createStatement(query), planType);
    }

    private QueryExplainer getQueryExplainer()
    {
        MetadataManager metadata = new MetadataManager(new FeaturesConfig().setExperimentalSyntaxEnabled(true));
        metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, new DualMetadata());
        SplitManager splitManager = new SplitManager(ImmutableSet.<ConnectorSplitManager>of(new DualSplitManager(new InMemoryNodeManager())));
        FeaturesConfig featuresConfig = new FeaturesConfig().setExperimentalSyntaxEnabled(true);
        List<PlanOptimizer> optimizers = new PlanOptimizersFactory(metadata, splitManager, featuresConfig).get();
        return new QueryExplainer(session, optimizers, metadata, featuresConfig.isExperimentalSyntaxEnabled());
    }
View Full Code Here

    @BeforeMethod
    public void setUp()
            throws Exception
    {
        metadata = new MetadataManager(new FeaturesConfig());
        metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, new DualMetadata());

    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.sql.analyzer.FeaturesConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.