Examples of TInstance


Examples of com.foundationdb.server.types.TInstance

        AkibanAppender appender = AkibanAppender.of(buffer);
        buffer.append('(');
        boolean first = true;
        for (int i = 0, pEvalsSize = pEvaluatableExpressions.size(); i < pEvalsSize; i++) {
            ValueSource evaluation = value(i);
            TInstance type = rowType.typeAt(i);
            if (first) {
                first = false;
            } else {
                buffer.append(", ");
            }
            if (type != null) {
                type.format(evaluation, appender);
            } else {
                buffer.append("NULL");
            }
        }
        buffer.append(')');
View Full Code Here

Examples of com.foundationdb.server.types.TInstance

    }

    private static RowType rowTypeNew(RowType rowType1, RowType rowType2) {
        TInstance[] types = new TInstance[rowType1.nFields()];
        for(int i=0; i<types.length; ++i) {
            TInstance type1 = rowType1.typeAt(i);
            TInstance type2 = rowType2.typeAt(i);
            if (Objects.equal(type1, type2))
                types[i] = type1;
            else if (type1 == null)
                types[i] = type2;
            else if (type2 == null)
View Full Code Here

Examples of com.foundationdb.server.types.TInstance

                        return null;
                    tClass = typesList.next();
                } while (!TypeValidator.isSupportedForColumn(tClass));
               
                boolean indexable = TypeValidator.isSupportedForIndex(tClass);
                TInstance type = tClass.instance(true);
                PostgresType pgType = PostgresType.fromTInstance(type);
               
                String bundle = tClass.name().bundleId().name();
                String category = tClass.name().categoryName();
                String name = tClass.name().unqualifiedName();
View Full Code Here

Examples of com.foundationdb.server.types.TInstance

        public void visit(IndexColumn indexColumn) {
            Index index = indexColumn.getIndex();
            boolean nonPointSpatialIndex =
                index.isSpatial() &&
                index.firstSpatialArgument() == index.lastSpatialArgument();
            TInstance columnType = indexColumn.getColumn().getType();
            if (!(!nonPointSpatialIndex && TypeValidator.isSupportedForIndex(columnType) ||
                  nonPointSpatialIndex && TypeValidator.isSupportedForNonPiontSpatialIndex(columnType))) {
                failures.reportFailure(new AISValidationFailure (
                        new UnsupportedIndexDataTypeException (
                                new TableName (index.getIndexName().getSchemaName(),
View Full Code Here

Examples of com.foundationdb.server.types.TInstance

     */
    @Override
    public int compareTo(Row row, int leftStartIndex, int rightStartIndex, int fieldCount)
    {
        for (int i = 0; i < fieldCount; i++) {
            TInstance leftType = rowType().typeAt(leftStartIndex + i);
            ValueSource leftValue = value(leftStartIndex + i);
            TInstance rightType = ((Row)row).rowType().typeAt(rightStartIndex + i);
            ValueSource rightValue = row.value(rightStartIndex + i);
            int c = TClass.compare(leftType, leftValue, rightType, rightValue);
            if (c != 0) return (c < 0) ? -(i + 1) : (i + 1);
        }
        return 0;
View Full Code Here

Examples of com.foundationdb.server.types.TInstance

    }


    private ValueSource checkValueType(int i, ValueSource nextValue) {
        if (DEBUG_ROWTYPE) {
            TInstance nextValueType = nextValue.getType();
            TInstance expectedTInst = rowType().typeAt(i);
            if (expectedTInst == null && !nextValue.isNull())
                throw new RowType.InconsistentRowTypeException(i, nextValue.getObject());
            if (TInstance.tClass(nextValueType) != TInstance.tClass(expectedTInst))
                throw new RowType.InconsistentRowTypeException(i, expectedTInst, nextValueType, nextValue);
        }
View Full Code Here

Examples of com.foundationdb.server.types.TInstance

    }

    static void addColumn (final AISBuilder builder, final String schemaName,
                           final String tableName, int colpos, final String columnName,
                           final TypesTranslator typesTranslator, final DataTypeDescriptor d) {
        TInstance type = typesTranslator.typeForSQLType(d,
                schemaName, tableName, columnName);
        builder.column(schemaName, tableName, columnName,
                colpos, type, false, null, null);
    }
View Full Code Here

Examples of com.foundationdb.server.types.TInstance

    static void addColumn(final AISBuilder builder, final TypesTranslator typesTranslator,
                          final String schemaName, final String tableName, final String columnName,
                          int colpos, DataTypeDescriptor sqlType,
                          final String defaultValue, final String defaultFunction) {
        TInstance type = typesTranslator.typeForSQLType(sqlType,
                schemaName, tableName, columnName);
        builder.column(schemaName, tableName, columnName,
                       colpos, type, false, defaultValue, defaultFunction);
    }
View Full Code Here

Examples of com.foundationdb.server.types.TInstance

        if (result.getParameterTypes() != null) {
            List<ParameterType> jdbcParams = new ArrayList<>();
            for (BasePlannable.ParameterType paramType : result.getParameterTypes()) {
                int jdbcType = Types.OTHER;
                DataTypeDescriptor sqlType = paramType.getSQLType();
                TInstance type = paramType.getType();
                if (type != null) {
                    jdbcType = TInstance.tClass(type).jdbcType();
                }
                else if (sqlType != null) {
                    jdbcType = sqlType.getJDBCTypeId();
View Full Code Here

Examples of com.foundationdb.server.types.TInstance

        // decimals and strings get truncated, collation doesn't match, etc.
        if (paramTypes != null && false) {
            for (ParameterNode param : params) {
                int paramno = param.getParameterNumber();
                if (paramno < paramTypes.length) {
                    TInstance type = null;
                    try {
                        type = server.typesTranslator().typeClassForJDBCType(PostgresType.toJDBC(paramTypes[paramno])).instance(true);
                    }
                    catch (UnknownDataTypeException ex) {
                        server.warnClient(ex);
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.