You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by ol...@apache.org on 2011/11/03 22:49:25 UTC

svn commit: r1197324 - in /pig/trunk: CHANGES.txt src/org/apache/pig/Main.java src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java

Author: olga
Date: Thu Nov  3 21:49:25 2011
New Revision: 1197324

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

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/Main.java
    pig/trunk/src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1197324&r1=1197323&r2=1197324&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Thu Nov  3 21:49:25 2011
@@ -24,6 +24,8 @@ INCOMPATIBLE CHANGES
 
 IMPROVEMENTS
 
+PIG-2230: Improved error message for invalid parameter format (xuitingz via olgan)
+
 PIG-2328: Add builtin UDFs for building and using bloom filters (gates)
 
 PIG-2338: Need signature for EvalFunc (daijy)

Modified: pig/trunk/src/org/apache/pig/Main.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/Main.java?rev=1197324&r1=1197323&r2=1197324&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/Main.java (original)
+++ pig/trunk/src/org/apache/pig/Main.java Thu Nov  3 21:49:25 2011
@@ -570,7 +570,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/trunk/src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java?rev=1197324&r1=1197323&r2=1197324&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java (original)
+++ pig/trunk/src/org/apache/pig/tools/parameters/ParameterSubstitutionPreprocessor.java Thu Nov  3 21:49:25 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;
         }