Github user maropu commented on the issue:

    https://github.com/apache/spark/pull/16030
  
    Thanks! I found another wired behaviour related to this issue. Is this 
expected? or, should we fix? 
    
    ```
    scala> import org.apache.spark.sql.types._
    scala> val schema = new StructType().add("a", LongType).add("b", 
IntegerType)
    scala> case class A(a: Long, b: Int)
    scala> val as = Seq(A(1, 2))
    scala> 
spark.createDataFrame(as).write.parquet("/Users/maropu/Desktop/data/a=1/")
    scala> val df = 
spark.read.schema(schema).parquet("/Users/maropu/Desktop/data/")
    scala> df.printSchema
    root
     |-- b: integer (nullable = true)
     |-- a: long (nullable = true)
    
    scala> val df = spark.read.parquet("/Users/maropu/Desktop/data/")
    scala> df.printSchema
    root
     |-- a: integer (nullable = true)
     |-- b: integer (nullable = true)
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to