配置单元sql结构不匹配

lokaqttq  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(331)

我有一个列如下的表:

table<mytable>
field<myfield1> type(array<struct>) 
  item<struct>
    cars(string)
    isRed(boolean)
    information(bigint)

当我执行以下查询时

select myfield1.isRed
from mytable
where myfield1.isRed = true

我得到一个错误:
参数类型不匹配“”:equal的第一个参数应为基元类型,但找到了列表
当我不使用

[true,true,true]
[true,true,true,true,true,true]
[true]
[true, true]
wrrgggsh

wrrgggsh1#

试试这个:

select myfield1[1]
from mytable
where myfield1[1] = true


您可以在这里找到有关如何访问复杂类型的更多信息

相关问题