Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- |-- A: map (nullable = true)
- | |-- key: string
- | |-- value: array (valueContainsNull = true)
- | | |-- element: struct (containsNull = true)
- | | | |-- uid: string (nullable = true)
- | | | |-- price: double (nullable = true)
- | | | |-- type: string (nullable = true)
- |-- keyindex: string (nullable = true)
- {"A":{
- "innerkey_1":[{"uid":"1","price":0.01,"recordtype":"STAT"},
- {"uid":"6","price":4.3,"recordtype":"DYN"}],
- "innerkey_2":[{"uid":"2","price":2.01,"recordtype":"DYN"},
- {"uid":"4","price":6.1,"recordtype":"DYN"}]},
- "innerkey_2"}
- 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))
- [{"uid":"2","price":2.01,"recordtype":"DYN"},
- {"uid":"4","price":6.1,"recordtype":"DYN"}]
Add Comment
Please, Sign In to add comment