Package com.foundationdb.sql.optimizer.plan.ResultSet

Examples of com.foundationdb.sql.optimizer.plan.ResultSet.ResultField


                }
            }
            if (name == null) {
                name = "_SQL_COL_" + (i + 1); // Cf. SQLParser.generateColumnName()
            }
            return new ResultField(name, type, column);
        }
View Full Code Here


        // does not currently support.
        protected List<PhysicalResultColumn> getResultColumns(int ncols) {
            List<PhysicalResultColumn> columns =
                new ArrayList<>(ncols);
            for (int i = 0; i < ncols; i++) {
                columns.add(rulesContext.getResultColumn(new ResultField("column" + (i+1))));
            }
            return columns;
        }
View Full Code Here

            if (rsFields == null) return;
            TypedPlan typedInput = findTypedPlanNode(n);
            if (typedInput != null) {
                assert rsFields.size() == typedInput.nFields() : rsFields + " not applicable to " + typedInput;
                for (int i = 0, size = rsFields.size(); i < size; i++) {
                    ResultField rsField = rsFields.get(i);
                    rsField.setType(typedInput.getTypeAt(i));
                }
            }
            else {
                logger.warn("no Project node found for result fields: {}", n);
            }
View Full Code Here

                TInstance projectInst = typesTranslator.typeForSQLType(projectType);

                leftProject.applyCast(i, projectType, projectInst);
                rightProject.applyCast(i, projectType, projectInst);

                ResultField leftField = leftResult.getFields().get(i);
                ResultField rightField = rightResult.getFields().get(i);
                String name = null;
                if (leftField.getName() != null && rightField.getName() != null)
                    name = leftField.getName();
                else if (leftField.getName() != null)
                    name = leftField.getName();
                else if (rightField.getName() != null)
                    name = rightField.getName();

                Column column = null;
                // If both side of the setPlan reference the same column, use it, else null
                if (leftField.getColumn() != null && rightField.getColumn() != null &&
                        leftField.getColumn() == rightField.getColumn())
                    column = leftField.getColumn();

                fields.add(new ResultField(name, projectType, column));
                fields.get(i).setType(typesTranslator.typeForSQLType(projectType));
            }

            setPlan.setResults(fields);
View Full Code Here

TOP

Related Classes of com.foundationdb.sql.optimizer.plan.ResultSet.ResultField

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.