pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1731320 - in /pig/trunk: CHANGES.txt src/org/apache/pig/builtin/AvroStorage.java
Date Sat, 20 Feb 2016 00:39:57 GMT
Author: daijy
Date: Sat Feb 20 00:39:57 2016
New Revision: 1731320

URL: http://svn.apache.org/viewvc?rev=1731320&view=rev
Log:
PIG-4814: AvroStorage does not take namenode HA as part of schema file url

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/builtin/AvroStorage.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1731320&r1=1731319&r2=1731320&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Sat Feb 20 00:39:57 2016
@@ -95,6 +95,8 @@ PIG-4639: Add better parser for Apache H
 
 BUG FIXES
 
+PIG-4814: AvroStorage does not take namenode HA as part of schema file url (daijy)
+
 PIG-4812: Register Groovy UDF with relative path does not work (daijy)
 
 PIG-4806: UDFContext can be reset in the middle during Tez input and output initialization
(rohini)

Modified: pig/trunk/src/org/apache/pig/builtin/AvroStorage.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/builtin/AvroStorage.java?rev=1731320&r1=1731319&r2=1731320&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/builtin/AvroStorage.java (original)
+++ pig/trunk/src/org/apache/pig/builtin/AvroStorage.java Sat Feb 20 00:39:57 2016
@@ -175,8 +175,14 @@ public class AvroStorage extends LoadFun
         if (configuredOptions.hasOption('f')) {
           try {
             Path p = new Path(configuredOptions.getOptionValue('f'));
+            Configuration conf;
+            if (UDFContext.getUDFContext().getJobConf()==null) {
+                conf = new Configuration();
+            } else {
+                conf = UDFContext.getUDFContext().getJobConf();
+            }
             Schema s = new Schema.Parser()
-              .parse((FileSystem.get(p.toUri(), new Configuration()).open(p)));  
+              .parse((FileSystem.get(p.toUri(), conf).open(p)));
             setInputAvroSchema(s);
             setOutputAvroSchema(s);
           } catch (FileNotFoundException fnfe) {



Mime
View raw message