Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"key": { "defaultWeights":"1" }, "measures": { "m1":-0.01, "m2":-0.5.....}}
- val flattened = dff.withColumn("default_weights", json_tuple(col("key"), "defaultWeights")).show
- org.apache.spark.sql.AnalysisException: cannot resolve 'json_tuple(`key`, 'defaultWeights')' due to data type mismatch: json_tuple requires that all arguments are strings;;
- 'Project [key#6, measures#7, json_tuple(key#6, defaultWeights) AS default_weights#13]
- +- Relation[key#6,measures#7] json
- <console>:25: error: type mismatch;
- found : String
- required: org.apache.spark.sql.Column
- val flattened = dff.withColumn("default_weights", json_tuple("key", "defaultWeights")).show
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement