score:0

with this query:

originaldf.withcolumn("plan",
  from_json($"strjson", schema))
    .select($"plan.payload.detail.data.object.items.data"
      .getitem(0)
        .getfield("plan")
          .getfield("amount")).show()

i obtain the result:

+-------------------------------------------------------------------+
|plan.payload.detail.data.object.items.data as `data`[0].plan.amount|
+-------------------------------------------------------------------+
|                                                                  0|
+-------------------------------------------------------------------+

check this out


Related Query

More Query from same tag