GitHub user vinodkc opened a pull request:

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

    [SPARK-17920][SPARK-19580][SPARK-19878][SQL] Backport PR 19779 to 
branch-2.2 - Support writing to Hive table which uses Avro schema url 
'avro.schema.url'

    ## What changes were proposed in this pull request?
    
    > Backport https://github.com/apache/spark/pull/19779 to branch-2.2
    
    SPARK-19580 Support for avro.schema.url while writing to hive table
    SPARK-19878 Add hive configuration when initialize hive serde in 
InsertIntoHiveTable.scala
    SPARK-17920 HiveWriterContainer passes null configuration to 
serde.initialize, causing NullPointerException in AvroSerde when using 
avro.schema.url
    
    Support writing to Hive table which uses Avro schema url 'avro.schema.url'
    For ex:
    create external table avro_in (a string) stored as avro location 
'/avro-in/' tblproperties ('avro.schema.url'='/avro-schema/avro.avsc');
    
    create external table avro_out (a string) stored as avro location 
'/avro-out/' tblproperties ('avro.schema.url'='/avro-schema/avro.avsc');
    
    insert overwrite table avro_out select * from avro_in; // fails with 
java.lang.NullPointerException
    
    WARN AvroSerDe: Encountered exception determining schema. Returning signal 
schema to indicate problem
    java.lang.NullPointerException
    at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:182)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:174)
    ## Changes proposed in this fix
    Currently 'null' value is passed to serializer, which causes NPE during 
insert operation, instead pass Hadoop configuration object
    ## How was this patch tested?
    Added new test case in VersionsSuite

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

    $ git pull https://github.com/vinodkc/spark br_Fix_SPARK-17920_branch-2.2

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

    https://github.com/apache/spark/pull/19795.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 #19795
    
----
commit 63e40e866e8ad3307b91ea430c29938a0050e6f7
Author: vinodkc <[email protected]>
Date:   2017-11-22T12:47:47Z

    pass hadoop Configuration to serializer

----


---

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

Reply via email to