Package org.apache.tajo.common.TajoDataTypes

Examples of org.apache.tajo.common.TajoDataTypes.Type


   */
  private ColumnProto indexResultToColumnProto(final ResultSet res) throws SQLException {
    ColumnProto.Builder builder = ColumnProto.newBuilder();
    builder.setName(res.getString("column_name").trim());

    Type type = getDataType(res.getString("data_type").trim());
    builder.setDataType(CatalogUtil.newSimpleDataType(type));

    return builder.build();
  }
View Full Code Here


  private ColumnProto resultToColumnProto(final ResultSet res) throws SQLException {
    ColumnProto.Builder builder = ColumnProto.newBuilder();
    builder.setName(res.getString("column_name").trim());

    Type type = getDataType(res.getString("data_type").trim());
    int typeLength = res.getInt("type_length");
    if (typeLength > 0) {
      builder.setDataType(CatalogUtil.newDataTypeWithLen(type, typeLength));
    } else {
      builder.setDataType(CatalogUtil.newSimpleDataType(type));
View Full Code Here

      schema = new Schema();
      while (res.next()) {
        String columnName = tableName + "."
            + res.getString("column_name").trim();
        Type dataType = getDataType(res.getString("data_type")
            .trim());
        int typeLength = res.getInt("type_length");
        if (typeLength > 0) {
          schema.addColumn(columnName, dataType, typeLength);
        } else {
View Full Code Here

        schema = new Schema();
        while (res.next()) {
          String columnName = tableName + "."
              + res.getString("column_name").trim();
          Type dataType = getDataType(res.getString("data_type")
              .trim());
          int typeLength = res.getInt("type_length");
          if (typeLength > 0) {
            schema.addColumn(columnName, dataType, typeLength);
          } else {
View Full Code Here

      String functionName = function.getClass().getAnnotation(Description.class).functionName();
      String[] synonyms = function.getClass().getAnnotation(Description.class).synonyms();
      String description = function.getClass().getAnnotation(Description.class).description();
      String detail = function.getClass().getAnnotation(Description.class).detail();
      String example = function.getClass().getAnnotation(Description.class).example();
      Type returnType = function.getClass().getAnnotation(Description.class).returnType();
      ParamTypes[] paramArray = function.getClass().getAnnotation(Description.class).paramTypes();

      String[] allFunctionNames = null;
      if(synonyms != null && synonyms.length > 0) {
        allFunctionNames = new String[1 + synonyms.length];
View Full Code Here

      // Get a primitive type of the last defined parameter (array)
      TajoDataTypes.Type primitiveTypeOfLastDefinedParam =
          getPrimitiveTypeOf(definedTypes.get(definedTypes.size() - 1).getType());

      Type basisTypeOfVarLengthType = null;
      Type [] varLengthTypesOfGivenParams = new Type[paramDiff + 1]; // including last parameter
      for (int i = 0,j = (definedSize - 1); j < givenParamSize; i++, j++) {
        varLengthTypesOfGivenParams[i] = givenTypes.get(j).getType();

        // chooses one basis type for checking the variable part
View Full Code Here

   * @return True the parameter definition and invoked definition are compatible to each other
   */
  public static boolean checkIfMatchedNonVarLengthFunction(List<DataType> definedTypes, List<DataType> givenTypes,
                                                           int n, boolean lastArrayCompatible) {
    for (int i = 0; i < n; i++) {
      Type definedType = definedTypes.get(i).getType();
      Type givenType = givenTypes.get(i).getType();

      if (lastArrayCompatible) {
        if (!CatalogUtil.checkIfCompatibleIncludingArray(definedType, givenType)) {
          return false;
        }
View Full Code Here

   * @param definedTypes The parameter definition of a function.
   * @return True if the parameter definition can be variable length.
   */
  public static boolean checkIfVariableLengthParamDefinition(List<DataType> definedTypes) {
    // Get the last param type of the function definition.
    Type lastDefinedParamType = definedTypes.get(definedTypes.size() - 1).getType();

    // Check if this function is variable function.
    // if the last defined parameter is not array, it is not a variable length function. It will be false.
    return CatalogUtil.isArrayType(lastDefinedParamType);
  }
View Full Code Here

TOP

Related Classes of org.apache.tajo.common.TajoDataTypes.Type

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.