HUE查询左联接无结果



我在Hue 3.10.0中运行了一个hivesql,但没有返回任何结果,Hive SQL如下:

select t1.id
,t2.id 
from ( 
select id from table1 where date = '20181121' and type = 'a'
) t1
left join(
select id from table1 where date = '20181121' and type = 'b' and
) t2
on t1.id = t2.id;

然后我运行sunquery t1:

select id from table1 where date = '20181121' and type = 'a';

并且它重新运行437行,

我试着在子查询t1之后添加"groupby",并像这样查询:

select t1.id
,t2.id 
from ( 
select id from table1 where date = '20181121' and type = 'a' group by id
) t1
left join(
select id from table1 where date = '20181121' and type = 'b' and
) t2
on t1.id = t2.id;

它还返回437行;

然后我把table1改成了另一个表,它返回了一个正常的结果,我用另一个工具"超集"运行上面的第一个查询,它也返回了437行,所以我怀疑"色调"造成了这个问题,但我很困惑为什么会发生这种情况?

可能是色调导致了问题。您可以尝试在trim(t1.id(=trim(t2.id(上使用吗

在两侧进行修剪并尝试

最新更新