code: def parquet_schema_merging_example(spark: SparkSession) -> None:
      # $example on:schema_merging$
      # spark is from the previous example.
      # Create a simple DataFrame, stored into a partition directory
      sc = spark.sparkContext
  
      squaresDF = spark.createDataFrame(
          sc.parallelize(range(1, 6)).map(
              lambda i: Row(single=i, double=i**2)
          )
      )
      squaresDF.write.parquet("data/test_table/key=1")
  
      # Create another DataFrame in a new partition directory,
      # adding a new column and dropping an existing column
      cubesDF = spark.createDataFrame(
          sc.parallelize(range(6, 11)).map(
              lambda i: Row(single=i, triple=i**3)
          )
      )
      cubesDF.write.parquet("data/test_table/key=2")
  
      # Read the partitioned table
      mergedDF = spark.read.option("mergeSchema", "true").parquet(
          "data/test_table"
      )
      mergedDF.printSchema()
  
file_path: spark/examples/src/main/python/sql/datasource.py
imports: from pyspark.sql import SparkSession
  from pyspark.sql import Row
label_desc: Use image node_id 4 for calling a global function with example usage: parquet_schema_merging_example(spark) without return types