This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 4ee9d60f5a [fix](tvf)Correct the code style for modifying static
variables of a class (#24701)
4ee9d60f5a is described below
commit 4ee9d60f5ae2df8348c6470ea9d619cd1c28ea8f
Author: daidai <[email protected]>
AuthorDate: Wed Sep 20 22:51:57 2023 +0800
[fix](tvf)Correct the code style for modifying static variables of a class
(#24701)
Correct the code style for modifying static variables of a class.
---
.../apache/doris/tablefunction/ExternalFileTableValuedFunction.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/tablefunction/ExternalFileTableValuedFunction.java
b/fe/fe-core/src/main/java/org/apache/doris/tablefunction/ExternalFileTableValuedFunction.java
index f8ac8e0f2b..9ab79eecaa 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/tablefunction/ExternalFileTableValuedFunction.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/tablefunction/ExternalFileTableValuedFunction.java
@@ -90,6 +90,7 @@ import java.util.stream.Collectors;
public abstract class ExternalFileTableValuedFunction extends
TableValuedFunctionIf {
public static final Logger LOG =
LogManager.getLogger(ExternalFileTableValuedFunction.class);
protected static String DEFAULT_COLUMN_SEPARATOR = ",";
+ protected static String DEFAULT_HIVE_TEXT_COLUMN_SEPARATOR = "\001";
protected static final String DEFAULT_LINE_DELIMITER = "\n";
public static final String FORMAT = "format";
public static final String COLUMN_SEPARATOR = "column_separator";
@@ -205,13 +206,14 @@ public abstract class ExternalFileTableValuedFunction
extends TableValuedFunctio
//The keys in the passed validParams map need to be lowercase.
protected void parseProperties(Map<String, String> validParams) throws
AnalysisException {
String formatString = validParams.getOrDefault(FORMAT, "");
+ String defaultColumnSeparator = DEFAULT_COLUMN_SEPARATOR;
switch (formatString) {
case "csv":
this.fileFormatType = TFileFormatType.FORMAT_CSV_PLAIN;
break;
case "hive_text":
this.fileFormatType = TFileFormatType.FORMAT_CSV_PLAIN;
- this.DEFAULT_COLUMN_SEPARATOR = "\001";
+ defaultColumnSeparator = DEFAULT_HIVE_TEXT_COLUMN_SEPARATOR;
this.textSerdeType = TTextSerdeType.HIVE_TEXT_SERDE;
break;
case "csv_with_names":
@@ -238,7 +240,7 @@ public abstract class ExternalFileTableValuedFunction
extends TableValuedFunctio
throw new AnalysisException("format:" + formatString + " is
not supported.");
}
- columnSeparator = validParams.getOrDefault(COLUMN_SEPARATOR,
DEFAULT_COLUMN_SEPARATOR);
+ columnSeparator = validParams.getOrDefault(COLUMN_SEPARATOR,
defaultColumnSeparator);
if (Strings.isNullOrEmpty(columnSeparator)) {
throw new AnalysisException("column_separator can not be empty.");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]