Load json file to spark dataframe
问题 I try to load the following data.json file in a spark dataframe: {"positionmessage":{"callsign": "PPH1", "name": 0.0, "mmsi": 100}} {"positionmessage":{"callsign": "PPH2", "name": 0.0, "mmsi": 200}} {"positionmessage":{"callsign": "PPH3", "name": 0.0, "mmsi": 300}} by the following code: from pyspark.sql import SparkSession from pyspark.sql.types import ArrayType, StructField, StructType, StringType, IntegerType appName = "PySpark Example - JSON file to Spark Data Frame" master = "local" #