public List<FieldSchema> getCols() { boolean getColsFromSerDe = SerDeUtils.shouldGetColsFromSerDe( getSerializationLib()); if (!getColsFromSerDe) { return tTable.getSd().getCols(); } else { try { return Hive.getFieldsFromDeserializer(getTableName(), getDeserializer()); } catch (HiveException e) { LOG.error("Unable to get field from serde: " + getSerializationLib(), e); } return new ArrayList<FieldSchema>(); } }
|| !SerDeUtils.shouldGetColsFromSerDe(crtTblDesc.getSerName())) { throw new SemanticException(ErrorMsg.INVALID_TBL_DDL_SERDE.getMsg());
throw new UnknownTableException(e.getMessage()); boolean getColsFromSerDe = SerDeUtils.shouldGetColsFromSerDe( tbl.getSd().getSerdeInfo().getSerializationLib()); if (!getColsFromSerDe) {
public List<FieldSchema> get_fields(String db, String tableName) throws MetaException, UnknownTableException, UnknownDBException { startFunction("get_fields", ": db=" + db + "tbl=" + tableName); String[] names = tableName.split("\\."); String base_table_name = names[0]; Table tbl; try { try { tbl = get_table(db, base_table_name); } catch (NoSuchObjectException e) { throw new UnknownTableException(e.getMessage()); } boolean getColsFromSerDe = SerDeUtils.shouldGetColsFromSerDe( tbl.getSd().getSerdeInfo().getSerializationLib()); if (!getColsFromSerDe) { return tbl.getSd().getCols(); } else { try { Deserializer s = MetaStoreUtils.getDeserializer(hiveConf, tbl); return MetaStoreUtils.getFieldsFromDeserializer(tableName, s); } catch (SerDeException e) { StringUtils.stringifyException(e); throw new MetaException(e.getMessage()); } } } finally { endFunction("get_fields"); } }