GitHub user NathanHowell opened a pull request:

    https://github.com/apache/spark/pull/7947

    [SPARK-9618] [SQL] Use the specified schema when reading Parquet files

    The user specified schema is currently ignored when loading Parquet files.
    
    One workaround is to use the `format` and `load` methods instead of 
`parquet`, e.g.:
    
    ```
    val schema = ???
    
    // schema is ignored
    sqlContext.read.schema(schema).parquet("hdfs:///test")
    
    // schema is retained
    sqlContext.read.schema(schema).format("parquet").load("hdfs:///test")
    ```
    
    The fix is simple, but I wonder if the `parquet` method should instead be 
written in a similar fashion to `orc`:
    
    ```
    def parquet(path: String): DataFrame = format("parquet").load(path)
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/NathanHowell/spark SPARK-9618

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/7947.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #7947
    
----
commit d1ea62c80d66c03456adfe39f3f72f110bf71dce
Author: Nathan Howell <[email protected]>
Date:   2015-08-04T22:19:43Z

    [SPARK-9618] [SQL] Use the specified schema when reading Parquet files

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to