xiaotianzhang01 commented on a change in pull request #4589:
URL: https://github.com/apache/hudi/pull/4589#discussion_r785643080
##########
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:
Check if user set type as string, default is utf8 type.
```
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);
```
`StringType.String` is an enumeration type, but `stringType` is of 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]