Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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");
Expand All @@ -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");
Expand Down