最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to create an ENUM variable in Parquet? - Stack Overflow

programmeradmin0浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论