Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-4968

Fix unit test failure of TestLogicalPlanBuilder#testQuery90

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      In jenkins, it shows that TestLogicalPlanBuilder#testQuery90 fails. After debugging, it always fails in
      Line1139

       Assert.assertTrue(foreach.getSchema().toString( false ).equals("mygroup:tuple(myname:chararray,myage:int),mycount:long"));
      

      The script is

      a = load 'myfile' as (name:Chararray, age:Int, gpa:Float);b = group a by (name, age);c = foreach b generate group as mygroup:(myname, myage), COUNT(a) as mycount;store c into 'output';
      

      The reason why fails is because the schema of mygroup(myname,myage) is
      mygroup(myname:bytearray,myage:bytearray) and this user-defined schema is assigned to c. so the schema of c is
      not mygroup:tuple(myname:chararray,myage:int) but mygroup:tuple(myname:bytearray,myage:bytearray).

      This problem is imported since PIG-2315 as ForEachUserSchemaVisitor is used in LogicalPlan.

      Attachments

        1. PIG-4968.patch
          5 kB
          liyunzhang

        Issue Links

          Activity

            People

              kellyzly liyunzhang
              kellyzly liyunzhang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: