public TableSchema(Schema schema) { this(schema.getFieldSchemas()); }
public Object getFieldValue(_Fields field) { switch (field) { case FIELD_SCHEMAS: return getFieldSchemas(); case PROPERTIES: return getProperties(); } throw new IllegalStateException(); }
public static HCatSchema getHCatSchema(Schema schema) throws HCatException { return getHCatSchema(schema.getFieldSchemas()); }
private Schema convertSchema(org.apache.hadoop.hive.metastore.api.Schema schema) { return new Schema(convertSchema(schema.getFieldSchemas())); }
/** * If enabled and applicable to this command, print the field headers * for the output. * * @param qp Driver that executed the command * @param out PrintStream which to send output to */ private void printHeader(IDriver qp, PrintStream out) { List<FieldSchema> fieldSchemas = qp.getSchema().getFieldSchemas(); if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_CLI_PRINT_HEADER) && fieldSchemas != null) { // Print the column names boolean first_col = true; for (FieldSchema fs : fieldSchemas) { if (!first_col) { out.print('\t'); } out.print(fs.getName()); first_col = false; } out.println(); } }
Schema mResultSchema = driver.getSchema(); List<FieldSchema> fieldSchemas = mResultSchema.getFieldSchemas(); StringBuilder namesSb = new StringBuilder(); StringBuilder typesSb = new StringBuilder();
private Schema convertSchema(Object obj) throws HiveException { org.apache.hadoop.hive.metastore.api.Schema schema = (org.apache.hadoop.hive.metastore.api.Schema) obj; List<FieldDesc> colDescs = new ArrayList<FieldDesc>(); for (FieldSchema fs : schema.getFieldSchemas()) { String colName = fs.getName(); String typeString = fs.getType(); TypeDesc typeDesc = convertTypeString(typeString); colDescs.add(new FieldDesc(colName, typeDesc)); } Schema Schema = new Schema(colDescs); return Schema; }
/** * Get a Schema with fields represented with Thrift DDL types */ public Schema getThriftSchema() throws Exception { Schema schema; try { schema = getSchema(); if (schema != null) { List<FieldSchema> lst = schema.getFieldSchemas(); // Go over the schema and convert type to thrift type if (lst != null) { for (FieldSchema f : lst) { f.setType(ColumnType.typeToThriftType(f.getType())); } } } } catch (Exception e) { e.printStackTrace(); throw e; } LOG.info("Returning Thrift schema: " + schema); return schema; }
/** * Get a Schema with fields represented with Thrift DDL types */ public Schema getThriftSchema() throws Exception { Schema schema; try { schema = getSchema(); if (schema != null) { List<FieldSchema> lst = schema.getFieldSchemas(); // Go over the schema and convert type to thrift type if (lst != null) { for (FieldSchema f : lst) { f.setType(MetaStoreUtils.typeToThriftType(f.getType())); } } } } catch (Exception e) { e.printStackTrace(); throw e; } LOG.info("Returning Thrift schema: " + schema); return schema; }
for (ObjectPair<SelectOperator, org.apache.hadoop.hive.ql.metadata.Table> pair: finalSelOps.values()) { List<FieldSchema> fieldSchemas = plan.getResultSchema().getFieldSchemas(); SelectOperator finalSelOp = pair.getFirst(); org.apache.hadoop.hive.ql.metadata.Table t = pair.getSecond();
for (ObjectPair<SelectOperator, org.apache.hadoop.hive.ql.metadata.Table> pair: finalSelOps.values()) { List<FieldSchema> fieldSchemas = plan.getResultSchema().getFieldSchemas(); SelectOperator finalSelOp = pair.getFirst(); org.apache.hadoop.hive.ql.metadata.Table t = pair.getSecond();
public TableSchema(Schema schema) { this(schema.getFieldSchemas()); }
public Object getFieldValue(_Fields field) { switch (field) { case FIELD_SCHEMAS: return getFieldSchemas(); case PROPERTIES: return getProperties(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case FIELD_SCHEMAS: return getFieldSchemas(); case PROPERTIES: return getProperties(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case FIELD_SCHEMAS: return getFieldSchemas(); case PROPERTIES: return getProperties(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case FIELD_SCHEMAS: return getFieldSchemas(); case PROPERTIES: return getProperties(); } throw new IllegalStateException(); }
public static HCatSchema getHCatSchema(Schema schema) throws HCatException { return getHCatSchema(schema.getFieldSchemas()); }
public static HCatSchema getHCatSchema(Schema schema) throws HCatException { return getHCatSchema(schema.getFieldSchemas()); }
@Override public List<ColumnMetadata> getMetadata() { ResultsMetadata metadata = databaseClient.getMetadata(handle); return metadata.schema.getFieldSchemas().stream().sequential() .map(fs -> new ColumnMetadata(fs.getName(), ColumnType.fromImpalaColumnType(fs.getType()))).collect(Collectors.toList()); }
public CocosQueryResultMetadata mapMetadata(ResultsMetadata resultsMetadata) { CocosQueryResultMetadata metadata = new CocosQueryResultMetadata(); for (FieldSchema column : resultsMetadata.getSchema().getFieldSchemas()) { metadata.getValues().add(column.getName() + " (" + column.getType() + ")"); } return metadata; }