Examples of ResultField


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

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

        // 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

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

            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

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

                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

Examples of com.impossibl.postgres.protocol.ResultField

   * @return CompositeType of columns table
   * @throws SQLException If columnIndex is out of bounds
   */
  CompositeType getRelType(int columnIndex) throws SQLException {

    ResultField field = get(columnIndex);
    if (field.relationId == 0)
      return null;

    return connection.getRegistry().loadRelationType(field.relationId);
  }
View Full Code Here

Examples of com.impossibl.postgres.protocol.ResultField

   * @return CompositeType.Attribute of the requested column
   * @throws SQLException If columnIndex is out of bounds
   */
  CompositeType.Attribute getRelAttr(int columnIndex) throws SQLException {

    ResultField field = get(columnIndex);

    CompositeType relType = connection.getRegistry().loadRelationType(field.relationId);
    if (relType == null)
      return null;

View Full Code Here

Examples of com.impossibl.postgres.protocol.ResultField

  }

  @Override
  public boolean isAutoIncrement(int column) throws SQLException {

    ResultField field = get(column);
    CompositeType relType = connection.getRegistry().loadRelationType(field.relationId);

    return SQLTypeMetaData.isAutoIncrement(field.typeRef.get(), relType, field.relationAttributeNumber);
  }
View Full Code Here

Examples of com.impossibl.postgres.protocol.ResultField

  }

  @Override
  public int isNullable(int column) throws SQLException {

    ResultField field = get(column);
    CompositeType relType = connection.getRegistry().loadRelationType(field.relationId);

    return SQLTypeMetaData.isNullable(field.typeRef.get(), relType, field.relationAttributeNumber);
  }
View Full Code Here

Examples of com.impossibl.postgres.protocol.ResultField

    return attr.name;
  }

  @Override
  public int getColumnType(int column) throws SQLException {
    ResultField field = get(column);
    return getSQLType(field.typeRef.get());
  }
View Full Code Here

Examples of com.impossibl.postgres.protocol.ResultField

  }

  @Override
  public String getColumnTypeName(int column) throws SQLException {

    ResultField field = get(column);
    CompositeType relType = connection.getRegistry().loadRelationType(field.relationId);

    return SQLTypeMetaData.getTypeName(field.typeRef.get(), relType, field.relationAttributeNumber);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.