I have huge data in nested / hierarchical Map format. I am using Scala and spark streaming, to which I am very new. Lets say sample streamed data instance/row will look like - Map(nd -> 1, du -> 870, dg -> Map(), did -> GO37, host -> 11.1.1.22, sg -> Map(), nfw -> Map( dst_ip -> 11.1.1.23, v -> 1, src_ip -> 11.1.1.11, pkts -> 1), dnname -> RG, app_name -> read data, bpp -> 40)
How do I read 'dst_ip' values? Because I want to read all instances of 'dst_ip' and compute count of it. I tried various methods like get, option but I am not getting desired output. Please advise how can I retrieve the required information.
Any
in the type in the first place, you should normally aim to do so. If you're stuck dealing withAny
, you should normally break the problem into two parts: 1) convert the untyped data to fully typed, 2) process the data. – Seth Tisue