can anyone please guide me how should i access amt1,amt2,total from this json schema. after loading json file when i am trying to select data using
df.select($"b2b.bill.amt1").
I am getting below error message.
org.apache.spark.sql.AnalysisException: cannot resolve '`b2b`.`bill`['amt1']' due to data type
mismatch: argument 2 requires integral type, however, ''amt1'' is of string type.;;
Json Schema:
|-- b2b: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- transid: string (nullable = true)
| | |-- bill: array (nullable = true)
| | | |-- element: struct (containsNull = true)
| | | | |-- amt1: double (nullable = true)
| | | | |-- amt2: string (nullable = true)
| | | | |-- total: string (nullable = true)