Initial import into git.
[galago.git] / java / pig-galago / src / com / yahoo / pig / impl / logicalLayer / LOStore.java
blob2bfde64d1e1a22ca4466736a63c7b996ecbb4e53
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 java.util.List;
9 import com.yahoo.pig.impl.PigContext;
10 import com.yahoo.pig.impl.logicalLayer.schema.SchemaItemList;
12 public class LOStore extends LogicalOperator {
13 public String filename;
14 public String sf;
15 public boolean append;
17 public LOStore(PigContext pigContext, LogicalOperator input, String filenameIn, String funcIn, boolean append) {
18 super(pigContext);
19 inputs = new LogicalOperator[1];
20 inputs[0] = input;
21 filename = filenameIn;
22 sf = funcIn;
23 this.append = append;
24 getOutputType();
27 public String name() {
28 return "Store";
31 public SchemaItemList outputSchema() {
32 throw new RuntimeException("Internal error: Asking for schema of a store operator.");
35 public int getOutputType() {
36 switch (inputs[0].getOutputType()) {
37 case FIXED:
38 return FIXED;
39 case MONOTONE:
40 return MONOTONE;
41 default:
42 throw new RuntimeException("Illegal input type for store operator");
46 public List<String> getFuncs() {
47 List<String> funcs = super.getFuncs();
48 funcs.add(sf);
49 return funcs;