admin管理员组

文章数量:1393110

I know that using LogicalTypeAnnotation it is possible to create an ENUM using enumType() (e.g., .apache.parquet/parquet-column/1.15.0//apache/parquet/schema/LogicalTypeAnnotation.html#enumType--)

But how to populate the variable with constants using the Java API?

The best I could figure out is:

LogicalTypeAnnotation.EnumLogicalTypeAnnotation some_enum = LogicalTypeAnnotation.enumType()
OriginalType[] enum_arr = some_enum.toOriginalType().values();
// convert to list to add constants
List<OriginalType> final_populated_enum_list = Arrays.asList(enum_arr);
final_populated_enum_list.add(SOME_ENUM_CONSTANT);
//convert back to array
... 

is it through .apache.parquet.format Enum EnumType._Fields (e.g., .apache.parquet/parquet-format-structures/latest/index.html)?

which one is correct? is there a better approach?

本文标签: How to create an ENUM variable in ParquetStack Overflow