[ 
https://issues.apache.org/jira/browse/HIVE-5224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jaden Park updated HIVE-5224:
-----------------------------

    Attachment: Hive-5224.3.patch

Description of the fix

The existing code first checks whether the file system is HDFS. If so, the 
string is passed to a static method called getSchemaFromHDFS(), which converts 
the URL to a Path object and eventually reads the schema using Hadoop's 
FileSystem class. When an exception occurs while reading the schema, the code 
will try once more to convert the URL string by creating a URL object out of 
the string and stream the contents. The latter case is for reading http and 
file protocols.

This fix switches this order of execution. The fix will first detect whether 
the URL is of http or file protocol. If not, the string is passed to a new 
static method called getSchemaFromFS(), which retrieves the right Hadoop 
FileSystem object when given the URL.  This FileSystem object will be able to 
convert files in other file system types such as S3 to be read for the schema.


> When creating table with AVRO serde, the "avro.schema.url" should be about to 
> load serde schema from file system beside HDFS
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-5224
>                 URL: https://issues.apache.org/jira/browse/HIVE-5224
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Shuaishuai Nie
>            Assignee: Shuaishuai Nie
>         Attachments: HIVE-5224.1.patch, HIVE-5224.2.patch, Hive-5224.3.patch
>
>
> Now when loading schema for table with AVRO serde, the file system is hard 
> coded to hdfs in AvroSerdeUtils.java. This should enable loading schema from 
> file system beside hdfs.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to