合并两个配置单元表(不同列大小)-pyspark

合并两个配置单元表(不同列大小)-pyspark,pyspark,hive,hiveql,pyspark-sql,Pyspark,Hive,Hiveql,Pyspark Sql,我有一个带有模式的配置单元表 姓名、联系人、地址、主题 Name Contact Address Subject abc 1111 Mumbai maths egf 2222 nashik science pqr 3333 delhi history And other table with schema **Name ,Contact** Name Contact xyz 4444 mno 2222

我有一个带有模式的配置单元表 姓名、联系人、地址、主题

Name  Contact   Address  Subject
abc   1111      Mumbai    maths
egf   2222      nashik    science
pqr   3333      delhi     history

And other table with schema **Name ,Contact** 
Name   Contact
xyz    4444  
mno    2222 
预期产量

Name  Contact   Address  Subject
abc   1111      Mumbai    maths
pqr   3333      delhi     history
xyz   4444      null      null
mno   2222      nashik    science
我已尝试联接操作,但无法获得正确的输出

使用完全联接:

select coalesce(t2.name,t1.name) as name, 
       coalesce(t2.contact, t1.contact) as contact,
       t1.address, t1.subject
  from table1 t1
       full join table2 t2
                 on t1.contact=t2.contact
使用完全联接:

select coalesce(t2.name,t1.name) as name, 
       coalesce(t2.contact, t1.contact) as contact,
       t1.address, t1.subject
  from table1 t1
       full join table2 t2
                 on t1.contact=t2.contact