Examples of ColumnDesc


Examples of co.cask.cdap.proto.ColumnDesc

  protected List<ColumnDesc> getResultSchemaInternal(OperationHandle operationHandle) throws SQLException {
    ImmutableList.Builder<ColumnDesc> listBuilder = ImmutableList.builder();
    if (operationHandle.hasResultSet()) {
      TableSchema tableSchema = cliService.getResultSetMetadata(operationHandle);
      for (ColumnDescriptor colDesc : tableSchema.getColumnDescriptors()) {
        listBuilder.add(new ColumnDesc(colDesc.getName(), colDesc.getTypeName(),
                                       colDesc.getOrdinalPosition(), colDesc.getComment()));
      }
    }
    return listBuilder.build();
  }
View Full Code Here

Examples of co.cask.cdap.proto.ColumnDesc

    if (status.hasResults()) {
      List<ColumnDesc> schema = queryClient.getSchema(queryHandle);
      String[] header = new String[schema.size()];
      for (int i = 0; i < header.length; i++) {
        ColumnDesc column = schema.get(i);
        // Hive columns start at 1
        int index = column.getPosition() - 1;
        header[index] = column.getName() + ": " + column.getType();
      }
      List<QueryResult> results = queryClient.getResults(queryHandle, 20);

      new AsciiTable<QueryResult>(header, results, new RowMaker<QueryResult>() {
        @Override
View Full Code Here

Examples of co.cask.cdap.proto.ColumnDesc

      throw new SQLException("Resultset is closed");
    }
    ImmutableList.Builder builder = ImmutableList.builder();
    for (int i = 0; i < schema.size(); i++) {
      ImmutablePair<String, String> pair = schema.get(i);
      builder.add(new ColumnDesc(pair.getFirst(), pair.getSecond(), i + 1, ""));
    }
    return new ExploreResultSetMetaData(builder.build());
  }
View Full Code Here

Examples of co.cask.cdap.proto.ColumnDesc

    return columnDescs.size();
  }

  @Override
  public int getColumnType(int column) throws SQLException {
    ColumnDesc desc = getColumnDesc(column);
    return JdbcColumn.hiveTypeToSqlType(desc.getType());
  }
View Full Code Here

Examples of co.cask.cdap.proto.ColumnDesc

    return JdbcColumn.hiveTypeToSqlType(desc.getType());
  }

  @Override
  public String getColumnTypeName(int column) throws SQLException {
    ColumnDesc desc = getColumnDesc(column);
    return JdbcColumn.getColumnTypeName(desc.getType());
  }
View Full Code Here

Examples of co.cask.cdap.proto.ColumnDesc

    return JdbcColumn.columnClassName(columnType);
  }

  @Override
  public String getColumnName(int column) throws SQLException {
    ColumnDesc desc = getColumnDesc(column);
    return desc.getName();
  }
View Full Code Here

Examples of co.cask.cdap.proto.ColumnDesc

  @Override
  public boolean isCaseSensitive(int column) throws SQLException {
    // Content of a column is case sensitive only if it is a string
    // This includes maps, arrays and structs, since they are passed as json
    ColumnDesc desc = getColumnDesc(column);
    if ("string".equalsIgnoreCase(desc.getType())) {
      return true;
    }
    return false;
  }
View Full Code Here

Examples of com.espertech.esper.epl.spec.ColumnDesc

        for (EsperEPL2GrammarParser.CreateColumnListElementContext colctx : ctx.createColumnListElement()) {
            List<EsperEPL2GrammarParser.ClassIdentifierContext> idents = colctx.classIdentifier();
            String name = ASTUtil.unescapeClassIdent(idents.get(0));
            String type = ASTUtil.unescapeClassIdent(idents.get(1));
            boolean array = colctx.b != null;
            result.add(new ColumnDesc(name, type, array));
        }
        return result;
    }
View Full Code Here

Examples of com.espertech.esper.epl.spec.ColumnDesc

                for (int i = 0; i < parent.getChildCount(); i++)
                {
                    String name = parent.getChild(i).getChild(0).getText();
                    String type = parent.getChild(i).getChild(1).getText();
                    boolean array = parent.getChild(i).getChildCount() > 2;
                    result.add(new ColumnDesc(name, type, array));
                }
            }
        }
        return result;
    }
View Full Code Here

Examples of org.kiji.schema.avro.ColumnDesc

        /** Columns with no ID assigned yet. */
        final List<ColumnLayout> unassigned = Lists.newArrayList();

        final Iterator<ColumnDesc> itColumnDesc = familyDesc.getColumns().iterator();
        while (itColumnDesc.hasNext()) {
          final ColumnDesc columnDesc = itColumnDesc.next();
          final boolean isRename = (columnDesc.getRenamedFrom() != null);
          final String refCName = isRename ? columnDesc.getRenamedFrom() : columnDesc.getName();
          columnDesc.setRenamedFrom(null);
          if (isRename && (reference == null)) {
            throw new InvalidLayoutException(String.format(
                "Invalid renaming: cannot find reference family for column '%s:%s'.",
                getName(), refCName));
          }
          final ColumnLayout refCLayout =
              (reference != null) ? reference.getColumnMap().get(refCName) : null;
          if (isRename && (refCLayout == null)) {
            throw new InvalidLayoutException(String.format(
                "Invalid renaming: cannot find column '%s:%s' in reference family.",
                getName(), refCName));
          }

          final ColumnId refCId = refCIdMap.remove(refCName);

          if (columnDesc.getDelete()) {
            if (refCId == null) {
              throw new InvalidLayoutException(String.format(
                  "Deleted column '%s:%s' does not exist in reference layout.",
                  mDesc.getName(), refCName));
            }
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.