Initial import into git.
[galago.git] / java / pig-galago / src / com / yahoo / pig / impl / logicalLayer / LORead.java
blob15fa66a53e3e5f26609da8b7d8d890e4e0c2d5a3
1 /*
2 * Copyright (c) 2007 Yahoo! Inc. All rights reserved.
3 * See accompanying LICENSE file.
4 */
5 package com.yahoo.pig.impl.logicalLayer;
7 import com.yahoo.pig.impl.PigContext;
8 import com.yahoo.pig.impl.logicalLayer.schema.SchemaItemList;
9 import com.yahoo.pig.impl.physicalLayer.IntermedResult;
12 public class LORead extends LogicalOperator {
13 public IntermedResult readFrom = null;
15 public LORead(PigContext pigContext, IntermedResult readFromIn) {
16 super(pigContext);
17 inputs = new LogicalOperator[0];
19 readFrom = readFromIn;
21 public String name() {
22 return "Read";
24 public String arguments() {
25 return alias;
28 public SchemaItemList outputSchema() {
29 if (schema == null) {
30 if (readFrom.lp != null && readFrom.lp.root != null && readFrom.lp.root.outputSchema() != null) {
31 schema = readFrom.lp.root.outputSchema().copy();
32 } else {
33 schema = new SchemaItemList();
37 schema.alias = alias;
39 return schema;
44 public int getOutputType(){
45 return readFrom.getOutputType();