Package com.salesforce.phoenix.compile

Examples of com.salesforce.phoenix.compile.QueryCompiler


            return lastQueryPlan = connection.getQueryServices().getOptimizer().optimize(this, PhoenixStatement.this);
        }
       
        @Override
        public StatementPlan compilePlan() throws SQLException {
            return new QueryCompiler(PhoenixStatement.this).compile(this);
        }
View Full Code Here


       
        @Override
        public ResultSetMetaData getResultSetMetaData() throws SQLException {
            if (resultSetMetaData == null) {
                // Just compile top level query without optimizing to get ResultSetMetaData
                QueryPlan plan = new QueryCompiler(PhoenixStatement.this).compile(this);
                resultSetMetaData = new PhoenixResultSetMetaData(connection, plan.getProjector());
            }
            return resultSetMetaData;
        }
View Full Code Here

    public QueryPlan optimize(SelectStatement select, PhoenixStatement statement) throws SQLException {
        return optimize(select, statement, Collections.<PColumn>emptyList(), null);
    }

    public QueryPlan optimize(SelectStatement select, PhoenixStatement statement, List<? extends PDatum> targetColumns, ParallelIteratorFactory parallelIteratorFactory) throws SQLException {
        QueryCompiler compiler = new QueryCompiler(statement, targetColumns, parallelIteratorFactory);
        QueryPlan dataPlan = compiler.compile(select);
        if (!useIndexes || select.getFrom().size() > 1) {
            return dataPlan;
        }
        // Get the statement as it's been normalized now
        // TODO: the recompile for the index tables could skip the normalize step
View Full Code Here

        String tableName = '"' + index.getTableName().getString() + '"';
        List<? extends TableNode> tables = Collections.singletonList(FACTORY.namedTable(alias, FACTORY.table(schemaName, tableName)));
        try {
            SelectStatement indexSelect = FACTORY.select(select, tables);           
            QueryCompiler compiler = new QueryCompiler(statement, targetColumns, parallelIteratorFactory);
            QueryPlan plan = compiler.compile(indexSelect);
            // Checking the index status and number of columns handles the wildcard cases correctly
            // We can't check the status earlier, because the index table may be out-of-date.
            if (plan.getTableRef().getTable().getIndexState() == PIndexState.ACTIVE && plan.getProjector().getColumnCount() == nColumns) {
                plans.add(plan);
                return true;
View Full Code Here

TOP

Related Classes of com.salesforce.phoenix.compile.QueryCompiler

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.