You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2014/11/24 23:14:55 UTC

svn commit: r1641493 - in /pig/branches/branch-0.14: CHANGES.txt src/org/apache/pig/tools/parameters/PreprocessorContext.java test/org/apache/pig/test/TestBlackAndWhitelistValidator.java

Author: daijy
Date: Mon Nov 24 22:14:55 2014
New Revision: 1641493

URL: http://svn.apache.org/r1641493
Log:
PIG-4342: Pig 0.14 cannot identify the uppercase of DECLARE and DEFAULT

Modified:
    pig/branches/branch-0.14/CHANGES.txt
    pig/branches/branch-0.14/src/org/apache/pig/tools/parameters/PreprocessorContext.java
    pig/branches/branch-0.14/test/org/apache/pig/test/TestBlackAndWhitelistValidator.java

Modified: pig/branches/branch-0.14/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.14/CHANGES.txt?rev=1641493&r1=1641492&r2=1641493&view=diff
==============================================================================
--- pig/branches/branch-0.14/CHANGES.txt (original)
+++ pig/branches/branch-0.14/CHANGES.txt Mon Nov 24 22:14:55 2014
@@ -28,6 +28,8 @@ BUG FIXES
 
 PIG-4334: PigProcessor does not set pig.datetime.default.tz (rohini)
 
+PIG-4342: Pig 0.14 cannot identify the uppercase of DECLARE and DEFAULT (daijy)
+
 Release 0.14.0
  
 INCOMPATIBLE CHANGES

Modified: pig/branches/branch-0.14/src/org/apache/pig/tools/parameters/PreprocessorContext.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.14/src/org/apache/pig/tools/parameters/PreprocessorContext.java?rev=1641493&r1=1641492&r2=1641493&view=diff
==============================================================================
--- pig/branches/branch-0.14/src/org/apache/pig/tools/parameters/PreprocessorContext.java (original)
+++ pig/branches/branch-0.14/src/org/apache/pig/tools/parameters/PreprocessorContext.java Mon Nov 24 22:14:55 2014
@@ -155,9 +155,9 @@ public class PreprocessorContext {
         final String declareToken = "%declare";
         final String defaultToken = "%default";
 
-        if (preprocessorCmd.equals(declareToken)) {
+        if (preprocessorCmd.toLowerCase().equals(declareToken)) {
             filter.validate(PigCommandFilter.Command.DECLARE);
-        } else if (preprocessorCmd.equals(defaultToken)) {
+        } else if (preprocessorCmd.toLowerCase().equals(defaultToken)) {
             filter.validate(PigCommandFilter.Command.DEFAULT);
         } else {
             throw new IllegalArgumentException("Pig Internal Error. Invalid preprocessor command specified : "

Modified: pig/branches/branch-0.14/test/org/apache/pig/test/TestBlackAndWhitelistValidator.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.14/test/org/apache/pig/test/TestBlackAndWhitelistValidator.java?rev=1641493&r1=1641492&r2=1641493&view=diff
==============================================================================
--- pig/branches/branch-0.14/test/org/apache/pig/test/TestBlackAndWhitelistValidator.java (original)
+++ pig/branches/branch-0.14/test/org/apache/pig/test/TestBlackAndWhitelistValidator.java Mon Nov 24 22:14:55 2014
@@ -144,7 +144,7 @@ public class TestBlackAndWhitelistValida
 
             StringBuilder script = new StringBuilder();
             script.append("set io.sort.mb 1000;")
-            .append("%default input 'foo';")
+            .append("%Default input 'foo';")
                     .append("A = LOAD '$input' USING mock.Storage() AS (f1:chararray,f2:int,f3:chararray);")
                     .append("B = order A by f1,f2,f3 DESC;")
                     .append("STORE B INTO 'bar' USING mock.Storage();");
@@ -162,7 +162,7 @@ public class TestBlackAndWhitelistValida
     @Test
     public void testPreprocessorCommand3() throws Exception {
         try {
-            ctx.getProperties().setProperty(PigConfiguration.PIG_BLACKLIST, "define");
+            ctx.getProperties().setProperty(PigConfiguration.PIG_BLACKLIST, "Define");
             PigServer pigServer = new PigServer(ctx);
             Data data = resetData(pigServer);