use of com.alibaba.datax.plugin.writer.hdfswriter.SupportHiveDataType in project plugins by qlangtech.
the class BasicEngineJob method getCols.
private List<HiveColumn> getCols() {
// try {
// (List<Configuration>) TisDataXHiveWriter.jobColumnsField.get(this);
List<Configuration> cols = this.columns;
AtomicInteger index = new AtomicInteger();
return cols.stream().map((c) -> {
HiveColumn hivCol = new HiveColumn();
SupportHiveDataType columnType = SupportHiveDataType.valueOf(StringUtils.upperCase(c.getString(HdfsColMeta.KEY_TYPE)));
String name = StringUtils.remove(c.getString(HdfsColMeta.KEY_NAME), "`");
if (StringUtils.isBlank(name)) {
throw new IllegalStateException("col name can not be blank");
}
hivCol.setName(name);
hivCol.setType(columnType.name());
hivCol.setIndex(index.getAndIncrement());
return hivCol;
}).collect(Collectors.toList());
// } catch (IllegalAccessException e) {
// throw new RuntimeException(e);
// }
}
Aggregations