我有两个表,希望比较所有具有相同id的值。我尝试使用struct和comparing by==或in,但不起作用。你能帮我写出正确的查询吗。
drop table test1;
create table test1(
id string,
name string);
drop table test2;
create table test2 like test1;
select
if(struct(t1.id, t1.name) in struct(t2.id, t2.name), 1, 0)
from test1 t1
left join test2 t2 on t1.id == t2.id;
例外
SemanticException [Error 10016]: Line 2:10 Argument type mismatch 'name': The 1st argument of EQUAL is expected to a primitive type, but struct is found
暂无答案!
目前还没有任何答案,快来回答吧!