Examples of DataTypeDescriptor


Examples of org.apache.derby.iapi.types.DataTypeDescriptor

   */

  public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
    throws StandardException
  {
    DataTypeDescriptor    dtd;
    ExecRow            row;
    DataValueDescriptor    col;
    String          name = null;
    UUID          uuid = null
    UUID          suuid = null;      // schema 
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

    int i;
    ExecIndexRow indexRow = getIndexRowTemplate();

    for (i = 0; i < baseColumnPositions.length; i++)
    {
      DataTypeDescriptor dtd =
        columnList.elementAt(baseColumnPositions[i] - 1).getType();
      indexRow.setColumn(i + 1, dtd.getNull());
    }

    indexRow.setColumn(i + 1, rowLocation);
    return indexRow;
  }
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

    int          position = 1;

    for (int index = 0; index < columnCount; index++)
    {
        ResultColumn rc = (ResultColumn) elementAt(index);
      DataTypeDescriptor dataType = rc.getTypeServices();
      DataValueDescriptor dataValue = dataType.getNull();

      row.setColumn( position++, dataValue );
    }

    return  row;
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

    ExecRow row = getExecutionFactory().getValueRow(baseCols.length + 1);

    for (int i = 0; i < baseCols.length; i++)
    {
      ColumnDescriptor coldes = td.getColumnDescriptor(baseCols[i]);
      DataTypeDescriptor dataType = coldes.getType();

      // rc = getResultColumn(baseCols[i]);
        // rc = (ResultColumn) at(baseCols[i] - 1);
      // dataType = rc.getTypeServices();
      DataValueDescriptor dataValue = dataType.getNull();

      row.setColumn(i + 1, dataValue );
    }

    RowLocation rlTemplate = scc.newRowLocationTemplate();
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

    for (int index = 0; index < size; index++)
    {
      ResultColumn resultColumn = (ResultColumn) elementAt(index);

      /* dts = resultColumn.getExpression().getTypeServices(); */
      DataTypeDescriptor dts = resultColumn.getTypeServices();

      /* Vectors are 0-based, VirtualColumnIds are 1-based */
      resultColumn.expression = (ValueNode) getNodeFactory().getNode(
              C_NodeTypes.VIRTUAL_COLUMN_NODE,
              sourceResultSet,
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

                                                     thisTypeId.getSQLTypeName(),
                                                     otherTypeId.getSQLTypeName(),
                                                     operatorName);
      }

      DataTypeDescriptor resultType = thisExpr.getTypeServices().getDominantType(
                        otherExpr.getTypeServices(),
                        cf);

      newCR = (ColumnReference) getNodeFactory().getNode(
                    C_NodeTypes.COLUMN_REFERENCE,
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

    int size = size();
    for (int index = 0; index < size; index++)
      {
        ResultColumn  rc = (ResultColumn) elementAt(index);
        ValueNode     expr = rc.getExpression();
        DataTypeDescriptor rcDTS = rc.getTypeServices();
        DataTypeDescriptor exDTS = expr.getTypeServices();

        if (rcDTS == null || exDTS == null)
        {
          isConsistent = false;
          break;
        }

        if (rcDTS.getClass().getName() !=
          exDTS.getClass().getName())
        {
          isConsistent = false;
          break;
        }
      }
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

          maxWidth = 0;
        }

        int precision = cti.isDecimalTypeId() ? rsmd.getPrecision(index) : 0;
        int scale = cti.isDecimalTypeId() ? rsmd.getScale(index) : 0;
        DataTypeDescriptor dts = new DataTypeDescriptor(cti,
                      precision,
                      scale,
                      nullableResult,
                      maxWidth);
        addColumn( tableName, rsmd.getColumnName(index), dts );
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

    }
  }


    private static boolean streamableType(ResultColumn rc) {
        DataTypeDescriptor dtd = rc.getType();
        TypeId s = TypeId.getBuiltInTypeId(dtd.getTypeName());

        if (s != null) {
            return s.streamStorable();
        } else {
            return false;
View Full Code Here

Examples of org.apache.derby.iapi.types.DataTypeDescriptor

        *  the left, since it won't match if it is any longer than it.
        */
        if (receiver.requiresTypeFromContext())
        {
            receiver.setType(
                new DataTypeDescriptor(
                    TypeId.getBuiltInTypeId(Types.VARCHAR), true));
            //check if this parameter can pick up it's collation from pattern
            //or escape clauses in that order. If not, then it will take it's
            //collation from the compilation schema.
            if (!leftOperand.requiresTypeFromContext()) {
                receiver.setCollationInfo(leftOperand.getTypeServices());

            } else if (rightOperand != null && !rightOperand.requiresTypeFromContext()) {
                receiver.setCollationInfo(rightOperand.getTypeServices());           
            } else {
          receiver.setCollationUsingCompilationSchema();             
            }
        }

        /*
         *  Is there a ? parameter for the PATTERN of LIKE? ie. "column like ?"
         * 
         *  Copy from the receiver -- legal if both are parameters,
         *  both will be max length.
         *  REMIND: should nullability be copied, or set to true?
         */
        if (leftOperand.requiresTypeFromContext())
        {
            /*
            * Set the pattern to the type of the left parameter, if
            * the left is a string, otherwise set it to be VARCHAR.
            */
            if (receiver.getTypeId().isStringTypeId())
            {
                leftOperand.setType(receiver.getTypeServices());
            }
            else
            {
                leftOperand.setType(
                    new DataTypeDescriptor(
                        TypeId.getBuiltInTypeId(Types.VARCHAR), true));
            }
      //collation of ? operand should be picked up from the context.
            //By the time we come here, receiver will have correct collation
            //set on it and hence we can rely on it to get correct collation
            //for the other ? in LIKE clause
            leftOperand.setCollationInfo(receiver.getTypeServices());           
        }

        /*
         *  Is there a ? parameter for the ESCAPE of LIKE?
         *  Copy from the receiver -- legal if both are parameters,
         *  both will be max length.  nullability is set to true.
         */

        if (rightOperand != null && rightOperand.requiresTypeFromContext())
        {
            /*
             * Set the pattern to the type of the left parameter, if
             * the left is a string, otherwise set it to be VARCHAR.
             */
            if (receiver.getTypeId().isStringTypeId())
            {
                rightOperand.setType(receiver.getTypeServices());
            }
            else
            {
                rightOperand.setType(
                    new DataTypeDescriptor(
                        TypeId.getBuiltInTypeId(Types.VARCHAR), true));
            }
      //collation of ? operand should be picked up from the context.
            //By the time we come here, receiver will have correct collation
            //set on it and hence we can rely on it to get correct collation
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.