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

Unable to find alias in a bag with nested schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 0.9.2, 0.10.0
    • None
    • None
    • None

    Description

      I've created a loadfunc that implements LoadMetadata and returns a schema as follows:

      (key: bytearray,columns: {((name: chararray,owner_id: chararray))})
      

      (the code is at CASSANDRA-3371 if you want to take a look)

      However, whenever I try to access tuple fields within the bag, they cannot be found:

      rows = LOAD 'cassandra://Keyspace1/Standard1' USING CassandraStorage();
      one = filter rows by columns.owner_id eq 'foo';
      dump one;
      

      Produces:

      2012-01-20 20:12:14,858 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Pig script failed to parse:
      <file foo.pig, line 2, column 7> pig script failed to validate: org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1128: Cannot find field owner_id in :tuple(name:chararray,owner_id:chararray)
      

      Replacing the bag with another tuple works and all the fields are accessible. I've tried this against the 0.9 and 0.10 branch heads with no luck. Trunk produces a slight different error:

      org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. Pig script failed to parse:
      <file foo.pig, line 2, column 7> pig script failed to validate: org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1127: Index 1 out of range in schema::tuple(name:chararray,column_family:chararray)
              at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1598)
              at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1541)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              brandon.williams Brandon Williams
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: