Skip to content

Commit 450869d

Browse files
author
gituser
committed
Merge branch 'hotfix_1.8_release_4.0.x_30414' into 1.8_release_4.0.x
2 parents cab2b8b + 3b8e7b8 commit 450869d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

flinkx-hive/flinkx-hive-writer/src/main/java/com/dtstack/flinkx/hive/writer/HiveOutputFormat.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,14 @@ public void closeInternal() throws IOException {
242242

243243
private Row setChannelInformation(Map<String, Object> event, Object channel, List<String> columns) {
244244
Row rowData = new Row(columns.size() + 1);
245+
//防止kafka column和 hive column大小写不一致,获取不到值 ,全部转为小写进行获取
246+
HashMap<Object, Object> newEvent = new HashMap<>(event.size() * 2);
247+
event.entrySet().forEach(data->{
248+
newEvent.put(data.getKey().toLowerCase(),data.getValue());
249+
});
250+
245251
for (int i = 0; i < columns.size(); i++) {
246-
rowData.setField(i, event.get(columns.get(i)));
252+
rowData.setField(i, newEvent.get(columns.get(i).toLowerCase()));
247253
}
248254
rowData.setField(rowData.getArity() - 1, channel);
249255
return rowData;

0 commit comments

Comments
 (0)