Guest User

Untitled

a guest
Dec 18th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. |-- A: map (nullable = true)
  2. | |-- key: string
  3. | |-- value: array (valueContainsNull = true)
  4. | | |-- element: struct (containsNull = true)
  5. | | | |-- uid: string (nullable = true)
  6. | | | |-- price: double (nullable = true)
  7. | | | |-- type: string (nullable = true)
  8. |-- keyindex: string (nullable = true)
  9.  
  10. {"A":{
  11. "innerkey_1":[{"uid":"1","price":0.01,"recordtype":"STAT"},
  12. {"uid":"6","price":4.3,"recordtype":"DYN"}],
  13. "innerkey_2":[{"uid":"2","price":2.01,"recordtype":"DYN"},
  14. {"uid":"4","price":6.1,"recordtype":"DYN"}]},
  15. "innerkey_2"}
  16.  
  17. val schema = (new StructType().add("mainkey", MapType(StringType, new ArrayType(new StructType().add("uid",StringType).add("price",DoubleType).add("recordtype",StringType), true))).add("keyindex",StringType))
  18.  
  19. [{"uid":"2","price":2.01,"recordtype":"DYN"},
  20. {"uid":"4","price":6.1,"recordtype":"DYN"}]
Add Comment
Please, Sign In to add comment