spark中的struct类型数据为null

时间:2018-06-06 15:27:05

标签: apache-spark hive apache-spark-sql

我有一个带有列作为结构数据类型的配置单元表。 蜂巢表的架构:

-----------------------------------------  
| name        | type                         
-----------------------------------------      
| col1        | struct<                            
|             |   ccl1:string,             
|             |   ccl2:string,             
|             |   ccl3:struct<             
|             |     cccl4:strin>          
|             | >                  

在配置单元中,输出正确

    select col1.ccl1 from tab  
    ccl1
    AA  
    BB  

但是相同的struct数据类型表spark:

    d = spark.read.table("tab")   
    d.select("col1.ccl1").show()

output in spark:  
ccl1  
null     
null  
null  

编辑:添加样本。
任何帮助

0 个答案:

没有答案
相关问题