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

getSchemaFromString throws away the name of the tuple that is in a bag

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.9.0, 0.10.0, 0.11
    • 0.9.2, 0.10.0, 0.11
    • None
    • None

    Description

      Schema thing = Utils.getSchemaFromString("b:bag{t:tuple(x:int,y:int,z:int)}");
      System.out.println(thing.getField(0).schema.getField(0).alias); //returns null

      This isn't a huge issue, but it does seem odd to throw away this information unnecessarily. While any bag will of course have thus tuple and no other elements, it seems to violate the principle of least astonishment: if the tuple name was specified, shouldn't it be kept around?

      Edit: I just found a case where this actually can be a bit annoying. If you want to pull that tuple out of the bag, for whatever reason, you've now lost its name.

      Attachments

        1. PIG2427.patch
          4 kB
          Jonathan Coveney
        2. PIG-2427-2.patch
          4 kB
          Daniel Dai

        Activity

          People

            jcoveney Jonathan Coveney
            jcoveney Jonathan Coveney
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: