You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Pi Song (JIRA)" <ji...@apache.org> on 2008/06/23 14:28:45 UTC

[jira] Created: (PIG-278) Allow no alias in Dot schema definition in Dot LogicalPlanLoader

Allow no alias in Dot schema definition in Dot LogicalPlanLoader
----------------------------------------------------------------

                 Key: PIG-278
                 URL: https://issues.apache.org/jira/browse/PIG-278
             Project: Pig
          Issue Type: Bug
            Reporter: Pi Song


Our schema parser doesn't allow "null" alias but we have to be able to do that in Dot test files.
This is a work around by introducing "[NoAlias]" keyword in schema definition just for Dot LogicalPlanLoader.

Sample:-
{noformat}
foreach [  key="20", type="LOForEach" , schema="[NoAlias] : long, [NoAlias] : byteArray"    ] ;
{noformat}

At runtime, [NoAlias] will be substituted by dummy column names before being sent to the parser. Subsequently those names will be replaced by "null". There is no changes in the actual query parser.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-278) Allow no alias in Dot schema definition in Dot LogicalPlanLoader

Posted by "Pi Song (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pi Song updated PIG-278:
------------------------

    Attachment: AllowNoAliasSchemaInDot2.patch

Unbelievably stupid mistake.

Thanks for review!

Here is the fixed patch.

> Allow no alias in Dot schema definition in Dot LogicalPlanLoader
> ----------------------------------------------------------------
>
>                 Key: PIG-278
>                 URL: https://issues.apache.org/jira/browse/PIG-278
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Pi Song
>         Attachments: AllowNoAliasSchemaInDot.patch, AllowNoAliasSchemaInDot2.patch
>
>
> Our schema parser doesn't allow "null" alias but we have to be able to do that in Dot test files.
> This is a work around by introducing "[NoAlias]" keyword in schema definition just for Dot LogicalPlanLoader.
> Sample:-
> {noformat}
> foreach [  key="20", type="LOForEach" , schema="[NoAlias] : long, [NoAlias] : byteArray"    ] ;
> {noformat}
> At runtime, [NoAlias] will be substituted by dummy column names before being sent to the parser. Subsequently those names will be replaced by "null". There is no changes in the actual query parser.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-278) Allow no alias in Dot schema definition in Dot LogicalPlanLoader

Posted by "Pi Song (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607595#action_12607595 ] 

Pi Song commented on PIG-278:
-----------------------------

Basically it now handles null aliases which I had never expected before.

> Allow no alias in Dot schema definition in Dot LogicalPlanLoader
> ----------------------------------------------------------------
>
>                 Key: PIG-278
>                 URL: https://issues.apache.org/jira/browse/PIG-278
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Pi Song
>         Attachments: AllowNoAliasSchemaInDot.patch
>
>
> Our schema parser doesn't allow "null" alias but we have to be able to do that in Dot test files.
> This is a work around by introducing "[NoAlias]" keyword in schema definition just for Dot LogicalPlanLoader.
> Sample:-
> {noformat}
> foreach [  key="20", type="LOForEach" , schema="[NoAlias] : long, [NoAlias] : byteArray"    ] ;
> {noformat}
> At runtime, [NoAlias] will be substituted by dummy column names before being sent to the parser. Subsequently those names will be replaced by "null". There is no changes in the actual query parser.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PIG-278) Allow no alias in Dot schema definition in Dot LogicalPlanLoader

Posted by "Pi Song (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pi Song resolved PIG-278.
-------------------------

    Resolution: Fixed

I ran the test and it didn't cause more tests to fail. 

Committed.

> Allow no alias in Dot schema definition in Dot LogicalPlanLoader
> ----------------------------------------------------------------
>
>                 Key: PIG-278
>                 URL: https://issues.apache.org/jira/browse/PIG-278
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Pi Song
>         Attachments: AllowNoAliasSchemaInDot.patch, AllowNoAliasSchemaInDot2.patch
>
>
> Our schema parser doesn't allow "null" alias but we have to be able to do that in Dot test files.
> This is a work around by introducing "[NoAlias]" keyword in schema definition just for Dot LogicalPlanLoader.
> Sample:-
> {noformat}
> foreach [  key="20", type="LOForEach" , schema="[NoAlias] : long, [NoAlias] : byteArray"    ] ;
> {noformat}
> At runtime, [NoAlias] will be substituted by dummy column names before being sent to the parser. Subsequently those names will be replaced by "null". There is no changes in the actual query parser.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-278) Allow no alias in Dot schema definition in Dot LogicalPlanLoader

Posted by "Pi Song (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pi Song updated PIG-278:
------------------------

    Attachment: AllowNoAliasSchemaInDot.patch

Patch

> Allow no alias in Dot schema definition in Dot LogicalPlanLoader
> ----------------------------------------------------------------
>
>                 Key: PIG-278
>                 URL: https://issues.apache.org/jira/browse/PIG-278
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Pi Song
>         Attachments: AllowNoAliasSchemaInDot.patch
>
>
> Our schema parser doesn't allow "null" alias but we have to be able to do that in Dot test files.
> This is a work around by introducing "[NoAlias]" keyword in schema definition just for Dot LogicalPlanLoader.
> Sample:-
> {noformat}
> foreach [  key="20", type="LOForEach" , schema="[NoAlias] : long, [NoAlias] : byteArray"    ] ;
> {noformat}
> At runtime, [NoAlias] will be substituted by dummy column names before being sent to the parser. Subsequently those names will be replaced by "null". There is no changes in the actual query parser.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-278) Allow no alias in Dot schema definition in Dot LogicalPlanLoader

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607267#action_12607267 ] 

Alan Gates commented on PIG-278:
--------------------------------

+1 on the work around for having no alias.  I'd like to have Santhosh look at the changes to Schema.java.

> Allow no alias in Dot schema definition in Dot LogicalPlanLoader
> ----------------------------------------------------------------
>
>                 Key: PIG-278
>                 URL: https://issues.apache.org/jira/browse/PIG-278
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Pi Song
>         Attachments: AllowNoAliasSchemaInDot.patch
>
>
> Our schema parser doesn't allow "null" alias but we have to be able to do that in Dot test files.
> This is a work around by introducing "[NoAlias]" keyword in schema definition just for Dot LogicalPlanLoader.
> Sample:-
> {noformat}
> foreach [  key="20", type="LOForEach" , schema="[NoAlias] : long, [NoAlias] : byteArray"    ] ;
> {noformat}
> At runtime, [NoAlias] will be substituted by dummy column names before being sent to the parser. Subsequently those names will be replaced by "null". There is no changes in the actual query parser.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-278) Allow no alias in Dot schema definition in Dot LogicalPlanLoader

Posted by "Santhosh Srinivasan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608491#action_12608491 ] 

Santhosh Srinivasan commented on PIG-278:
-----------------------------------------

In the Schema.FieldSchema equals() method, the comparison of fschema.alias should be with fother.alias and not with fschema.alias itself. I have marked those lines with "<-- should be fother.alias" in the code below.

{code}
+            if (!relaxAlias) {
+                if ( (fschema.alias == null) &&
+                     (fschema.alias == null) ) { <-- should be fother.alias
+                    // good
+                }
+                else if ( (fschema.alias != null) &&
+                          (fschema.alias == null) ) { <-- should be fother.alias
+                    return false ;
+                }
+                else if ( (fschema.alias == null) &&
+                          (fschema.alias != null) ) { <-- should be fother.alias
+                    return false ;
+                }
+                else if (!fschema.alias.equals(fschema.alias)) { <-- should be fother.alias
+                    return false ;
+                }
{code}

> Allow no alias in Dot schema definition in Dot LogicalPlanLoader
> ----------------------------------------------------------------
>
>                 Key: PIG-278
>                 URL: https://issues.apache.org/jira/browse/PIG-278
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Pi Song
>         Attachments: AllowNoAliasSchemaInDot.patch
>
>
> Our schema parser doesn't allow "null" alias but we have to be able to do that in Dot test files.
> This is a work around by introducing "[NoAlias]" keyword in schema definition just for Dot LogicalPlanLoader.
> Sample:-
> {noformat}
> foreach [  key="20", type="LOForEach" , schema="[NoAlias] : long, [NoAlias] : byteArray"    ] ;
> {noformat}
> At runtime, [NoAlias] will be substituted by dummy column names before being sent to the parser. Subsequently those names will be replaced by "null". There is no changes in the actual query parser.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-278) Allow no alias in Dot schema definition in Dot LogicalPlanLoader

Posted by "Pi Song (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pi Song updated PIG-278:
------------------------

    Patch Info: [Patch Available]

> Allow no alias in Dot schema definition in Dot LogicalPlanLoader
> ----------------------------------------------------------------
>
>                 Key: PIG-278
>                 URL: https://issues.apache.org/jira/browse/PIG-278
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Pi Song
>         Attachments: AllowNoAliasSchemaInDot.patch
>
>
> Our schema parser doesn't allow "null" alias but we have to be able to do that in Dot test files.
> This is a work around by introducing "[NoAlias]" keyword in schema definition just for Dot LogicalPlanLoader.
> Sample:-
> {noformat}
> foreach [  key="20", type="LOForEach" , schema="[NoAlias] : long, [NoAlias] : byteArray"    ] ;
> {noformat}
> At runtime, [NoAlias] will be substituted by dummy column names before being sent to the parser. Subsequently those names will be replaced by "null". There is no changes in the actual query parser.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.