pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r1203922 - in /pig/branches/branch-0.10: CHANGES.txt src/org/apache/pig/Main.java src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java
Date Sat, 19 Nov 2011 00:28:49 GMT
Author: olga
Date: Sat Nov 19 00:28:48 2011
New Revision: 1203922

URL: http://svn.apache.org/viewvc?rev=1203922&view=rev
Log:
PIG-2230: Improved error message for invalid parameter format (xuitingz via olgan)

Modified:
    pig/branches/branch-0.10/CHANGES.txt
    pig/branches/branch-0.10/src/org/apache/pig/Main.java
    pig/branches/branch-0.10/src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java

Modified: pig/branches/branch-0.10/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/CHANGES.txt?rev=1203922&r1=1203921&r2=1203922&view=diff
==============================================================================
--- pig/branches/branch-0.10/CHANGES.txt (original)
+++ pig/branches/branch-0.10/CHANGES.txt Sat Nov 19 00:28:48 2011
@@ -24,6 +24,8 @@ INCOMPATIBLE CHANGES
 
 IMPROVEMENTS
 
+PIG-2230: Improved error message for invalid parameter format (xuitingz via olgan)
+
 PIG-2332: JsonLoader/JsonStorage (daijy)
 
 PIG-2328: Add builtin UDFs for building and using bloom filters (gates)

Modified: pig/branches/branch-0.10/src/org/apache/pig/Main.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/src/org/apache/pig/Main.java?rev=1203922&r1=1203921&r2=1203922&view=diff
==============================================================================
--- pig/branches/branch-0.10/src/org/apache/pig/Main.java (original)
+++ pig/branches/branch-0.10/src/org/apache/pig/Main.java Sat Nov 19 00:28:48 2011
@@ -576,7 +576,7 @@ static int run(String args[], PigProgres
         rc = ReturnCode.PARSE_EXCEPTION;
         PigStatsUtil.setErrorMessage(e.getMessage());
     } catch (org.apache.pig.tools.parameters.ParseException e) {
-        usage();
+       // usage();
         rc = ReturnCode.PARSE_EXCEPTION;
         PigStatsUtil.setErrorMessage(e.getMessage());
     } catch (IOException e) {

Modified: pig/branches/branch-0.10/src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java?rev=1203922&r1=1203921&r2=1203922&view=diff
==============================================================================
--- pig/branches/branch-0.10/src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java
(original)
+++ pig/branches/branch-0.10/src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java
Sat Nov 19 00:28:48 2011
@@ -126,6 +126,11 @@ public class ParameterSubstitutionPrepro
             paramParser.ReInit(in);
             while (paramParser.Parse()) {}
             in.close();
+        }catch(org.apache.pig.tools.parameters.ParseException e){
+        	log.info("The file: \""+filename+"\" contains parameter that cannot be parsed by
Pig in line. Please double check it");
+        	log.info("Parser give the follow error message:");
+        	log.info(e.getMessage());
+        	throw e;
         } catch (IOException e) {
             RuntimeException rte = new RuntimeException(e.getMessage() , e);
             throw rte;
@@ -142,7 +147,12 @@ public class ParameterSubstitutionPrepro
             // new lines are needed by the parser
             paramParser.ReInit(new StringReader(line));
             paramParser.Parse();
-        } catch (IOException e) {
+        } catch(org.apache.pig.tools.parameters.ParseException e){
+        	log.info("The parameter: \""+line+"\" cannot be parsed by Pig. Please double check
it");
+        	log.info("Parser give the follow error message:");
+        	log.info(e.getMessage());
+        	throw e;
+        }catch (IOException e) {
             RuntimeException rte = new RuntimeException(e.getMessage() , e);
             throw rte;
         }



Mime
View raw message