This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit d52528bbfb831db11e0030c272e6b16171989062 Author: morningman <morning...@163.com> AuthorDate: Sat Mar 11 20:25:17 2023 +0800 [fix](json) fix json_reader case sensitive cherry-pick part of #17093 --- .../src/main/java/org/apache/doris/analysis/DataDescription.java | 8 ++++++-- fe/fe-core/src/main/java/org/apache/doris/load/Load.java | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/DataDescription.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/DataDescription.java index 8ef496b9a6..4755825d40 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/DataDescription.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/DataDescription.java @@ -901,7 +901,7 @@ public class DataDescription { // Change all the columns name to lower case, because Doris column is case-insensitive. private void columnsNameToLowerCase(List<String> columns) { - if (columns == null || columns.isEmpty()) { + if (columns == null || columns.isEmpty() || "json".equals(this.fileFormat)) { return; } for (int i = 0; i < columns.size(); i++) { @@ -991,7 +991,11 @@ public class DataDescription { if (!mappingColNames.contains(column.getName())) { parsedColumnExprList.add(new ImportColumnDesc(column.getName(), null)); } - fileFieldNames.add(column.getName().toLowerCase()); + if ("json".equals(this.fileFormat)) { + fileFieldNames.add(column.getName()); + } else { + fileFieldNames.add(column.getName().toLowerCase()); + } } LOG.debug("after fill column info. columns: {}, parsed column exprs: {}", fileFieldNames, parsedColumnExprList); diff --git a/fe/fe-core/src/main/java/org/apache/doris/load/Load.java b/fe/fe-core/src/main/java/org/apache/doris/load/Load.java index ed669fac2e..c200528847 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/load/Load.java +++ b/fe/fe-core/src/main/java/org/apache/doris/load/Load.java @@ -859,7 +859,12 @@ public class Load { if (hasSequenceCol && column.isSequenceColumn()) { continue; } - ImportColumnDesc columnDesc = new ImportColumnDesc(column.getName().toLowerCase()); + ImportColumnDesc columnDesc = null; + if (formatType == TFileFormatType.FORMAT_JSON) { + columnDesc = new ImportColumnDesc(column.getName()); + } else { + columnDesc = new ImportColumnDesc(column.getName().toLowerCase()); + } LOG.debug("add base column {} to stream load task", column.getName()); copiedColumnExprs.add(columnDesc); } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org