enumeration - Presto 中是否有 ENUM 类型?
问题描述
我在这里查看 Presto 的文档https://prestodb.io/docs/0.172/index.html 我找不到 ENUM 类型,不支持吗?我们改用什么?任意字符串还是任意字符串?求朋友。
解决方案
Presto has no enum-like type. You can think of enum type as "varchar
with constraints". Since Presto is a query engine, not a database, it does not own storage. For this reason, it is "by design" hard to have a type with additional constraints.
Supported data types are listed in the docs: https://trino.io/docs/current/language/types.html
However, note that starting with Presto 306, Presto e.g. does support PostgreSQL's enum
type.