2017-10-12 91 views
0

我的JSON對象:JSON解析SERDE陣列結構問題

{ 
    "_total": 4, 
    "values": [ 
     { 
      "total-follower-count": 63911, 
      "organic-follower-count": 6000, 
      "paid-follower-count": 3911, 
      "time": 1399334400000 
     }, 
     { 
      "total-follower-count": 64023, 
      "organic-follower-count": 6000, 
      "paid-follower-count": 4023, 
      "time": 1399420800000 
     }, 
     { 
      "total-follower-count": 64023, 
      "organic-follower-count": 6000, 
      "paid-follower-count": 4023, 
      "time": 1399507200000 
     }, 
     { 
      "total-follower-count": 64048, 
      "organic-follower-count": 6000, 
      "paid-follower-count": 4048, 
      "time": 1399593600000 
     } 
    ] 
} 

在AWS雅典娜,我創建了一個表像之下。我不能訪問像「Total_Follower_count」這樣的數組值。能否請你幫忙。謝謝

回答

0

你需要扁平你的陣列,並執行你的選擇。

在這裏明顯的例子記載,

http://docs.aws.amazon.com/athena/latest/ug/flattening-arrays.html

希望它能幫助。

+0

我曾嘗試使用下面的腳本,但它什麼也沒有返回。選擇 \t _total, \t unnested_series.valuesentry.total_follower_count \t 從 \t linkedindata噸 \t交叉聯接UNNEST(t.values)unnested_series(valuesentry) –