xiaotianzhang01 commented on a change in pull request #4589:
URL: https://github.com/apache/hudi/pull/4589#discussion_r785846517
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/util/AvroOrcUtils.java
##########
@@ -511,8 +511,8 @@ public static Object readFromVector(TypeDescription type,
ColumnVector colVector
throw new HoodieIOException("CHAR/VARCHAR has length " +
result.length() + " greater than Max Length allowed");
}
case STRING:
- String stringType = avroSchema.getProp(GenericData.STRING_PROP);
- if (stringType == null || !stringType.equals(StringType.String)) {
+ String stringType = avroSchema != null ?
avroSchema.getProp(GenericData.STRING_PROP) : null;
+ if (!StringType.String.name().equals(stringType)) {
int stringLength = ((BytesColumnVector) colVector).length[vectorPos];
Review comment:
This condition is to check if the user has set the type to string, the
default is utf8 type. But `stringType` is `String` type and `StringType.String`
is enum type. Below is the relevant code:
```
public enum StringType { CharSequence, String, Utf8 };
public static final String STRING_PROP = "avro.java.string";
protected static final String STRING_TYPE_STRING = "String";
...
s.addProp(GenericData.STRING_PROP, GenericData.STRING_TYPE_STRING);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]