Package org.apache.pig.impl.logicalLayer

Examples of org.apache.pig.impl.logicalLayer.FrontendException


    public RequiredFieldResponse fieldsToRead(RequiredFieldList requiredFieldList) throws FrontendException {

   
    String pigLoadSignature = requiredFieldList.getSignature();
    if(pigLoadSignature == null) {
      throw new FrontendException("Zebra Cannot have null loader signature in fieldsToRead");
   
   
    List<RequiredField> rFields = requiredFieldList.getFields();
    if( rFields == null) {
      throw new FrontendException("requiredFieldList.getFields() can not return null in fieldsToRead");
   

    Iterator<RequiredField> it= rFields.iterator();
    String projectionStr = "";
   
    while( it.hasNext()) {
      RequiredField rField = (RequiredField) it.next();
      ColumnSchema cs = projectionSchema.getColumn(rField.getIndex());
     
      if(cs == null) {
        throw new FrontendException
        ("Null column schema in projection schema in fieldsToRead at index " + rField.getIndex());
      }
     
        if(cs.getType() != ColumnType.MAP && (rField.getSubFields() != null)) {     
          throw new FrontendException
          ("Zebra cannot have subfields for a non-map column type in fieldsToRead " +
           "ColumnType:" + cs.getType() + " index in zebra projection schema: " + rField.getIndex()   
          );
        }
        String name = cs.getName();
        projectionStr = projectionStr + name ;
        if(cs.getType() == ColumnType.MAP) {     
          List<RequiredField> subFields = rField.getSubFields();
         
          if( subFields != null ) {
         
              Iterator<RequiredField> its= subFields.iterator();
              boolean flag = false;
              if(its.hasNext()) {
                flag = true;
                projectionStr += "#" + "{";
             
              String tmp = "";
              while(its.hasNext()) {
                RequiredField sField = (RequiredField) its.next()
                tmp = tmp + sField.getAlias();
                if(its.hasNext()) {
                  tmp = tmp + "|";
                }
              } 
              if ( flag) {
                projectionStr = projectionStr + tmp + "}";
              }
          } 
        }
        if(it.hasNext()) {
          projectionStr = projectionStr + " , ";
        }
    }
    Properties p = UDFContext.getUDFContext().getUDFProperties(this.getClass());
   
    if(p == null) {
      throw new FrontendException("Zebra Cannot have null UDFCOntext property");
   
   
    if(projectionStr != null && (projectionStr != ""))
      p.setProperty(pigLoadSignature, projectionStr);
       
View Full Code Here


    return reader.getPosition()-startPos;
  }

  @Override
  public DataBag bytesToBag(byte[] b) throws IOException {
    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }
View Full Code Here

    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }

  @Override
  public String bytesToCharArray(byte[] b) throws IOException {
    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }
View Full Code Here

    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }

  @Override
  public Double bytesToDouble(byte[] b) throws IOException {
    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }
View Full Code Here

    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }

  @Override
  public Float bytesToFloat(byte[] b) throws IOException {
    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }
View Full Code Here

    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }

  @Override
  public Integer bytesToInteger(byte[] b) throws IOException {
    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }
View Full Code Here

    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }

  @Override
  public Long bytesToLong(byte[] b) throws IOException {
    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }
View Full Code Here

    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }

  @Override
  public Map<String, Object> bytesToMap(byte[] b) throws IOException {
    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }
View Full Code Here

    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }

  @Override
  public Tuple bytesToTuple(byte[] b) throws IOException {
    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }
View Full Code Here

    return reader.getPosition()-startPos;
  }

  @Override
  public DataBag bytesToBag(byte[] b) throws IOException {
    throw new FrontendException("SequenceFileLoader does not expect to cast data.");
  }
View Full Code Here

TOP

Related Classes of org.apache.pig.impl.logicalLayer.FrontendException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.