diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreClientHelper.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreClientHelper.java index a888bdff7ec092..9874c18c5b3f9c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreClientHelper.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreClientHelper.java @@ -97,7 +97,7 @@ public class HiveMetaStoreClientHelper { public static final String LEGACY_HIVE_JSON_SERDE = "org.apache.hadoop.hive.serde2.JsonSerDe"; public static final String OPENX_JSON_SERDE = "org.openx.data.jsonserde.JsonSerDe"; public static final String HIVE_TEXT_SERDE = "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"; - public static final String HIVE_CSV_SERDE = "org.apache.hadoop.hive.serde2.OpenCSVSerde"; + public static final String HIVE_OPEN_CSV_SERDE = "org.apache.hadoop.hive.serde2.OpenCSVSerde"; public static final String HIVE_MULTI_DELIMIT_SERDE = "org.apache.hadoop.hive.serde2.MultiDelimitSerDe"; public enum HiveFileFormat { diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java index 552bbd9156b235..933c3086bfe18c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java @@ -436,7 +436,7 @@ public TFileFormatType getFileFormatType() throws UserException { } } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_TEXT_SERDE)) { type = TFileFormatType.FORMAT_TEXT; - } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_CSV_SERDE)) { + } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_OPEN_CSV_SERDE)) { type = TFileFormatType.FORMAT_CSV_PLAIN; } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_MULTI_DELIMIT_SERDE)) { type = TFileFormatType.FORMAT_TEXT; @@ -490,7 +490,7 @@ protected TFileAttributes getFileAttributes() throws UserException { // TODO: support skip footer count fileAttributes.setSkipLines(HiveProperties.getSkipHeaderCount(table)); String serDeLib = table.getSd().getSerdeInfo().getSerializationLib(); - if (serDeLib.equals("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe") + if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_TEXT_SERDE) || serDeLib.equals(HiveMetaStoreClientHelper.HIVE_MULTI_DELIMIT_SERDE)) { TFileTextScanRangeParams textParams = new TFileTextScanRangeParams(); // set properties of LazySimpleSerDe and MultiDelimitSerDe @@ -511,7 +511,7 @@ protected TFileAttributes getFileAttributes() throws UserException { fileAttributes.setHeaderType(""); fileAttributes.setEnableTextValidateUtf8( sessionVariable.enableTextValidateUtf8); - } else if (serDeLib.equals("org.apache.hadoop.hive.serde2.OpenCSVSerde")) { + } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_OPEN_CSV_SERDE)) { TFileTextScanRangeParams textParams = new TFileTextScanRangeParams(); // set set properties of OpenCSVSerde // 1. set column separator @@ -531,7 +531,7 @@ protected TFileAttributes getFileAttributes() throws UserException { } fileAttributes.setEnableTextValidateUtf8( sessionVariable.enableTextValidateUtf8); - } else if (serDeLib.equals("org.apache.hive.hcatalog.data.JsonSerDe")) { + } else if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_JSON_SERDE)) { TFileTextScanRangeParams textParams = new TFileTextScanRangeParams(); textParams.setColumnSeparator("\t"); textParams.setLineDelimiter("\n"); @@ -544,7 +544,7 @@ protected TFileAttributes getFileAttributes() throws UserException { fileAttributes.setReadJsonByLine(true); fileAttributes.setStripOuterArray(false); fileAttributes.setHeaderType(""); - } else if (serDeLib.equals("org.openx.data.jsonserde.JsonSerDe")) { + } else if (serDeLib.equals(HiveMetaStoreClientHelper.OPENX_JSON_SERDE)) { if (!sessionVariable.isReadHiveJsonInOneColumn()) { TFileTextScanRangeParams textParams = new TFileTextScanRangeParams(); textParams.setColumnSeparator("\t");