Skip to content

Conversation

@suxiaogang223
Copy link
Contributor

Proposed changes

pick from master #37638

…onsistent with hive (apache#37638)

## Proposed changes

When hive reads the text table, it will first try to parse "field.delim"
into Byte type. If it fails, it will take the first character as Byte.
If "field.delim" is not set, use the same method to parse
"serialization.format".

```java

separatorCandidates.add(LazyUtils.getByte(tableProperties.getProperty(serdeConstants.FIELD_DELIM,
        tableProperties.getProperty(serdeConstants.SERIALIZATION_FORMAT)), DefaultSeparators[0]));
...
  public static byte getByte(String altValue, byte defaultVal) {
    if (altValue != null && altValue.length() > 0) {
      try {
        return Byte.parseByte(altValue);
      } catch (NumberFormatException e) {
        return (byte) altValue.charAt(0);
      }
    }
    return defaultVal;
  }
```
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@suxiaogang223
Copy link
Contributor Author

run buildall

1 similar comment
@suxiaogang223
Copy link
Contributor Author

run buildall

@suxiaogang223
Copy link
Contributor Author

run buildall

@yiguolei yiguolei merged commit f7068b5 into apache:branch-2.1 Jul 16, 2024
@suxiaogang223 suxiaogang223 deleted the hive_text_column_sperator_fix_2_1 branch July 16, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants