通配符搜索数组< string>在雅典娜

发布于 2025-02-07 19:44:21 字数 459 浏览 2 评论 0原文

我在雅典娜有一张桌子,其中一列是类型数组。 我尝试了以下查询以获取包含 Earth 的输出,但行不通。 如何在此列中执行通配符搜索?

通配符搜索后的预期输出:

select * from mytable
where contains(myarr,'eart%');

I have a table in Athena where one of the columns is of type array.
I tried the below query to get output containing earth but doesn't work.
How do I perform a wildcard search in this column?

Example array column:

Expected output after wildcard search:

enter image description here

select * from mytable
where contains(myarr,'eart%');

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独自←快乐 2025-02-14 19:44:22

这是来自内存的,因此可能需要进行一些调整,但是您可以在“数组元素”

where cardinality(filter(myarr, q -> q like 'eart%')) > 0

过滤器上使用过滤器,为数组中的一个或多个元素创建一系列匹配和心脏测试

This is from memory, so it might need a bit of tweaking, but you can use a filter on the array elements

where cardinality(filter(myarr, q -> q like 'eart%')) > 0

filter creates an array of matches and cardinality tests for one or more elements in the array

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文