asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [19/51] [partial] incubator-asterixdb-hyracks git commit: Change folder structure for Java repackage
Date Tue, 25 Aug 2015 16:41:32 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-data/src/main/java/org/apache/hyracks/algebricks/data/utils/WriteValueTools.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-data/src/main/java/org/apache/hyracks/algebricks/data/utils/WriteValueTools.java b/algebricks/algebricks-data/src/main/java/org/apache/hyracks/algebricks/data/utils/WriteValueTools.java
new file mode 100644
index 0000000..3a1203b
--- /dev/null
+++ b/algebricks/algebricks-data/src/main/java/org/apache/hyracks/algebricks/data/utils/WriteValueTools.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.hyracks.algebricks.data.utils;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
+
+public final class WriteValueTools {
+
+    private final static int[] INT_INTERVALS = { 9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999,
+            Integer.MAX_VALUE };
+    private final static int[] INT_DIVIDERS = { 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };
+    private final static int[] DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
+
+    public static void writeInt(int i, OutputStream os) throws IOException {
+        if (i < 0) {
+            if (i == Integer.MIN_VALUE) {
+                os.write("-2147483648".getBytes());
+                return;
+            }
+            os.write('-');
+            i = -i;
+        }
+        int k = 0;
+        for (; k < INT_INTERVALS.length; k++) {
+            if (i <= INT_INTERVALS[k]) {
+                break;
+            }
+        }
+        while (k > 0) {
+            int q = i / INT_DIVIDERS[k - 1];
+            os.write(DIGITS[q % 10]);
+            k--;
+        }
+        // now, print the units
+        os.write(DIGITS[i % 10]);
+    }
+
+    public static void writeLong(long d, OutputStream os) throws IOException {
+        // now, print the units
+        if (d < 0) {
+            if (d == Long.MIN_VALUE) {
+                os.write("-9223372036854775808".getBytes());
+                return;
+            }
+            os.write('-');
+            d = -d;
+        }
+        long divisor = 1000000000000000000L;
+        while (divisor > d) {
+            divisor = divisor / 10;
+        }
+        while (divisor > 1) {
+            os.write(DIGITS[(int) ((d / divisor) % 10)]);
+            divisor = divisor / 10;
+        }
+        os.write(DIGITS[(int) (d % 10)]);
+    }
+
+    public static void writeUTF8String(byte[] b, int s, int l, OutputStream os) throws IOException {
+        int stringLength = UTF8StringPointable.getUTFLength(b, s);
+        int position = s + 2;
+        int maxPosition = position + stringLength;
+        os.write('\"');
+        while (position < maxPosition) {
+            char c = UTF8StringPointable.charAt(b, position);
+            switch (c) {
+            // escape
+                case '\\':
+                case '"':
+                    os.write('\\');
+                    break;
+            }
+            int sz = UTF8StringPointable.charSize(b, position);
+            while (sz > 0) {
+                os.write(b[position]);
+                position++;
+                sz--;
+            }
+        }
+        os.write('\"');
+    }
+
+    public static void writeUTF8StringNoQuotes(byte[] b, int s, int l, OutputStream os) throws IOException {
+        int stringLength = UTF8StringPointable.getUTFLength(b, s);
+        int position = s + 2;
+        int maxPosition = position + stringLength;
+        while (position < maxPosition) {
+            char c = UTF8StringPointable.charAt(b, position);
+            switch (c) {
+            // escape
+                case '\\':
+                case '"':
+                    os.write('\\');
+                    break;
+            }
+            int sz = UTF8StringPointable.charSize(b, position);
+            while (sz > 0) {
+                os.write(b[position]);
+                position++;
+                sz--;
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ASTNode.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ASTNode.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ASTNode.java
deleted file mode 100644
index 1bdf6b2..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ASTNode.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-public abstract class ASTNode {
-    public enum Tag {
-        ASSIGNMENT,
-        DUMP,
-        LOAD,
-        FILTER,
-
-        SCALAR_FUNCTION,
-        LITERAL,
-        FIELD_ACCESS,
-    }
-
-    public abstract Tag getTag();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/AssignmentNode.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/AssignmentNode.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/AssignmentNode.java
deleted file mode 100644
index 71cf26d..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/AssignmentNode.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-public class AssignmentNode extends ASTNode {
-    private String alias;
-
-    private RelationNode relation;
-
-    public AssignmentNode(String alias, RelationNode relation) {
-        this.alias = alias;
-        this.relation = relation;
-    }
-
-    @Override
-    public Tag getTag() {
-        return Tag.ASSIGNMENT;
-    }
-
-    public String getAlias() {
-        return alias;
-    }
-
-    public RelationNode getRelation() {
-        return relation;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/DumpNode.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/DumpNode.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/DumpNode.java
deleted file mode 100644
index 42fca63..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/DumpNode.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-public class DumpNode extends RelationNode {
-    private final String file;
-    private final String alias;
-
-    public DumpNode(String file, String alias) {
-        this.file = file;
-        this.alias = alias;
-    }
-
-    @Override
-    public Tag getTag() {
-        return Tag.DUMP;
-    }
-
-    public String getFile() {
-        return file;
-    }
-
-    public String getAlias() {
-        return alias;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ExpressionNode.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ExpressionNode.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ExpressionNode.java
deleted file mode 100644
index c1482c2..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ExpressionNode.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-public abstract class ExpressionNode extends ASTNode {
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FieldAccessExpressionNode.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FieldAccessExpressionNode.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FieldAccessExpressionNode.java
deleted file mode 100644
index 90b54e6..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FieldAccessExpressionNode.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-public class FieldAccessExpressionNode extends ExpressionNode {
-    private String relationName;
-
-    private String fieldName;
-
-    public FieldAccessExpressionNode(String relationName, String fieldName) {
-        this.relationName = relationName;
-        this.fieldName = fieldName;
-    }
-
-    @Override
-    public Tag getTag() {
-        return Tag.FIELD_ACCESS;
-    }
-
-    public String getRelationName() {
-        return relationName;
-    }
-
-    public String getFieldName() {
-        return fieldName;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FilterNode.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FilterNode.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FilterNode.java
deleted file mode 100644
index b917cbb..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FilterNode.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-public class FilterNode extends RelationNode {
-    private String alias;
-
-    private ExpressionNode expression;
-
-    public FilterNode(String alias, ExpressionNode expression) {
-        this.alias = alias;
-        this.expression = expression;
-    }
-
-    @Override
-    public Tag getTag() {
-        return Tag.FILTER;
-    }
-
-    public String getAlias() {
-        return alias;
-    }
-
-    public ExpressionNode getExpression() {
-        return expression;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FunctionTag.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FunctionTag.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FunctionTag.java
deleted file mode 100644
index 523efb1..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/FunctionTag.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-public enum FunctionTag {
-    BOOLEAN_AND,
-    BOOLEAN_OR,
-    BOOLEAN_NOT,
-
-    EQ,
-    NEQ,
-    LT,
-    LTE,
-    GT,
-    GTE,
-
-    ADD,
-    SUBTRACT,
-    MULTIPLY,
-    DIVIDE,
-    MOD,
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/LiteralExpressionNode.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/LiteralExpressionNode.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/LiteralExpressionNode.java
deleted file mode 100644
index 7b3f2bd..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/LiteralExpressionNode.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-import edu.uci.ics.hyracks.algebricks.examples.piglet.types.Type;
-
-public class LiteralExpressionNode extends ExpressionNode {
-    private String image;
-
-    private Type type;
-
-    public LiteralExpressionNode(String image, Type type) {
-        this.image = image;
-        this.type = type;
-    }
-
-    @Override
-    public Tag getTag() {
-        return Tag.LITERAL;
-    }
-
-    public String getImage() {
-        return image;
-    }
-
-    public Type getType() {
-        return type;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/LoadNode.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/LoadNode.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/LoadNode.java
deleted file mode 100644
index 0ff16b9..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/LoadNode.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-import edu.uci.ics.hyracks.algebricks.examples.piglet.types.Schema;
-
-public class LoadNode extends RelationNode {
-    private String dataFile;
-
-    private Schema schema;
-
-    public LoadNode(String dataFile, Schema schema) {
-        this.dataFile = dataFile;
-        this.schema = schema;
-    }
-    
-    @Override
-    public Tag getTag() {
-        return Tag.LOAD;
-    }
-
-    public String getDataFile() {
-        return dataFile;
-    }
-
-    public Schema getSchema() {
-        return schema;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/RelationNode.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/RelationNode.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/RelationNode.java
deleted file mode 100644
index 9bd7324..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/RelationNode.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-public abstract class RelationNode extends ASTNode {
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ScalarFunctionExpressionNode.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ScalarFunctionExpressionNode.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ScalarFunctionExpressionNode.java
deleted file mode 100644
index a0ce89b..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/ast/ScalarFunctionExpressionNode.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.ast;
-
-import java.util.List;
-
-public class ScalarFunctionExpressionNode extends ExpressionNode {
-    private FunctionTag fTag;
-
-    private String fName;
-
-    private List<ASTNode> arguments;
-
-    public ScalarFunctionExpressionNode(FunctionTag fTag, String fName, List<ASTNode> arguments) {
-        this.fTag = fTag;
-        this.fName = fName;
-        this.arguments = arguments;
-    }
-
-    @Override
-    public Tag getTag() {
-        return Tag.SCALAR_FUNCTION;
-    }
-
-    public FunctionTag getFunctionTag() {
-        return fTag;
-    }
-
-    public String getFunctionName() {
-        return fName;
-    }
-
-    public List<ASTNode> getArguments() {
-        return arguments;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/ConstantValue.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/ConstantValue.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/ConstantValue.java
deleted file mode 100644
index 82276d0..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/ConstantValue.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.compiler;
-
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IAlgebricksConstantValue;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.types.Type;
-
-public final class ConstantValue implements IAlgebricksConstantValue {
-    private final Type type;
-
-    private final String image;
-
-    public ConstantValue(Type type, String image) {
-        this.type = type;
-        this.image = image;
-    }
-
-    public Type getType() {
-        return type;
-    }
-
-    public String getImage() {
-        return image;
-    }
-
-    @Override
-    public boolean isFalse() {
-        return false;
-    }
-
-    @Override
-    public boolean isNull() {
-        return false;
-    }
-
-    @Override
-    public boolean isTrue() {
-        return false;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/PigletCompiler.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/PigletCompiler.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/PigletCompiler.java
deleted file mode 100644
index 820d016..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/PigletCompiler.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.compiler;
-
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.commons.lang3.mutable.Mutable;
-import org.apache.commons.lang3.mutable.MutableObject;
-
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
-import edu.uci.ics.hyracks.algebricks.compiler.api.HeuristicCompilerFactoryBuilder;
-import edu.uci.ics.hyracks.algebricks.compiler.api.ICompiler;
-import edu.uci.ics.hyracks.algebricks.compiler.api.ICompilerFactory;
-import edu.uci.ics.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialFixpointRuleController;
-import edu.uci.ics.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlan;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IExpressionTypeComputer;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.LogicalExpressionJobGenToExpressionRuntimeProviderAdapter;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
-import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.DataSourceScanOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.EmptyTupleSourceOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.SelectOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.WriteOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.plan.ALogicalPlanImpl;
-import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter;
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.AbstractRuleController;
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
-import edu.uci.ics.hyracks.algebricks.data.ISerializerDeserializerProvider;
-import edu.uci.ics.hyracks.algebricks.data.ITypeTraitProvider;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.ASTNode;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.AssignmentNode;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.DumpNode;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.ExpressionNode;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.FieldAccessExpressionNode;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.FilterNode;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.FunctionTag;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.LiteralExpressionNode;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.LoadNode;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.RelationNode;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.ast.ScalarFunctionExpressionNode;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.exceptions.PigletException;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.metadata.PigletFileDataSink;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.metadata.PigletFileDataSource;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.metadata.PigletMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.parser.ParseException;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.parser.PigletParser;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.rewriter.PigletRewriteRuleset;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.runtime.PigletExpressionJobGen;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.types.Schema;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.types.Type;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
-import edu.uci.ics.hyracks.api.job.JobSpecification;
-
-public class PigletCompiler {
-    private static final Logger LOGGER = Logger.getLogger(PigletCompiler.class.getName());
-
-    private static List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> buildDefaultLogicalRewrites() {
-        List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> defaultLogicalRewrites = new ArrayList<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>>();
-        SequentialFixpointRuleController seqCtrlNoDfs = new SequentialFixpointRuleController(false);
-        SequentialFixpointRuleController seqCtrlFullDfs = new SequentialFixpointRuleController(true);
-        SequentialOnceRuleController seqOnceCtrl = new SequentialOnceRuleController(true);
-        defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrl,
-                PigletRewriteRuleset.buildTypeInferenceRuleCollection()));
-        defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlFullDfs,
-                PigletRewriteRuleset.buildNormalizationRuleCollection()));
-        defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs,
-                PigletRewriteRuleset.buildCondPushDownRuleCollection()));
-        defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs,
-                PigletRewriteRuleset.buildJoinInferenceRuleCollection()));
-        defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs,
-                PigletRewriteRuleset.buildOpPushDownRuleCollection()));
-        defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrl,
-                PigletRewriteRuleset.buildDataExchangeRuleCollection()));
-        defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs,
-                PigletRewriteRuleset.buildConsolidationRuleCollection()));
-        return defaultLogicalRewrites;
-    }
-
-    private static List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> buildDefaultPhysicalRewrites() {
-        List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> defaultPhysicalRewrites = new ArrayList<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>>();
-        SequentialOnceRuleController seqOnceCtrlAllLevels = new SequentialOnceRuleController(true);
-        SequentialOnceRuleController seqOnceCtrlTopLevel = new SequentialOnceRuleController(false);
-        defaultPhysicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrlAllLevels,
-                PigletRewriteRuleset.buildPhysicalRewritesAllLevelsRuleCollection()));
-        defaultPhysicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrlTopLevel,
-                PigletRewriteRuleset.buildPhysicalRewritesTopLevelRuleCollection()));
-        defaultPhysicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrlAllLevels,
-                PigletRewriteRuleset.prepareForJobGenRuleCollection()));
-        return defaultPhysicalRewrites;
-    }
-
-    private final ICompilerFactory cFactory;
-
-    private final PigletMetadataProvider metadataProvider;
-
-    private int varCounter;
-
-    private ILogicalOperator previousOp;
-
-    public PigletCompiler() {
-        HeuristicCompilerFactoryBuilder builder = new HeuristicCompilerFactoryBuilder();
-        builder.setLogicalRewrites(buildDefaultLogicalRewrites());
-        builder.setPhysicalRewrites(buildDefaultPhysicalRewrites());
-        builder.setSerializerDeserializerProvider(new ISerializerDeserializerProvider() {
-            @SuppressWarnings("unchecked")
-            @Override
-            public ISerializerDeserializer getSerializerDeserializer(Object type) throws AlgebricksException {
-                return null;
-            }
-        });
-        builder.setTypeTraitProvider(new ITypeTraitProvider() {
-            public ITypeTraits getTypeTrait(Object type) {
-                return null;
-            }
-        });
-        builder.setPrinterProvider(PigletPrinterFactoryProvider.INSTANCE);
-        builder.setExpressionRuntimeProvider(new LogicalExpressionJobGenToExpressionRuntimeProviderAdapter(
-                new PigletExpressionJobGen()));
-        builder.setExpressionTypeComputer(new IExpressionTypeComputer() {
-            @Override
-            public Object getType(ILogicalExpression expr, IMetadataProvider<?, ?> metadataProvider,
-                    IVariableTypeEnvironment env) throws AlgebricksException {
-                return null;
-            }
-        });
-        cFactory = builder.create();
-        metadataProvider = new PigletMetadataProvider();
-    }
-
-    public List<ASTNode> parse(Reader in) throws ParseException {
-        PigletParser parser = new PigletParser(in);
-        List<ASTNode> statements = parser.Statements();
-        return statements;
-    }
-
-    public JobSpecification compile(List<ASTNode> ast) throws AlgebricksException, PigletException {
-        ILogicalPlan plan = translate(ast);
-        if (LOGGER.isLoggable(Level.INFO)) {
-            LOGGER.info("Translated Plan:");
-            LOGGER.info(getPrettyPrintedPlan(plan));
-        }
-        ICompiler compiler = cFactory.createCompiler(plan, metadataProvider, varCounter);
-        compiler.optimize();
-        if (LOGGER.isLoggable(Level.INFO)) {
-            LOGGER.info("Optimized Plan:");
-            LOGGER.info(getPrettyPrintedPlan(plan));
-        }
-        return compiler.createJob(null, null);
-    }
-
-    private ILogicalPlan translate(List<ASTNode> ast) throws PigletException {
-        Map<String, Relation> symMap = new HashMap<String, Relation>();
-        List<Mutable<ILogicalOperator>> roots = new ArrayList<Mutable<ILogicalOperator>>();
-        previousOp = null;
-        for (ASTNode an : ast) {
-            switch (an.getTag()) {
-                case DUMP: {
-                    DumpNode dn = (DumpNode) an;
-                    Relation input = symMap.get(dn.getAlias());
-                    List<Mutable<ILogicalExpression>> expressions = new ArrayList<Mutable<ILogicalExpression>>();
-                    for (LogicalVariable v : input.schema.values()) {
-                        expressions.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(v)));
-                    }
-                    PigletFileDataSink dataSink = new PigletFileDataSink(dn.getFile());
-                    ILogicalOperator op = new WriteOperator(expressions, dataSink);
-                    op.getInputs().add(new MutableObject<ILogicalOperator>(input.op));
-                    roots.add(new MutableObject<ILogicalOperator>(op));
-                }
-                    break;
-
-                case ASSIGNMENT: {
-                    AssignmentNode asn = (AssignmentNode) an;
-                    String alias = asn.getAlias();
-                    RelationNode rn = asn.getRelation();
-                    Relation rel = translate(rn, symMap);
-                    previousOp = rel.op;
-                    rel.alias = alias;
-                    symMap.put(alias, rel);
-                }
-                    break;
-            }
-        }
-        return new ALogicalPlanImpl(roots);
-    }
-
-    private Relation translate(RelationNode rn, Map<String, Relation> symMap) throws PigletException {
-        switch (rn.getTag()) {
-            case LOAD: {
-                LoadNode ln = (LoadNode) rn;
-                String file = ln.getDataFile();
-                Schema schema = ln.getSchema();
-                List<Pair<String, Type>> fieldsSchema = schema.getSchema();
-                List<LogicalVariable> variables = new ArrayList<LogicalVariable>();
-                List<Object> types = new ArrayList<Object>();
-                Relation rel = new Relation();
-                for (Pair<String, Type> p : fieldsSchema) {
-                    LogicalVariable v = newVariable();
-                    rel.schema.put(p.first, v);
-                    variables.add(v);
-                    types.add(p.second);
-                }
-                PigletFileDataSource ds = new PigletFileDataSource(file, types.toArray());
-                rel.op = new DataSourceScanOperator(variables, ds);
-                rel.op.getInputs().add(
-                        new MutableObject<ILogicalOperator>(previousOp == null ? new EmptyTupleSourceOperator()
-                                : previousOp));
-                return rel;
-            }
-
-            case FILTER: {
-                FilterNode fn = (FilterNode) rn;
-                String alias = fn.getAlias();
-                ExpressionNode conditionNode = fn.getExpression();
-                Relation inputRel = findInputRelation(alias, symMap);
-                Pair<Relation, LogicalVariable> tempInput = translateScalarExpression(inputRel, conditionNode);
-                Relation rel = new Relation();
-                rel.op = new SelectOperator(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(
-                        tempInput.second)), false, null);
-                rel.op.getInputs().add(new MutableObject<ILogicalOperator>(tempInput.first.op));
-                rel.schema.putAll(tempInput.first.schema);
-                return rel;
-            }
-        }
-        throw new IllegalArgumentException("Unknown node: " + rn.getTag() + " encountered");
-    }
-
-    private Pair<Relation, LogicalVariable> translateScalarExpression(Relation inputRel, ExpressionNode expressionNode)
-            throws PigletException {
-        switch (expressionNode.getTag()) {
-            case FIELD_ACCESS: {
-                FieldAccessExpressionNode faen = (FieldAccessExpressionNode) expressionNode;
-                String fieldName = faen.getFieldName();
-                LogicalVariable lVar = findField(fieldName, inputRel.schema);
-                return new Pair<Relation, LogicalVariable>(inputRel, lVar);
-            }
-
-            case LITERAL: {
-                LiteralExpressionNode len = (LiteralExpressionNode) expressionNode;
-                String image = len.getImage();
-                Type type = len.getType();
-                ConstantExpression ce = new ConstantExpression(new ConstantValue(type, image));
-                Relation rel = new Relation();
-                LogicalVariable var = newVariable();
-                List<LogicalVariable> vars = new ArrayList<LogicalVariable>();
-                vars.add(var);
-
-                List<Mutable<ILogicalExpression>> exprs = new ArrayList<Mutable<ILogicalExpression>>();
-                exprs.add(new MutableObject<ILogicalExpression>(ce));
-
-                rel.op = new AssignOperator(vars, exprs);
-                rel.op.getInputs().add(new MutableObject<ILogicalOperator>(inputRel.op));
-                rel.schema.putAll(inputRel.schema);
-
-                return new Pair<Relation, LogicalVariable>(rel, var);
-            }
-
-            case SCALAR_FUNCTION: {
-                ScalarFunctionExpressionNode sfen = (ScalarFunctionExpressionNode) expressionNode;
-                List<Mutable<ILogicalExpression>> argExprs = new ArrayList<Mutable<ILogicalExpression>>();
-                List<ASTNode> arguments = sfen.getArguments();
-                Relation rel = inputRel;
-                for (ASTNode a : arguments) {
-                    Pair<Relation, LogicalVariable> argPair = translateScalarExpression(rel, (ExpressionNode) a);
-                    rel = argPair.first;
-                    argExprs.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(argPair.second)));
-                }
-                Relation outRel = new Relation();
-                outRel.schema.putAll(rel.schema);
-                LogicalVariable var = newVariable();
-                List<LogicalVariable> vars = new ArrayList<LogicalVariable>();
-                vars.add(var);
-
-                IFunctionInfo fInfo = lookupFunction(sfen.getFunctionTag(), sfen.getFunctionName());
-
-                List<Mutable<ILogicalExpression>> exprs = new ArrayList<Mutable<ILogicalExpression>>();
-                exprs.add(new MutableObject<ILogicalExpression>(new ScalarFunctionCallExpression(fInfo, argExprs)));
-                outRel.op = new AssignOperator(vars, exprs);
-                outRel.op.getInputs().add(new MutableObject<ILogicalOperator>(rel.op));
-                return new Pair<Relation, LogicalVariable>(outRel, var);
-            }
-        }
-        return null;
-    }
-
-    private IFunctionInfo lookupFunction(FunctionTag functionTag, String functionName) throws PigletException {
-        switch (functionTag) {
-            case EQ:
-                return metadataProvider.lookupFunction(AlgebricksBuiltinFunctions.EQ);
-
-            case NEQ:
-                return metadataProvider.lookupFunction(AlgebricksBuiltinFunctions.NEQ);
-
-            case LT:
-                return metadataProvider.lookupFunction(AlgebricksBuiltinFunctions.LT);
-
-            case LTE:
-                return metadataProvider.lookupFunction(AlgebricksBuiltinFunctions.LE);
-
-            case GT:
-                return metadataProvider.lookupFunction(AlgebricksBuiltinFunctions.GT);
-
-            case GTE:
-                return metadataProvider.lookupFunction(AlgebricksBuiltinFunctions.GE);
-        }
-        throw new PigletException("Unsupported function: " + functionTag);
-    }
-
-    private LogicalVariable newVariable() {
-        return new LogicalVariable(varCounter++);
-    }
-
-    private LogicalVariable findField(String fieldName, Map<String, LogicalVariable> schema) throws PigletException {
-        LogicalVariable var = schema.get(fieldName);
-        if (var == null) {
-            throw new PigletException("Unable to find field named: " + fieldName);
-        }
-        return var;
-    }
-
-    private Relation findInputRelation(String alias, Map<String, Relation> symMap) throws PigletException {
-        Relation rel = symMap.get(alias);
-        if (rel == null) {
-            throw new PigletException("Unknown alias " + alias + "referenced");
-        }
-        return rel;
-    }
-
-    private static class Relation {
-        String alias;
-        ILogicalOperator op;
-        final Map<String, LogicalVariable> schema;
-
-        public Relation() {
-            schema = new LinkedHashMap<String, LogicalVariable>();
-        }
-    }
-
-    private String getPrettyPrintedPlan(ILogicalPlan plan) throws AlgebricksException {
-        LogicalOperatorPrettyPrintVisitor v = new LogicalOperatorPrettyPrintVisitor();
-        StringBuilder buffer = new StringBuilder();
-        PlanPrettyPrinter.printPlan(plan, buffer, v, 0);
-        return buffer.toString();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/PigletPrinterFactoryProvider.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/PigletPrinterFactoryProvider.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/PigletPrinterFactoryProvider.java
deleted file mode 100644
index beb4e32..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/compiler/PigletPrinterFactoryProvider.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.compiler;
-
-import java.io.IOException;
-import java.io.PrintStream;
-
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.data.IPrinter;
-import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-import edu.uci.ics.hyracks.algebricks.data.IPrinterFactoryProvider;
-import edu.uci.ics.hyracks.algebricks.data.impl.IntegerPrinterFactory;
-import edu.uci.ics.hyracks.algebricks.data.utils.WriteValueTools;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.types.Type;
-import edu.uci.ics.hyracks.data.std.primitive.FloatPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.marshalling.FloatSerializerDeserializer;
-
-public class PigletPrinterFactoryProvider implements IPrinterFactoryProvider {
-
-    public static final PigletPrinterFactoryProvider INSTANCE = new PigletPrinterFactoryProvider();
-
-    private PigletPrinterFactoryProvider() {
-    }
-
-    @Override
-    public IPrinterFactory getPrinterFactory(Object type) throws AlgebricksException {
-        Type t = (Type) type;
-        switch (t.getTag()) {
-            case INTEGER:
-                return IntegerPrinterFactory.INSTANCE;
-            case CHAR_ARRAY:
-                return CharArrayPrinterFactory.INSTANCE;
-            case FLOAT:
-                return FloatPrinterFactory.INSTANCE;
-            default:
-                throw new UnsupportedOperationException();
-
-        }
-    }
-
-    public static class CharArrayPrinterFactory implements IPrinterFactory {
-
-        private static final long serialVersionUID = 1L;
-
-        public static final CharArrayPrinterFactory INSTANCE = new CharArrayPrinterFactory();
-
-        private CharArrayPrinterFactory() {
-        }
-
-        @Override
-        public IPrinter createPrinter() {
-            return new IPrinter() {
-                @Override
-                public void init() throws AlgebricksException {
-                }
-
-                @Override
-                public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
-                    try {
-                        WriteValueTools.writeUTF8String(b, s, l, ps);
-                    } catch (IOException e) {
-                        throw new AlgebricksException(e);
-                    }
-                }
-            };
-        }
-    }
-
-    public static class FloatPrinterFactory implements IPrinterFactory {
-
-        private static final long serialVersionUID = 1L;
-
-        public static final FloatPrinterFactory INSTANCE = new FloatPrinterFactory();
-
-        private FloatPrinterFactory() {
-        }
-
-        @Override
-        public IPrinter createPrinter() {
-            return new IPrinter() {
-                @Override
-                public void init() throws AlgebricksException {
-                }
-
-                @Override
-                public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
-                    ps.print(FloatPointable.getFloat(b, s));
-                }
-            };
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/exceptions/PigletException.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/exceptions/PigletException.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/exceptions/PigletException.java
deleted file mode 100644
index aa28f34..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/exceptions/PigletException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.exceptions;
-
-public class PigletException extends Exception {
-    private static final long serialVersionUID = 1L;
-
-    public PigletException(String message) {
-        super(message);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/FileSplitUtils.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/FileSplitUtils.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/FileSplitUtils.java
deleted file mode 100644
index 1ac4259..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/FileSplitUtils.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.metadata;
-
-import java.io.File;
-
-import edu.uci.ics.hyracks.api.io.FileReference;
-import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
-
-public class FileSplitUtils {
-    public static FileSplit[] parseFileSplits(String fileSplits) {
-        String[] splits = fileSplits.split(",");
-        FileSplit[] fSplits = new FileSplit[splits.length];
-        for (int i = 0; i < splits.length; ++i) {
-            String s = splits[i].trim();
-            int idx = s.indexOf(':');
-            if (idx < 0) {
-                throw new IllegalArgumentException("File split " + s + " not well formed");
-            }
-            fSplits[i] = new FileSplit(s.substring(0, idx), new FileReference(new File(s.substring(idx + 1))));
-        }
-        return fSplits;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFileDataSink.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFileDataSink.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFileDataSink.java
deleted file mode 100644
index 6ab624d..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFileDataSink.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.metadata;
-
-import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSink;
-import edu.uci.ics.hyracks.algebricks.core.algebra.properties.FileSplitDomain;
-import edu.uci.ics.hyracks.algebricks.core.algebra.properties.IPartitioningProperty;
-import edu.uci.ics.hyracks.algebricks.core.algebra.properties.RandomPartitioningProperty;
-import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
-
-public class PigletFileDataSink implements IDataSink {
-    private String file;
-
-    private FileSplit[] fileSplits;
-
-    private IPartitioningProperty partProp;
-
-    public PigletFileDataSink(String file) {
-        this.file = file;
-        fileSplits = FileSplitUtils.parseFileSplits(file);
-        partProp = new RandomPartitioningProperty(new FileSplitDomain(fileSplits));
-    }
-
-    @Override
-    public Object getId() {
-        return file;
-    }
-
-    public FileSplit[] getFileSplits() {
-        return fileSplits;
-    }
-
-    @Override
-    public Object[] getSchemaTypes() {
-        return null;
-    }
-
-    @Override
-    public IPartitioningProperty getPartitioningProperty() {
-        return partProp;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFileDataSource.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFileDataSource.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFileDataSource.java
deleted file mode 100644
index 076e15a..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFileDataSource.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.metadata;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
-import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSource;
-import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSourcePropertiesProvider;
-import edu.uci.ics.hyracks.algebricks.core.algebra.properties.FileSplitDomain;
-import edu.uci.ics.hyracks.algebricks.core.algebra.properties.FunctionalDependency;
-import edu.uci.ics.hyracks.algebricks.core.algebra.properties.ILocalStructuralProperty;
-import edu.uci.ics.hyracks.algebricks.core.algebra.properties.IPhysicalPropertiesVector;
-import edu.uci.ics.hyracks.algebricks.core.algebra.properties.RandomPartitioningProperty;
-import edu.uci.ics.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector;
-import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
-
-public class PigletFileDataSource implements IDataSource<String> {
-    private final String file;
-
-    private final Object[] types;
-
-    private final FileSplit[] fileSplits;
-
-    private IDataSourcePropertiesProvider propProvider;
-
-    public PigletFileDataSource(String file, Object[] types) {
-        this.file = file;
-        this.types = types;
-        fileSplits = FileSplitUtils.parseFileSplits(file);
-        final IPhysicalPropertiesVector vec = new StructuralPropertiesVector(new RandomPartitioningProperty(
-                new FileSplitDomain(fileSplits)), new ArrayList<ILocalStructuralProperty>());
-        propProvider = new IDataSourcePropertiesProvider() {
-            @Override
-            public IPhysicalPropertiesVector computePropertiesVector(List<LogicalVariable> scanVariables) {
-                return vec;
-            }
-        };
-    }
-
-    @Override
-    public String getId() {
-        return file;
-    }
-
-    @Override
-    public Object[] getSchemaTypes() {
-        return types;
-    }
-
-    public FileSplit[] getFileSplits() {
-        return fileSplits;
-    }
-
-    @Override
-    public IDataSourcePropertiesProvider getPropertiesProvider() {
-        return propProvider;
-    }
-
-    @Override
-    public void computeFDs(List<LogicalVariable> scanVariables, List<FunctionalDependency> fdList) {
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFunction.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFunction.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFunction.java
deleted file mode 100644
index ba5c5aa..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletFunction.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.metadata;
-
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AbstractFunctionInfo;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
-
-public class PigletFunction extends AbstractFunctionInfo {
-    private static final long serialVersionUID = 1L;
-
-    private final FunctionIdentifier fid;
-
-    public PigletFunction(FunctionIdentifier fid) {
-        super(true);
-        this.fid = fid;
-    }
-
-    @Override
-    public FunctionIdentifier getFunctionIdentifier() {
-        return fid;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletMetadataProvider.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletMetadataProvider.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletMetadataProvider.java
deleted file mode 100644
index 099520d..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/metadata/PigletMetadataProvider.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.metadata;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
-import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
-import edu.uci.ics.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
-import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSink;
-import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSource;
-import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSourceIndex;
-import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.IOperatorSchema;
-import edu.uci.ics.hyracks.algebricks.core.jobgen.impl.JobGenContext;
-import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-import edu.uci.ics.hyracks.algebricks.examples.piglet.types.Type;
-import edu.uci.ics.hyracks.algebricks.runtime.base.IPushRuntimeFactory;
-import edu.uci.ics.hyracks.algebricks.runtime.operators.std.SinkWriterRuntimeFactory;
-import edu.uci.ics.hyracks.algebricks.runtime.writers.PrinterBasedWriterFactory;
-import edu.uci.ics.hyracks.api.dataflow.IOperatorDescriptor;
-import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.api.dataflow.value.RecordDescriptor;
-import edu.uci.ics.hyracks.api.job.JobSpecification;
-import edu.uci.ics.hyracks.dataflow.common.data.marshalling.FloatSerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.FloatParserFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.IntegerParserFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.parsers.UTF8StringParserFactory;
-import edu.uci.ics.hyracks.dataflow.std.file.ConstantFileSplitProvider;
-import edu.uci.ics.hyracks.dataflow.std.file.DelimitedDataTupleParserFactory;
-import edu.uci.ics.hyracks.dataflow.std.file.FileScanOperatorDescriptor;
-import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
-import edu.uci.ics.hyracks.dataflow.std.file.IFileSplitProvider;
-import edu.uci.ics.hyracks.dataflow.std.file.ITupleParserFactory;
-
-public class PigletMetadataProvider implements IMetadataProvider<String, String> {
-    private static final Map<FunctionIdentifier, PigletFunction> FN_MAP;
-
-    static {
-        Map<FunctionIdentifier, PigletFunction> map = new HashMap<FunctionIdentifier, PigletFunction>();
-
-        map.put(AlgebricksBuiltinFunctions.EQ, new PigletFunction(AlgebricksBuiltinFunctions.EQ));
-
-        FN_MAP = Collections.unmodifiableMap(map);
-    }
-
-    @Override
-    public IDataSource<String> findDataSource(String id) throws AlgebricksException {
-        return null;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getScannerRuntime(IDataSource<String> dataSource,
-            List<LogicalVariable> scanVariables, List<LogicalVariable> projectVariables, boolean projectPushed,
-            List<LogicalVariable> minFilterVars, List<LogicalVariable> maxFilterVars, IOperatorSchema opSchema,
-            IVariableTypeEnvironment typeEnv, JobGenContext context, JobSpecification jobSpec, Object implConfig)
-            throws AlgebricksException {
-        PigletFileDataSource ds = (PigletFileDataSource) dataSource;
-
-        FileSplit[] fileSplits = ds.getFileSplits();
-        String[] locations = new String[fileSplits.length];
-        for (int i = 0; i < fileSplits.length; ++i) {
-            locations[i] = fileSplits[i].getNodeName();
-        }
-        IFileSplitProvider fsp = new ConstantFileSplitProvider(fileSplits);
-
-        Object[] colTypes = ds.getSchemaTypes();
-        IValueParserFactory[] vpfs = new IValueParserFactory[colTypes.length];
-        ISerializerDeserializer[] serDesers = new ISerializerDeserializer[colTypes.length];
-
-        for (int i = 0; i < colTypes.length; ++i) {
-            Type colType = (Type) colTypes[i];
-            IValueParserFactory vpf;
-            ISerializerDeserializer serDeser;
-            switch (colType.getTag()) {
-                case INTEGER:
-                    vpf = IntegerParserFactory.INSTANCE;
-                    serDeser = IntegerSerializerDeserializer.INSTANCE;
-                    break;
-
-                case CHAR_ARRAY:
-                    vpf = UTF8StringParserFactory.INSTANCE;
-                    serDeser = UTF8StringSerializerDeserializer.INSTANCE;
-                    break;
-
-                case FLOAT:
-                    vpf = FloatParserFactory.INSTANCE;
-                    serDeser = FloatSerializerDeserializer.INSTANCE;
-                    break;
-
-                default:
-                    throw new UnsupportedOperationException();
-            }
-            vpfs[i] = vpf;
-            serDesers[i] = serDeser;
-        }
-
-        ITupleParserFactory tpf = new DelimitedDataTupleParserFactory(vpfs, ',');
-        RecordDescriptor rDesc = new RecordDescriptor(serDesers);
-
-        IOperatorDescriptor scanner = new FileScanOperatorDescriptor(jobSpec, fsp, tpf, rDesc);
-        AlgebricksAbsolutePartitionConstraint constraint = new AlgebricksAbsolutePartitionConstraint(locations);
-        return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(scanner, constraint);
-    }
-
-    @Override
-    public boolean scannerOperatorIsLeaf(IDataSource<String> dataSource) {
-        return true;
-    }
-
-    @Override
-    public Pair<IPushRuntimeFactory, AlgebricksPartitionConstraint> getWriteFileRuntime(IDataSink sink,
-            int[] printColumns, IPrinterFactory[] printerFactories, RecordDescriptor inputDesc)
-            throws AlgebricksException {
-        PigletFileDataSink ds = (PigletFileDataSink) sink;
-        FileSplit[] fileSplits = ds.getFileSplits();
-        String[] locations = new String[fileSplits.length];
-        for (int i = 0; i < fileSplits.length; ++i) {
-            locations[i] = fileSplits[i].getNodeName();
-        }
-        IPushRuntimeFactory prf = new SinkWriterRuntimeFactory(printColumns, printerFactories, fileSplits[0]
-                .getLocalFile().getFile(), PrinterBasedWriterFactory.INSTANCE, inputDesc);
-        AlgebricksAbsolutePartitionConstraint constraint = new AlgebricksAbsolutePartitionConstraint(locations);
-        return new Pair<IPushRuntimeFactory, AlgebricksPartitionConstraint>(prf, constraint);
-    }
-
-    @Override
-    public IDataSourceIndex<String, String> findDataSourceIndex(String indexId, String dataSourceId)
-            throws AlgebricksException {
-        return null;
-    }
-
-    @Override
-    public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getResultHandleRuntime(IDataSink sink,
-            int[] printColumns, IPrinterFactory[] printerFactories, RecordDescriptor inputDesc, boolean ordered,
-            JobSpecification spec) throws AlgebricksException {
-        return null;
-    }
-
-    @Override
-    public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getWriteResultRuntime(
-            IDataSource<String> dataSource, IOperatorSchema propagatedSchema, List<LogicalVariable> keys,
-            LogicalVariable payLoadVar, List<LogicalVariable> additionalNonKeyFields, JobGenContext context,
-            JobSpecification jobSpec) throws AlgebricksException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getIndexInsertRuntime(
-            IDataSourceIndex<String, String> dataSource,
-            IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas,
-            IVariableTypeEnvironment typeEnv,
-            List<LogicalVariable> primaryKeys,
-            List<LogicalVariable> secondaryKeys,
-            List<LogicalVariable> additionalNonKeyFields,
-            ILogicalExpression filterExpr,
-            RecordDescriptor recordDesc, JobGenContext context,
-            JobSpecification spec, boolean bulkload) throws AlgebricksException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getIndexDeleteRuntime(
-            IDataSourceIndex<String, String> dataSource, IOperatorSchema propagatedSchema,
-            IOperatorSchema[] inputSchemas, IVariableTypeEnvironment typeEnv, List<LogicalVariable> primaryKeys,
-            List<LogicalVariable> secondaryKeys, List<LogicalVariable> additionalNonKeyFields,
-            ILogicalExpression filterExpr, RecordDescriptor recordDesc, JobGenContext context, JobSpecification spec)
-            throws AlgebricksException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getTokenizerRuntime(
-            IDataSourceIndex<String, String> dataSource, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas,
-            IVariableTypeEnvironment typeEnv, List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys,
-            ILogicalExpression filterExpr, RecordDescriptor recordDesc,
-            JobGenContext context, JobSpecification spec, boolean bulkload) throws AlgebricksException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public IFunctionInfo lookupFunction(FunctionIdentifier fid) {
-        return FN_MAP.get(fid);
-    }
-
-    @Override
-    public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getInsertRuntime(IDataSource<String> dataSource,
-            IOperatorSchema propagatedSchema, IVariableTypeEnvironment typeEnv, List<LogicalVariable> keys,
-            LogicalVariable payLoadVar, List<LogicalVariable> additionalNonKeyFields, RecordDescriptor recordDesc,
-            JobGenContext context, JobSpecification jobSpec, boolean bulkload) throws AlgebricksException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getDeleteRuntime(IDataSource<String> dataSource,
-            IOperatorSchema propagatedSchema, IVariableTypeEnvironment typeEnv, List<LogicalVariable> keys,
-            LogicalVariable payLoadVar, List<LogicalVariable> additionalNonKeyFields, RecordDescriptor recordDesc,
-            JobGenContext context, JobSpecification jobSpec) throws AlgebricksException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/9939b48e/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/rewriter/PigletRewriteRuleset.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/rewriter/PigletRewriteRuleset.java b/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/rewriter/PigletRewriteRuleset.java
deleted file mode 100644
index 1c2cfae..0000000
--- a/algebricks/algebricks-examples/piglet-example/src/main/java/edu/uci/ics/hyracks/algebricks/examples/piglet/rewriter/PigletRewriteRuleset.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hyracks.algebricks.examples.piglet.rewriter;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.HeuristicOptimizer;
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.BreakSelectIntoConjunctsRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.ComplexJoinInferenceRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.ConsolidateAssignsRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.ConsolidateSelectsRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.EliminateSubplanRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.EnforceStructuralPropertiesRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.ExtractCommonOperatorsRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.ExtractGbyExpressionsRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.FactorRedundantGroupAndDecorVarsRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.InferTypesRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.InlineVariablesRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.IsolateHyracksOperatorsRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.PullSelectOutOfEqJoin;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.CopyLimitDownRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushProjectDownRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushProjectIntoDataSourceScanRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushSelectDownRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.PushSelectIntoJoinRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.ReinferAllTypesRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.RemoveUnusedAssignAndAggregateRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule;
-import edu.uci.ics.hyracks.algebricks.rewriter.rules.SetExecutionModeRule;
-
-public class PigletRewriteRuleset {
-
-    public final static List<IAlgebraicRewriteRule> buildTypeInferenceRuleCollection() {
-        List<IAlgebraicRewriteRule> typeInfer = new LinkedList<IAlgebraicRewriteRule>();
-        typeInfer.add(new InferTypesRule());
-        return typeInfer;
-    }
-
-    public final static List<IAlgebraicRewriteRule> buildNormalizationRuleCollection() {
-        List<IAlgebraicRewriteRule> normalization = new LinkedList<IAlgebraicRewriteRule>();
-        normalization.add(new EliminateSubplanRule());
-        // TODO: This rule is incorrect and has been removed. Its replacement in
-        // Asterix (PushAggFuncIntoStandaloneAggregateRule)
-        // is language-specific.
-        // normalization.add(new IntroduceGroupByForStandaloneAggregRule());
-        normalization.add(new BreakSelectIntoConjunctsRule());
-        normalization.add(new PushSelectIntoJoinRule());
-        normalization.add(new ExtractGbyExpressionsRule());
-        return normalization;
-    }
-
-    public final static List<IAlgebraicRewriteRule> buildCondPushDownRuleCollection() {
-        List<IAlgebraicRewriteRule> condPushDown = new LinkedList<IAlgebraicRewriteRule>();
-        condPushDown.add(new PushSelectDownRule());
-        condPushDown.add(new InlineVariablesRule());
-        condPushDown.add(new FactorRedundantGroupAndDecorVarsRule());
-        condPushDown.add(new EliminateSubplanRule());
-        return condPushDown;
-    }
-
-    public final static List<IAlgebraicRewriteRule> buildJoinInferenceRuleCollection() {
-        List<IAlgebraicRewriteRule> joinInference = new LinkedList<IAlgebraicRewriteRule>();
-        joinInference.add(new InlineVariablesRule());
-        joinInference.add(new ComplexJoinInferenceRule());
-        return joinInference;
-    }
-
-    public final static List<IAlgebraicRewriteRule> buildOpPushDownRuleCollection() {
-        List<IAlgebraicRewriteRule> opPushDown = new LinkedList<IAlgebraicRewriteRule>();
-        opPushDown.add(new PushProjectDownRule());
-        opPushDown.add(new PushSelectDownRule());
-        return opPushDown;
-    }
-
-    public final static List<IAlgebraicRewriteRule> buildDataExchangeRuleCollection() {
-        List<IAlgebraicRewriteRule> dataExchange = new LinkedList<IAlgebraicRewriteRule>();
-        dataExchange.add(new SetExecutionModeRule());
-        return dataExchange;
-    }
-
-    public final static List<IAlgebraicRewriteRule> buildConsolidationRuleCollection() {
-        List<IAlgebraicRewriteRule> consolidation = new LinkedList<IAlgebraicRewriteRule>();
-        consolidation.add(new ConsolidateSelectsRule());
-        consolidation.add(new ConsolidateAssignsRule());
-        consolidation.add(new RemoveUnusedAssignAndAggregateRule());
-        return consolidation;
-    }
-
-    public final static List<IAlgebraicRewriteRule> buildPhysicalRewritesAllLevelsRuleCollection() {
-        List<IAlgebraicRewriteRule> physicalPlanRewrites = new LinkedList<IAlgebraicRewriteRule>();
-        physicalPlanRewrites.add(new PullSelectOutOfEqJoin());
-        physicalPlanRewrites.add(new SetAlgebricksPhysicalOperatorsRule());
-        physicalPlanRewrites.add(new EnforceStructuralPropertiesRule());
-        physicalPlanRewrites.add(new PushProjectDownRule());
-        physicalPlanRewrites.add(new CopyLimitDownRule());
-        return physicalPlanRewrites;
-    }
-
-    public final static List<IAlgebraicRewriteRule> buildPhysicalRewritesTopLevelRuleCollection() {
-        List<IAlgebraicRewriteRule> physicalPlanRewrites = new LinkedList<IAlgebraicRewriteRule>();
-        physicalPlanRewrites.add(new CopyLimitDownRule());
-        return physicalPlanRewrites;
-    }
-
-    public final static List<IAlgebraicRewriteRule> prepareForJobGenRuleCollection() {
-        List<IAlgebraicRewriteRule> prepareForJobGenRewrites = new LinkedList<IAlgebraicRewriteRule>();
-        prepareForJobGenRewrites.add(new IsolateHyracksOperatorsRule(
-                HeuristicOptimizer.hyraxOperatorsBelowWhichJobGenIsDisabled));
-        prepareForJobGenRewrites.add(new ExtractCommonOperatorsRule());
-        // Re-infer all types, so that, e.g., the effect of not-is-null is
-        // propagated.
-        prepareForJobGenRewrites.add(new PushProjectIntoDataSourceScanRule());
-        prepareForJobGenRewrites.add(new ReinferAllTypesRule());
-        return prepareForJobGenRewrites;
-    }
-
-}
\ No newline at end of file


Mime
View raw message