index) throws ExecException {
32 | this.index = index;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/org/apache/pig/impl/streaming/StreamingUDFInputHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.pig.impl.streaming;
19 |
20 | import org.apache.pig.PigStreamingBase;
21 |
22 | public class StreamingUDFInputHandler extends DefaultInputHandler {
23 |
24 | public StreamingUDFInputHandler(PigStreamingBase serializer) {
25 | this.serializer = serializer;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/org/apache/pig/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Public interfaces and classes for Pig.
6 |
7 | {@link org.apache.pig.PigServer} is the interface to Pig for use by other java
8 | programs. Other interfaces and classes in this package are for use by users
9 | when implementing user defined functions.
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/org/apache/pig/tools/grunt/Command.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.pig.tools.grunt;
19 |
20 | public abstract class Command {
21 | public abstract void execute(String commandline);
22 | }
23 |
--------------------------------------------------------------------------------
/src/org/apache/pig/tools/grunt/autocomplete_aliases:
--------------------------------------------------------------------------------
1 | filter
2 | foreach
3 | order
4 | distinct
5 | cogroup
6 | join
7 | cross
8 | union
9 | split
10 | group
11 | flatten
12 | dump
13 | describe
14 | explain
15 | store
16 | FILTER
17 | FOREACH
18 | ORDER
19 | DISTINCT
20 | COGROUP
21 | JOIN
22 | CROSS
23 | UNION
24 | SPLIT
25 | GROUP
26 | FLATTEN
27 | DUMP
28 | DESCRIBE
29 | EXPLAIN
30 | STORE
31 |
--------------------------------------------------------------------------------
/src/org/apache/pig/tools/pigstats/PigWarnCounter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.pig.tools.pigstats;
20 |
21 | /*
22 | Interface for incrementing warning counters
23 | */
24 | public interface PigWarnCounter {
25 |
26 | boolean incrWarnCounter(Enum> name, Object incr);
27 |
28 | boolean incrWarnCounter(String group, String name, Object incr);
29 | }
30 |
--------------------------------------------------------------------------------
/src/org/apache/pig/tools/pigstats/spark/Spark1JobStats.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/src/org/apache/pig/tools/pigstats/spark/Spark1JobStats.java
--------------------------------------------------------------------------------
/src/org/apache/pig/tools/pigstats/spark/Spark2JobStats.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/src/org/apache/pig/tools/pigstats/spark/Spark2JobStats.java
--------------------------------------------------------------------------------
/src/packages/templates/conf/pig-env.sh:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | export JAVA_HOME=${JAVA_HOME}
17 |
--------------------------------------------------------------------------------
/test/all-tests:
--------------------------------------------------------------------------------
1 | **/Test*.java
2 |
--------------------------------------------------------------------------------
/test/data/pigunit/top_queries_expected_top_3.txt:
--------------------------------------------------------------------------------
1 | (yahoo,25)
2 | (facebook,15)
3 | (twitter,7)
--------------------------------------------------------------------------------
/test/data/pigunit/top_queries_input_data.txt:
--------------------------------------------------------------------------------
1 | yahoo 10
2 | twitter 7
3 | facebook 10
4 | yahoo 15
5 | facebook 5
6 | a 1
7 | b 2
8 | c 3
9 | d 4
10 | e 5
--------------------------------------------------------------------------------
/test/data/pigunit/top_queries_params.txt:
--------------------------------------------------------------------------------
1 | n=3
2 | reducers=1
3 | input=top_queries_input_data.txt
4 | output=top_3_queries
5 |
--------------------------------------------------------------------------------
/test/e2e/pig/lib/hadoop-examples.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/e2e/pig/lib/hadoop-examples.jar
--------------------------------------------------------------------------------
/test/e2e/pig/lib/hadoop-streaming.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/e2e/pig/lib/hadoop-streaming.jar
--------------------------------------------------------------------------------
/test/e2e/pig/macros/macro1.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | define simple_macro(in_relation, min_gpa, max_age) returns c {
20 | b = filter $in_relation by gpa >= $min_gpa and age <= $max_age;
21 | $c = foreach b generate age, name;
22 | };
23 |
--------------------------------------------------------------------------------
/test/e2e/pig/macros/macro_bad1.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | -- macro with syntax error
20 |
21 | define simple_macro(in_relation, min_gpa, max_age) returns c {
22 | b = fiter $in_relation by gpa >= $min_gpa and age <= $max_age;
23 | c = foreach b generate age, name;
24 | };
25 |
--------------------------------------------------------------------------------
/test/e2e/pig/paramfiles/params_3:
--------------------------------------------------------------------------------
1 | # this is a comment
2 | fname = studenttab10k
3 | unusedkey = unusedvalueihope
4 |
--------------------------------------------------------------------------------
/test/e2e/pig/resource/default.res:
--------------------------------------------------------------------------------
1 | $resources = {
2 | 'Unicode_cmdline_1_output' => '(bobτ)',
3 | 'Warning_1_err' => 'Encountered Warning DIVIDE_BY_ZERO 2387 time.*',
4 | 'Warning_4_err' => '(Encountered Warning UDF_WARNING_4 22 time.*\n.*Encountered Warning UDF_WARNING_3 10989 time.*)|(Encountered Warning UDF_WARNING_3 10989 time.*\n.*Encountered Warning UDF_WARNING_4 22 time.*)',
5 | 'Grunt_8_output' => 'gabriella brown\\t60\\t1.71',
6 | 'Grunt_13_output' => 'gabriella brown\\t60\\t1.71',
7 | 'Grunt_14_output' => 'jessica xylophone\\t41\\tgreen\\t638.13',
8 | 'UdfDistributedCache_1_out' => 'tom van buren\\t68\\tsocialist\\t390.19',
9 | };
10 |
--------------------------------------------------------------------------------
/test/e2e/pig/resource/windows.res:
--------------------------------------------------------------------------------
1 | $resources = {
2 | 'Unicode_cmdline_1_output' => 'bobμ',
3 | 'Warning_1_err' => 'Encountered Warning DIVIDE_BY_ZERO 2390 time.*',
4 | 'Warning_4_err' => '(Encountered Warning UDF_WARNING_4 27 time.*\n.*Encountered Warning UDF_WARNING_3 10984 time.*)|(Encountered Warning UDF_WARNING_3 10984 time.*\n.*Encountered Warning UDF_WARNING_4 27 time.*)',
5 | 'Grunt_8_output' => 'zach johnson\\t77\\t3.27',
6 | 'Grunt_13_output' => 'zach johnson\\t77\\t3.27',
7 | 'Grunt_14_output' => 'priscilla young\\t72\\tindependent\\t3.23',
8 | 'UdfDistributedCache_1_out' => 'priscilla young\\t72\\tindependent\\t3.23',
9 | };
10 |
--------------------------------------------------------------------------------
/test/e2e/pig/udfs/cpython/morepythonudfs.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | from pig_util import outputSchema
18 |
19 | @outputSchema("notsquare:int")
20 | def square(num):
21 | return num * num * num
22 |
23 |
--------------------------------------------------------------------------------
/test/e2e/pig/udfs/groovy/scriptingudf.groovy:
--------------------------------------------------------------------------------
1 | import org.apache.pig.scripting.groovy.OutputSchemaFunction;
2 | class GroovyUDFs {
3 | @OutputSchemaFunction('squareSchema')
4 | public static square(x) {
5 | return x * x;
6 | }
7 | public static squareSchema(input) {
8 | return input;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test/e2e/pig/udfs/java/org/apache/pig/test/udf/storefunc/StringStoreBad.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.pig.test.udf.storefunc;
20 |
21 |
22 | public class StringStoreBad extends StringStore {
23 | // this class is only used in negative tests
24 | // just based on StringStore so we don't need to provide any other special
25 | // implementation here
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/test/e2e/pig/udfs/js/scriptingudf.js:
--------------------------------------------------------------------------------
1 | square.outputSchema = "square:double";
2 | function square(x) {
3 | return x * x
4 | }
5 |
--------------------------------------------------------------------------------
/test/e2e/pig/udfs/python/morepythonudfs.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | ############################################################################
4 | # Licensed to the Apache Software Foundation (ASF) under one or more
5 | # contributor license agreements. See the NOTICE file distributed with
6 | # this work for additional information regarding copyright ownership.
7 | # The ASF licenses this file to You under the Apache License, Version 2.0
8 | # (the "License"); you may not use this file except in compliance with
9 | # the License. You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 |
19 | from org.apache.hadoop.fs import * # Test for PIG-1824
20 | p = Path('foo')
21 |
22 | @outputSchema("notsquare:int")
23 | def square(num):
24 | return num * num * num
25 |
26 |
--------------------------------------------------------------------------------
/test/excluded-tests:
--------------------------------------------------------------------------------
1 | **/TestHelper.java
2 | **/TestLargeFile.java
3 | **/TestOrderBy.java
4 | **/TestOrderBy2.java
5 | **/TestPi.java
6 | **/e2e/**
7 |
--------------------------------------------------------------------------------
/test/excluded-tests-23:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/excluded-tests-23
--------------------------------------------------------------------------------
/test/excluded-tests-mr:
--------------------------------------------------------------------------------
1 | **/tez/*.java
2 | **/spark/*.java
--------------------------------------------------------------------------------
/test/excluded-tests-spark:
--------------------------------------------------------------------------------
1 | **/Test*MR.java
2 | **/tez/*.java
3 | **/TestNativeMapReduce.java
4 | **/TestCounters.java
5 | **/TestMultiQueryCompiler.java
6 | **/TestAutoLocalMode.java
--------------------------------------------------------------------------------
/test/excluded-tests-tez:
--------------------------------------------------------------------------------
1 | **/Test*MR.java
2 | **/spark/*.java
3 | **/TestMultiQueryCompiler.java
4 | **/TestAutoLocalMode.java
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/directory_test.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage;
2 | out = FOREACH (GROUP in ALL) GENERATE
3 | (int) SUM(in.item) as itemSum:int,
4 | (int) COUNT_STAR(in) as n:int;
5 | RMF $OUTFILE;
6 | STORE out INTO '$OUTFILE' USING AvroStorage('$AVROSTORAGE_OUT_1','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/dump.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage();
2 | DUMP in;
3 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/group_test.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage();
2 | grouped = GROUP in BY (value1.thing);
3 | flattened = FOREACH grouped GENERATE flatten(in) as (key: chararray,value1: (thing: chararray,count: int),value2: (thing: chararray,count: int));
4 | RMF $OUTFILE;
5 | STORE flattened INTO '$OUTFILE' USING AvroStorage();
6 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/identity.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage('','$AVROSTORAGE_IN_2');
2 | out = FOREACH in GENERATE *;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING AvroStorage('$AVROSTORAGE_OUT_1','$AVROSTORAGE_OUT_2');
5 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/identity_ai1_ao2.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage('$AVROSTORAGE_IN_1');
2 | out = FOREACH in GENERATE *;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING AvroStorage('$AVROSTORAGE_OUT_1','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/identity_ao2.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage();
2 | out = FOREACH in GENERATE *;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING AvroStorage('$AVROSTORAGE_OUT_1','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/identity_blank_first_args.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage('','$AVROSTORAGE_IN_2');
2 | out = FOREACH in GENERATE *;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING AvroStorage('','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/identity_codec.pig:
--------------------------------------------------------------------------------
1 | SET avro.output.codec $CODEC
2 | SET avro.mapred.deflate.level $LEVEL
3 | in = LOAD '$INFILE' USING AvroStorage();
4 | out = FOREACH in GENERATE *;
5 | RMF $OUTFILE;
6 | STORE out INTO '$OUTFILE' USING AvroStorage('$AVROSTORAGE_OUT_1','$AVROSTORAGE_OUT_2');
7 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/identity_just_ao2.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage();
2 | out = FOREACH in GENERATE *;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING AvroStorage('','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/namesWithDoubleColons.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage('','');
2 | step1 = FOREACH in GENERATE TOTUPLE(key) as A, TOTUPLE(intValue) as C;
3 | step2 = FOREACH step1 GENERATE A, TOTUPLE(C) as B;
4 | step3 = FOREACH step2 GENERATE FLATTEN(A), FLATTEN(B);
5 | out = FOREACH step3 GENERATE A::key, FLATTEN(B::C);
6 | RMF $OUTFILE;
7 | STORE out INTO '$OUTFILE' USING AvroStorage('$AVROSTORAGE_OUT_1','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/projection_test.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage();
2 | out = FOREACH in GENERATE $0, $1, $2;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING AvroStorage('$AVROSTORAGE_OUT_1','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/projection_test_with_schema.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage('','$AVROSTORAGE_IN_2');
2 | out = FOREACH in GENERATE $0, $1, $3;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING AvroStorage('$AVROSTORAGE_OUT_1','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/recursive_tests.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage('', '$AVROSTORAGE_IN_2');
2 | out = FOREACH in GENERATE $0, $1;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING AvroStorage('$AVROSTORAGE_OUT_1', '$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/trevni_to_avro.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING TrevniStorage;
2 | out = FOREACH in GENERATE *;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING AvroStorage('','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/trevni_to_trevni.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING TrevniStorage;
2 | out = FOREACH in GENERATE *;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING TrevniStorage('','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/code/pig/with_dates.pig:
--------------------------------------------------------------------------------
1 | in = LOAD '$INFILE' USING AvroStorage();
2 | out = FOREACH in GENERATE *, ToDate('2013-05-01Z', 'yyyy-MM-ddZ') AS date;
3 | RMF $OUTFILE;
4 | STORE out INTO '$OUTFILE' USING AvroStorage('$AVROSTORAGE_OUT_1','$AVROSTORAGE_OUT_2');
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/arrays.json:
--------------------------------------------------------------------------------
1 | [1, 2, 3, 4, 5]
2 | [6]
3 | []
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/arraysAsOutputByPig.json:
--------------------------------------------------------------------------------
1 | {"array" :
2 | {"array" :
3 | [
4 | {"array_0" : {"int" : 1}},
5 | {"array_0" : {"int" : 2}},
6 | {"array_0" : {"int" : 3}},
7 | {"array_0" : {"int" : 4}},
8 | {"array_0" : {"int" : 5}}
9 | ]
10 | }
11 | }
12 | {"array" : {
13 | "array" :
14 | [
15 | {"array_0" : {"int" : 6}}
16 | ]
17 | }
18 | }
19 | {"array" : {
20 | "array" :
21 | []
22 | }
23 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/projectionTest.json:
--------------------------------------------------------------------------------
1 | {
2 | "key" : "A",
3 | "intValue" : 1,
4 | "longValue" : 1
5 | }
6 | {
7 | "key" : "B",
8 | "intValue" : 2,
9 | "longValue" : 2
10 | }
11 | {
12 | "key" : "C",
13 | "intValue" : 3,
14 | "longValue" : 3
15 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/projectionTestWithSchema.json:
--------------------------------------------------------------------------------
1 | {
2 | "key" : "A",
3 | "intValue" : 1,
4 | "booleanValue" : true
5 | }
6 | {
7 | "key" : "B",
8 | "intValue" : 2,
9 | "booleanValue" : true
10 | }
11 | {
12 | "key" : "C",
13 | "intValue" : 3,
14 | "booleanValue" : false
15 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordWithRepeatedSubRecords.json:
--------------------------------------------------------------------------------
1 | {"key" : "stuff in closet",
2 | "value1" : {"thing" : "hat", "count" : 7},
3 | "value2" : {"thing" : "coat", "count" : 2}
4 | }
5 | {"key" : "stuff on desk",
6 | "value1" : {"thing" : "stapler", "count" : 1},
7 | "value2" : {"thing" : "PC", "count" : 0}
8 | }
9 | {"key" : "examples",
10 | "value1" : {"thing" : "interesting", "count" : 0},
11 | "value2" : {"thing" : "dull", "count" : 10}
12 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/records.json:
--------------------------------------------------------------------------------
1 | {
2 | "key" : "A",
3 | "intValue" : 1,
4 | "longValue" : 1,
5 | "booleanValue" : true,
6 | "floatValue" : 1.0,
7 | "doubleValue" : 1.0,
8 | "bytesValue" : "\u00FF",
9 | "nullValue" : null
10 | }
11 | {
12 | "key" : "B",
13 | "intValue" : 2,
14 | "longValue" : 2,
15 | "booleanValue" : true,
16 | "floatValue" : 2.0,
17 | "doubleValue" : 2.0,
18 | "bytesValue" : "\u00FE",
19 | "nullValue" : null
20 | }
21 | {
22 | "key" : "C",
23 | "intValue" : 3,
24 | "longValue" : 3,
25 | "booleanValue" : false,
26 | "floatValue" : 3.0,
27 | "doubleValue" : 3.0,
28 | "bytesValue" : "\u00FD",
29 | "nullValue" : null
30 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsAsOutputByPig.json:
--------------------------------------------------------------------------------
1 | {
2 | "key" : {"string": "A"},
3 | "intValue" : {"int" : 1},
4 | "longValue" : {"long" : 1},
5 | "booleanValue" : {"boolean" : true},
6 | "floatValue" : {"float" : 1.0},
7 | "doubleValue" : {"double" : 1.0},
8 | "bytesValue" : {"bytes" : "\u00FF"},
9 | "nullValue" : null
10 | }
11 | {
12 | "key" : {"string": "B"},
13 | "intValue" : {"int" : 2},
14 | "longValue" : {"long" :2},
15 | "booleanValue" : {"boolean" : true},
16 | "floatValue" : {"float" : 2.0},
17 | "doubleValue" : {"double" : 2.0},
18 | "bytesValue" : {"bytes" : "\u00FE"},
19 | "nullValue" : null
20 | }
21 | {
22 | "key" : {"string": "C"},
23 | "intValue" : {"int" : 3},
24 | "longValue" : {"long" :3},
25 | "booleanValue" : {"boolean" : false},
26 | "floatValue" : {"float" : 3.0},
27 | "doubleValue" : {"double" : 3.0},
28 | "bytesValue" : {"bytes" : "\u00FD"},
29 | "nullValue" : null
30 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsAsOutputByPigWithDates.json:
--------------------------------------------------------------------------------
1 | {
2 | "key" : {"string": "A"},
3 | "intValue" : {"int" : 1},
4 | "longValue" : {"long" : 1},
5 | "booleanValue" : {"boolean" : true},
6 | "floatValue" : {"float" : 1.0},
7 | "doubleValue" : {"double" : 1.0},
8 | "bytesValue" : {"bytes" : "\u00FF"},
9 | "nullValue" : null,
10 | "date" : {"long" : 1367366400000}
11 | }
12 | {
13 | "key" : {"string": "B"},
14 | "intValue" : {"int" : 2},
15 | "longValue" : {"long" :2},
16 | "booleanValue" : {"boolean" : true},
17 | "floatValue" : {"float" : 2.0},
18 | "doubleValue" : {"double" : 2.0},
19 | "bytesValue" : {"bytes" : "\u00FE"},
20 | "nullValue" : null,
21 | "date" : {"long" : 1367366400000}
22 | }
23 | {
24 | "key" : {"string": "C"},
25 | "intValue" : {"int" : 3},
26 | "longValue" : {"long" :3},
27 | "booleanValue" : {"boolean" : false},
28 | "floatValue" : {"float" : 3.0},
29 | "doubleValue" : {"double" : 3.0},
30 | "bytesValue" : {"bytes" : "\u00FD"},
31 | "nullValue" : null,
32 | "date" : {"long" : 1367366400000}
33 | }
34 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsOfArrays.json:
--------------------------------------------------------------------------------
1 | {"key" : "1 one", "values" : [1]}
2 | {"key" : "2 twos", "values" : [2, 2]}
3 | {"key" : "first 7 numbers in fibonacci sequence", "values" : [1, 1, 2, 3, 5, 8, 13]}
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsOfArraysOfRecords.json:
--------------------------------------------------------------------------------
1 | {"key" : "A",
2 | "values" : [
3 | {"k" : "a", "v" : 1}
4 | ]
5 | }
6 | {"key" : "B",
7 | "values" : []
8 | }
9 | {"key" : "C",
10 | "values" : [
11 | {"k" : "c", "v" : 3},
12 | {"k" : "c1", "v" : 4},
13 | {"k" : "c2", "v" : 5}
14 | ]
15 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsOfStringArrays.json:
--------------------------------------------------------------------------------
1 | {"values" : ["1"]}
2 | {"values" : ["2", "2"]}
3 | {"values" : ["1", "1", "2", "3", "5", "8", "13"]}
4 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsSubSchema.json:
--------------------------------------------------------------------------------
1 | {
2 | "key" : "A",
3 | "intValue" : 1
4 | }
5 | {
6 | "key" : "B",
7 | "intValue" : 2
8 | }
9 | {
10 | "key" : "C",
11 | "intValue" : 3
12 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsSubSchemaNullable.json:
--------------------------------------------------------------------------------
1 | {
2 | "key" : {"string" : "A"},
3 | "value" : { "string" : "a"}
4 | }
5 | {
6 | "key" : {"string" : "B"},
7 | "value" : { "string" : "b"}
8 | }
9 | {
10 | "key" : {"string" : "C"},
11 | "value" : { "string" : "c"}
12 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsWithDoubleUnderscores.json:
--------------------------------------------------------------------------------
1 | {
2 | "A__key" : {"string" : "A"},
3 | "B__C__intValue" : {"int" : 1}
4 | }
5 | {
6 | "A__key" : {"string" : "B"},
7 | "B__C__intValue" : {"int" : 2}
8 | }
9 | {
10 | "A__key" : {"string" : "C"},
11 | "B__C__intValue" : {"int" : 3}
12 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsWithEnums.json:
--------------------------------------------------------------------------------
1 | {"key" : "A", "value" : 1, "type" : "GOOD"}
2 | {"key" : "B", "value" : 2, "type" : "BAD"}
3 | {"key" : "C", "value" : 3, "type" : "OTHER"}
4 | {"key" : "D", "value" : 1, "type" : "OTHER"}
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsWithFixed.json:
--------------------------------------------------------------------------------
1 | {"key" : "lowestUnroutable", "value" : "0A000000"}
2 | {"key" : "highestUnroutable", "value" : "C0A8FFFF"}
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsWithMaps.json:
--------------------------------------------------------------------------------
1 | {"key" : "A",
2 | "value" : 1,
3 | "parameters" : {
4 | "comment" : "first test case"
5 | }
6 | }
7 | {"key" : "B",
8 | "value" : 2,
9 | "parameters" : {
10 | "comment" : "second map item",
11 | "also" : "the next item has an empty map"
12 | }
13 | }
14 | {"key" : "C",
15 | "value" : 3,
16 | "parameters" : {}
17 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsWithMapsOfArrayOfRecords.json:
--------------------------------------------------------------------------------
1 | {"key" : "A",
2 | "value" : 1,
3 | "parameters" : {
4 | "firstParameter" : []
5 | }
6 | }
7 | {"key" : "B",
8 | "value" : 2,
9 | "parameters" : {}
10 | }
11 | {"key" : "C",
12 | "value" : 3,
13 | "parameters" : {
14 | "firstParameter" : [
15 | {"k" : "c", "v" : 3},
16 | {"k" : "c1", "v" : 4},
17 | {"k" : "c2", "v" : 5}
18 | ],
19 | "secondParameter" : [
20 | {"k" : "c3", "v" : 6},
21 | {"k" : "c4", "v" : 7},
22 | {"k" : "c5", "v" : 8}
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsWithMapsOfRecords.json:
--------------------------------------------------------------------------------
1 | {"key" : "A",
2 | "value" : 1,
3 | "parameters" : {
4 | "firstParameter" : {"k" : "firstParameterKey", "v" : 1}
5 | }
6 | }
7 | {"key" : "B",
8 | "value" : 2,
9 | "parameters" : {}
10 | }
11 | {"key" : "C",
12 | "value" : 1,
13 | "parameters" : {
14 | "firstParameter" : {"k" : "firstParameterKey", "v" : 70},
15 | "secondParameter" : {"k" : "secondParameterKey", "v" : 0}
16 | }
17 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsWithNullableUnions.json:
--------------------------------------------------------------------------------
1 | {"key" : {"string" : "A"}, "value" : null}
2 | {"key" : {"string" : "B"}, "value" : {"int" : 1}}
3 | {"key" : null, "value" : null}
4 | {"key" : null, "value" : {"int" : 2}}
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsWithSimpleUnion.json:
--------------------------------------------------------------------------------
1 | {"key" : "A", "value" : {"long" : 1}}
2 | {"key" : "B", "value" : {"int" : 2}}
3 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recordsWithSimpleUnionOutput.json:
--------------------------------------------------------------------------------
1 | {"key":"A","intValue":1}
2 | {"key":"B","intValue":2}
3 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/data/json/recursiveRecord.json:
--------------------------------------------------------------------------------
1 | {"key" : "A",
2 | "value" : "a",
3 | "next" : null}
4 | {"key" : "B",
5 | "value" : "b",
6 | "next" : {
7 | "org.apache.pig.test.builtin.recursiveRecord" : {
8 | "key" : "B1",
9 | "value" : "b1",
10 | "next" : null
11 | }
12 | }
13 | }
14 | {"key" : "C",
15 | "value" : "c",
16 | "next" : {
17 | "org.apache.pig.test.builtin.recursiveRecord" : {
18 | "key" : "C1",
19 | "value" : "c1",
20 | "next" : {
21 | "org.apache.pig.test.builtin.recursiveRecord" : {
22 | "key" : "C2",
23 | "value" : "c2",
24 | "next" : null
25 | }
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/RecordPojo.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "RecordPojo",
3 | "namespace" : "org.apache.pig.builtin.avro.code.java",
4 | "type" : "record",
5 | "doc" : "to test a generated Avro Java class",
6 | "fields" : [
7 | {"name" : "key", "type" : "string"},
8 | {"name" : "intValue", "type" : "int"},
9 | {"name" : "longValue", "type" : "long"},
10 | {"name" : "booleanValue", "type" : "boolean"},
11 | {"name" : "floatValue", "type" : "float"},
12 | {"name" : "doubleValue", "type" : "double"},
13 | {"name" : "bytesValue", "type" : "bytes"},
14 | {"name" : "nullValue", "type" : "null"}
15 | ]
16 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/arrays.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "arrays",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "array",
5 | "items" : "int"
6 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/arraysAsOutputByPig.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "type" : "record",
3 | "name" : "arrays",
4 | "namespace" : "org.apache.pig.test.builtin",
5 | "fields" : [ {
6 | "name" : "array",
7 | "type" : [ "null", {
8 | "type" : "array",
9 | "items" : {
10 | "type" : "record",
11 | "name" : "array",
12 | "fields" : [ {
13 | "name" : "array_0",
14 | "type" : [ "null", "int" ]
15 | } ]
16 | }
17 | } ]
18 | } ]
19 | }
20 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/nullableArrayInMap.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "nullableRecordInMap",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "value", "type" : "int"},
8 | {
9 | "name" : "parameters",
10 | "type": {
11 | "type": "map",
12 | "values": [
13 | "null",
14 | {
15 | "type": "array",
16 | "items": "string"
17 | }
18 | ]
19 | }
20 | }
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/nullableRecordInMap.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "nullableRecordInMap",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "value", "type" : "int"},
8 | {
9 | "name" : "parameters",
10 | "type": [
11 | "null",
12 | {
13 | "type": "map",
14 | "values": [
15 | "null",
16 | {
17 | "type": "record",
18 | "name": "nullable_record",
19 | "fields": [
20 | {
21 | "name": "id",
22 | "type": [
23 | "null",
24 | "string"
25 | ]
26 | }
27 | ]
28 | }
29 | ]
30 | }
31 | ]
32 | }
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/projectionTest.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "projectionTest",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "intValue", "type" : "int"},
8 | {"name" : "longValue", "type" : "long"}
9 | ]
10 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/projectionTestWithSchema.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "projectionTestWithSchema",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "intValue", "type" : "int"},
8 | {"name" : "booleanValue", "type" : "boolean"}
9 | ]
10 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordInMap.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordInMap",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "value", "type" : "int"},
8 | {
9 | "name" : "parameters",
10 | "type": {
11 | "type": "map",
12 | "values": {
13 | "type": "record",
14 | "name": "A",
15 | "fields": [
16 | {
17 | "name": "id",
18 | "type": [
19 | "null",
20 | "int"
21 | ]
22 | }
23 | ]
24 | }
25 | }
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordWithRepeatedSubRecords.avsc:
--------------------------------------------------------------------------------
1 | { "name" : "recordWithRepeatedSubRecords",
2 | "namespace" : "org.apache.pig.test.builtin",
3 | "type" : "record",
4 | "fields" : [
5 | {"name" : "key" , "type" : "string"},
6 | {"name" : "value1" , "type" : {
7 | "type" : "record",
8 | "name" : "valuetype",
9 | "fields" : [
10 | {"name" : "thing", "type" : "string"},
11 | {"name" : "count", "type" : "int"}
12 | ]
13 | }},
14 | {"name" : "value2" , "type" : "valuetype"}
15 | ]
16 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/records.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "records",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "intValue", "type" : "int"},
8 | {"name" : "longValue", "type" : "long"},
9 | {"name" : "booleanValue", "type" : "boolean"},
10 | {"name" : "floatValue", "type" : "float"},
11 | {"name" : "doubleValue", "type" : "double"},
12 | {"name" : "bytesValue", "type" : "bytes"},
13 | {"name" : "nullValue", "type" : "null"}
14 | ]
15 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsAsOutputByPig.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "records",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : ["null", "string"]},
7 | {"name" : "intValue", "type" : ["null", "int"]},
8 | {"name" : "longValue", "type" : ["null", "long"]},
9 | {"name" : "booleanValue", "type" : ["null", "boolean"]},
10 | {"name" : "floatValue", "type" : ["null", "float"]},
11 | {"name" : "doubleValue", "type" : ["null", "double"]},
12 | {"name" : "bytesValue", "type" : ["null", "bytes"]},
13 | {"name" : "nullValue", "type" : "null"}
14 | ]
15 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsAsOutputByPigWithDates.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "records",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : ["null", "string"]},
7 | {"name" : "intValue", "type" : ["null", "int"]},
8 | {"name" : "longValue", "type" : ["null", "long"]},
9 | {"name" : "booleanValue", "type" : ["null", "boolean"]},
10 | {"name" : "floatValue", "type" : ["null", "float"]},
11 | {"name" : "doubleValue", "type" : ["null", "double"]},
12 | {"name" : "bytesValue", "type" : ["null", "bytes"]},
13 | {"name" : "nullValue", "type" : "null"},
14 | {"name" : "date", "type" : ["null", "long"]}
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsOfArrays.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsOfArrays",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "values",
8 | "type" : {
9 | "type" : "array",
10 | "items" : "int"
11 | }
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsOfArraysOfRecords.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsOfArraysOfRecords",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "values",
8 | "type" : {
9 | "type" : "array",
10 | "items" : {
11 | "name" : "innerRecord",
12 | "type" : "record",
13 | "fields" : [
14 | {"name" : "k", "type" : "string"},
15 | {"name" : "v", "type" : "int"}
16 | ]
17 | }
18 | }
19 | }
20 | ]
21 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsOfStringArrays.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsOfStringArrays",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "values",
7 | "type" : {
8 | "type" : "array",
9 | "items" : "string"
10 | }
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsSubSchema.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "records",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "doc" : "subset of records schema, to make sure you can manually specify a compatible subschema",
5 | "type" : "record",
6 | "fields" : [
7 | {"name" : "key", "type" : "string"},
8 | {"name" : "intValue", "type" : "int"}
9 | ]
10 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsSubSchemaNullable.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsSubSchemaNullable",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "doc" : "subset of records schema, to make sure you can manually specify a compatible subschema",
5 | "type" : "record",
6 | "fields" : [
7 | {"name" : "key", "type" : ["null", "string"]},
8 | {"name" : "value", "type" : ["null", "string"]}
9 | ]
10 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsWithDoubleUnderscores.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsWithDoubleUnderscores",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "A__key", "type" : ["null", "string"]},
7 | {"name" : "B__C__intValue", "type" : ["null", "int"]}
8 | ]
9 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsWithEnums.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsWithEnums",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "value", "type" : "int"},
8 | {"name" : "type", "type" :
9 | {"type" : "enum", "name" : "typeEnum", "symbols" : ["GOOD","BAD","OTHER"]}
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsWithFixed.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsWithFixed",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "value", "type" :
8 | {"type" : "fixed", "size" : 8, "name" : "IPv4Address"}
9 | }
10 | ]
11 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsWithMaps.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsWithMaps",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "value", "type" : "int"},
8 | {"name" : "parameters", "type" :
9 | {"type" : "map", "values" : "string"}
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsWithMapsOfArrayOfRecords.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsWithMapsOfArrayOfRecords",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "value", "type" : "int"},
8 | {"name" : "parameters", "type" :
9 | {"type" : "map",
10 | "values" : {
11 | "type" : "array",
12 | "items" : {
13 | "name" : "innerRecord",
14 | "type" : "record",
15 | "fields" : [
16 | {"name" : "k", "type" : "string"},
17 | {"name" : "v", "type" : "int"}
18 | ]
19 | }
20 | }
21 | }
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsWithMapsOfRecords.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsWithMapsOfRecords",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "value", "type" : "int"},
8 | {"name" : "parameters", "type" :
9 | {"type" : "map", "values" : {
10 | "type" : "record",
11 | "name" : "parameterMap",
12 | "fields" : [
13 | {"name" : "k", "type" : "string"},
14 | {"name" : "v", "type" : "int"}
15 | ]
16 | }
17 | }
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsWithNullableUnions.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsWithNullableUnions",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : ["string","null"]},
7 | {"name" : "value", "type" : ["int","null"]}
8 | ]
9 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsWithSimpleUnion.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "recordsWithSimpleUnion",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "value", "type" : ["int","long","null"]}
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recordsWithSimpleUnionOutput.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "records",
3 | "namespace" : "org.apache.pig.test.builtin",
4 | "doc" : "subset of records schema, to make sure you can manually specify a compatible subschema",
5 | "type" : "record",
6 | "fields" : [
7 | {"name" : "key", "type" : "string"},
8 | {"name" : "intValue", "type" : "int"}
9 | ]
10 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/recursiveRecord.avsc:
--------------------------------------------------------------------------------
1 | { "name" : "recursiveRecord",
2 | "namespace" : "org.apache.pig.test.builtin",
3 | "type" : "record",
4 | "fields" : [
5 | {"name" : "key" , "type" : "string"},
6 | {"name" : "value" , "type" : "string"},
7 | {"name" : "next" , "type" : [ "org.apache.pig.test.builtin.recursiveRecord" , "null" ]}
8 | ]
9 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/simpleRecordsTrevni.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "simpleRecords",
3 | "namespace" : "org.apache.test.builtin",
4 | "type" : "record",
5 | "fields" : [
6 | {"name" : "key", "type" : "string"},
7 | {"name" : "intValue", "type" : "int"},
8 | {"name" : "stringValue", "type" : "string"},
9 | {"name" : "doubleValue", "type" : "double"}
10 | ]
11 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/testDirectory.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "type" : "record",
3 | "name" : "testdirectory",
4 | "namespace" : "org.apache.pig.test.builtin",
5 | "fields" : [ {
6 | "name" : "item",
7 | "type" : "int"
8 | }, {
9 | "name" : "timestamp",
10 | "type" : "long"
11 | } ]
12 | }
13 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/avro/schema/testDirectoryCounts.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "type" : "record",
3 | "name" : "stats",
4 | "namespace" : "org.apache.pig.test.builtin",
5 | "fields" : [ {
6 | "name" : "itemSum",
7 | "type" : [ "null", "int" ]
8 | }, {
9 | "name" : "n",
10 | "type" : [ "null", "int" ]
11 | } ]
12 | }
13 |
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/orc/charvarchar.orc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/org/apache/pig/builtin/orc/charvarchar.orc
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/orc/datetype.orc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/org/apache/pig/builtin/orc/datetype.orc
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/orc/nullmapkey.orc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/org/apache/pig/builtin/orc/nullmapkey.orc
--------------------------------------------------------------------------------
/test/org/apache/pig/builtin/orc/orc-file-11-format.orc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/org/apache/pig/builtin/orc/orc-file-11-format.orc
--------------------------------------------------------------------------------
/test/org/apache/pig/parser/TestAST.pig:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | A = LOAD 'source.txt' USING org.apache.pig.builtin.TextLoader() AS (a:int, b:long, c:chararray);
20 | B = FOREACH A generate $0 * 5, b, $2;
21 | C = FILTER B by a > 100;
22 | D = LIMIT C 400;
23 | STORE D into 'output.txt';
--------------------------------------------------------------------------------
/test/org/apache/pig/parser/TestDefaultDataTypeInserter.pig:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | A = load 'xx' as ( uname, vname, w:tuple(z, zz) );
20 | store A into 'yy';
21 |
22 | B = load 'z' as ass;
--------------------------------------------------------------------------------
/test/org/apache/pig/test/PigExecTestCase.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ConfFile1.txt:
--------------------------------------------------------------------------------
1 | date="20080228"
2 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ConfFile2.txt:
--------------------------------------------------------------------------------
1 | destination='\'/user/kaleidoscope/pow_stats/20080228/acct/InactiveAcct\''
2 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ConfFile3.txt:
--------------------------------------------------------------------------------
1 | destination='this shud be skipped'
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ConfFileComplexVal.txt:
--------------------------------------------------------------------------------
1 | storefile = /user/pig/tests/results/DefineClause_4.out
2 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ConfFileDuplicates.txt:
--------------------------------------------------------------------------------
1 | destination='\'/user/kaleidoscope/pow_stats/20080228/acct/InactiveAcct\''
2 | date = 'this is to be skipped'
3 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ConfFileSameParamMultipleTimes.txt:
--------------------------------------------------------------------------------
1 | date = 'skip this'
2 | date = 20080228
3 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ConfFileWithEmptyComments.txt:
--------------------------------------------------------------------------------
1 | date = '20080228'
2 |
3 | #this is a comment line
4 |
5 | key1 = 'value1'
6 |
7 | #this is also a comment line
8 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ConfFileWithInvalidLines.txt:
--------------------------------------------------------------------------------
1 | date = '20080228'
2 | this is an invalid line
3 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ConfFileWithValidLines.txt:
--------------------------------------------------------------------------------
1 | date = '20080228'
2 | destination=/user/kaleidoscope/pow_stats/20080228/acct/InactiveAcct
3 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/new-optlimitplan1.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad -> LOSort;
3 | LOSort [limit="100"];
4 | LOSort -> LOStore;
5 | }
6 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/new-optlimitplan10.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad -> LOLimit;
3 | LOLimit [limit="100"];
4 | LOLimit -> LOForEach;
5 | LOForEach [hasflat="false"];
6 | LOForEach -> LOCogroup;
7 | LOCogroup -> LOStore;
8 | }
9 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/new-optlimitplan2.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad -> LOLimit;
3 | LOLimit [limit="10"];
4 | LOLimit -> LOStore;
5 | }
6 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/new-optlimitplan3.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad -> LOLimit;
3 | LOLimit [limit="100"];
4 | LOLimit -> LOCross;
5 | LOLoad -> LOLimit;
6 | LOLimit [limit="100"];
7 | LOLimit -> LOCross;
8 | LOCross -> LOLimit;
9 | LOLimit [limit="100"];
10 | LOLimit -> LOStore;
11 | }
12 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/new-optlimitplan4.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad -> LOCogroup;
3 | LOCogroup -> LOForEach;
4 | LOForEach [hasflat="true"];
5 | LOForEach -> LOLimit;
6 | LOLimit [limit="100"];
7 | LOLimit -> LOStore;
8 | }
9 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/new-optlimitplan5.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad -> LOLimit;
3 | LOLimit [limit="100"];
4 | LOLimit -> LOForEach;
5 | LOForEach [hasflat="false"];
6 | LOForEach -> LOStore;
7 | }
8 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/new-optlimitplan6.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad -> LOLimit;
3 | LOLimit [limit="20"];
4 | LOLimit -> LOStore;
5 | }
6 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/new-optlimitplan7.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad -> LOForEach;
3 | LOForEach [hasflat="true"];
4 | LOForEach -> LOLimit;
5 | LOLimit [limit="100"];
6 | LOLimit -> LOStore;
7 | }
8 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/new-optlimitplan8.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad -> LOSort;
3 | LOSort [limit="10"];
4 | LOSort -> LOStore;
5 | }
6 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/new-optlimitplan9.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad -> LOSort;
3 | LOSort [limit="10"];
4 | LOSort -> LOStore;
5 | }
6 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan1.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad18 -> LOSort20;
3 | LOSort20 [limit="100"];
4 | }
5 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan10.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad2061 -> LOLimit2062;
3 | LOLimit2062 [limit="100"];
4 | LOLimit2062 -> LOForEach2067;
5 | LOForEach2067 [hasflat="false"];
6 | LOForEach2067 -> LOCogroup2064;
7 | }
8 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan12.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad2082 -> LOStream2083;
3 | LOStream2083 -> LOLimit2084;
4 | LOLimit2084 [limit="10"];
5 | }
6 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan2.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad22 -> LOLimit23;
3 | LOLimit23 [limit="10"];
4 | }
5 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan3.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad25 -> LOLimit29;
3 | LOLimit29 [limit="100"];
4 | LOLimit29 -> LOCross27;
5 | LOLoad26 -> LOLimit30;
6 | LOLimit30 [limit="100"];
7 | LOLimit30 -> LOCross27;
8 | LOCross27 -> LOLimit28;
9 | LOLimit28 [limit="100"];
10 | }
11 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan4.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad2029 -> LOCogroup2031;
3 | LOCogroup2031 -> LOForEach2035;
4 | LOForEach2035 [hasflat="true"];
5 | LOForEach2035 -> LOLimit2036;
6 | LOLimit2036 [limit="100"];
7 | }
8 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan5.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad2037 -> LOLimit2042;
3 | LOLimit2042 [limit="100"];
4 | LOLimit2042 -> LOForEach2041;
5 | LOForEach2041 [hasflat="false"];
6 | }
7 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan6.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad2043 -> LOLimit2044;
3 | LOLimit2044 [limit="20"];
4 | }
5 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan7.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad2047 -> LOForEach2051;
3 | LOForEach2051 [hasflat="true"];
4 | LOForEach2051 -> LOLimit2052;
5 | LOLimit2052 [limit="100"];
6 | }
7 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan8.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad2053 -> LOSort2055;
3 | LOSort2055 [limit="-1"];
4 | LOSort2055 -> LOLimit2056;
5 | LOLimit2056 [limit="10"];
6 | }
7 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optlimitplan9.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | LOLoad2057 -> LOSort2059;
3 | LOSort2059 [limit="10"];
4 | }
5 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/optplan1.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | graph [pigScript=" A = load 'myfile' as (p:int, q:long, r:float, s:double, t:map[], u:tuple (x:int, y:int), v:bag {tuple(int:z)}); B = group A by p; C = foreach B generate $0, COUNT($1);" ] ;
3 |
4 | load [key="0", type="LOLoad" , schema= "p: bytearray,q: bytearray,r: bytearray,s: bytearray,t: bytearray ,u: bytearray,v: bytearray"] ;
5 | typecast [ key="23", type="LOForEach", schema= "p: int,q: long,r: float,s: double,t: map[] ,u: tuple(x: int,y: int),v: bag {x: tuple (z: int)}"] ;
6 | order [key="2", type="LOSort", schema= "p: int,q: long,r: float,s: double,t: map[] ,u: tuple(x: int,y: int),v: bag {x: tuple (z: int)}"] ;
7 |
8 | load -> typecast -> order ;
9 | }
10 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/plan1.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | graph [pigScript=" A = LOAD 'tmp' ; B = DISTINCT A ; "] ;
3 |
4 | node [schema="field1: int, field2: float, field3: chararray"] ;
5 |
6 | load [key="10", type="LOLoad"] ;
7 | distinct [key="12", type="LODistinct"] ;
8 |
9 | load -> distinct ;
10 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/testScript1.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | graph [pigScript=" A = LOAD 'tmp' as (field1: int, field2: float, field3: chararray ) ; B = DISTINCT A ; "] ;
3 |
4 | node [schema="field1: int, field2: float, field3: chararray"] ;
5 |
6 | load [key="10", type="LOLoad"] ;
7 | distinct [key="20", type="LODistinct"] ;
8 |
9 | load -> distinct ;
10 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/testScript2.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | graph [pigScript=" A = LOAD 'tmp' ; B = DISTINCT A ; "] ;
3 |
4 | load [key="10", type="LOLoad"] ;
5 | distinct [key="20", type="LODistinct"] ;
6 |
7 | load -> distinct ;
8 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/testScript3.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | graph [pigScript=" a = load 'a' as (field1: long, field2: tuple(inner1 : bytearray, inner2 : float) ) ;
3 | b = group a by field2; "] ;
4 |
5 | load [key="10", type="LOLoad", schema="field1: long, field2: tuple(inner1 : bytearray, inner2 : float)"] ;
6 | group [key="20", type="LOCogroup" , schema="group: chararray,a: bag{ tuple1:tuple(field1: long,field2: tuple(inner1: bytearray,inner2: integer))}"] ;
7 |
8 | load -> group ;
9 | }
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/testScript4.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | graph [pigScript=" a = load 'a' as (field1: int, field2: long);
3 | b = load 'a' as (field1: bytearray, field2: double);
4 | c = group a by (field1,field2) , b by (field1,field2) ; "] ;
5 |
6 | load1 [key="10", type="LOLoad", schema="field1: int, field2: long"] ;
7 | load2 [key="15", type="LOLoad", schema="field1: bytearray, field2: double"] ;
8 | group [key="20", type="LOCogroup" , schema="group2: tuple([NoAlias]:int, [NoAlias]:double) ,
9 | a: bag{tuple1:tuple(field1: int,field2: long)},
10 | b: bag{tuple1:tuple(field1: bytearray,field2: double)} "] ;
11 |
12 | load1 -> group ;
13 | load2 -> group ;
14 | }
15 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/testScript5.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | graph [pigScript=" a = load 'a' as (field1: long, field2: tuple(inner1 : bytearray, inner2 : float) ) ;
3 | b = FOREACH a GENERATE field1*field1 ;"] ;
4 |
5 | load [key="10", type="LOLoad", schema="field1: long, field2: tuple(inner1 : bytearray, inner2 : float)"] ;
6 | foreach [key="20", type="LOForEach" , schema="[NoAlias] : long"] ;
7 |
8 | load -> foreach ;
9 | }
10 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/DotFiles/testScript6.dot:
--------------------------------------------------------------------------------
1 | digraph graph1 {
2 | graph [pigScript=" a = load 'a' as (name: chararray, details: tuple(age, gpa), field3: tuple(a,b));
3 | e = foreach a generate name, details.(age, gpa), field3.(a,b) ; "] ;
4 |
5 | load1 [key="10", type="LOLoad", schema="name: chararray, details: tuple(age, gpa), field3: tuple(a,b)"] ;
6 | foreach1 [key="15", type="LOForEach", schema="name: chararray,details: tuple(age: bytearray,gpa: bytearray),field3: tuple(a: bytearray,b: bytearray)"] ;
7 |
8 | load1 -> foreach1 ;
9 | }
10 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ExpectedResult3.txt:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | register /data/pigudf.jar;
20 |
21 | aa = load '/user/pig/tests/data/singlefile/textdoc.txt ' using PigStorage('\x01');
22 | bb = filter aa by (ARITY == '16') and ( $4 eq '' or $4 eq 'NULL' or $4 eq 'ss') parallel 400;
23 | a = foreach bb generate $0,$12,$7;
24 | store inactiveAccounts into '/user/pig/tests/results/DefineClause_4.out';
25 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/ExpectedResultDollarSign.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | a = load 'data';
20 | b = filter by ($0 == 'x') and ($1 == 'y');
21 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/Arithmetic.gld:
--------------------------------------------------------------------------------
1 | A: Store()
2 | |
3 | |---A: New For Each(false,false,false)[bag] - scope-64
4 | | |
5 | | Add[double] - scope-51
6 | | |
7 | | |---Add[double] - scope-48
8 | | | |
9 | | | |---Cast[double] - scope-45
10 | | | | |
11 | | | | |---Project[bytearray][0] - scope-44
12 | | | |
13 | | | |---Cast[double] - scope-47
14 | | | |
15 | | | |---Project[bytearray][1] - scope-46
16 | | |
17 | | |---Cast[double] - scope-50
18 | | |
19 | | |---Constant(5) - scope-49
20 | | |
21 | | Subtract[int] - scope-60
22 | | |
23 | | |---Subtract[int] - scope-57
24 | | | |
25 | | | |---Cast[int] - scope-55
26 | | | | |
27 | | | | |---Project[bytearray][0] - scope-54
28 | | | |
29 | | | |---Constant(5) - scope-56
30 | | |
31 | | |---Cast[int] - scope-59
32 | | |
33 | | |---Project[bytearray][1] - scope-58
34 | | |
35 | | Constant(hello) - scope-63
36 | |
37 | |---test-11: Load()
38 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/BinCond.gld:
--------------------------------------------------------------------------------
1 | A: Store()
2 | |
3 | |---A: New For Each(false)[bag] - scope-106
4 | | |
5 | | POBinCond[double] - scope-100
6 | | |
7 | | |---Equal To[boolean] - scope-89
8 | | | |
9 | | | |---Cast[chararray] - scope-87
10 | | | | |
11 | | | | |---Project[bytearray][1] - scope-86
12 | | | |
13 | | | |---Constant(3) - scope-88
14 | | |
15 | | |---Add[double] - scope-94
16 | | | |
17 | | | |---Cast[double] - scope-91
18 | | | | |
19 | | | | |---Project[bytearray][2] - scope-90
20 | | | |
21 | | | |---Cast[double] - scope-93
22 | | | |
23 | | | |---Project[bytearray][3] - scope-92
24 | | |
25 | | |---Subtract[double] - scope-99
26 | | |
27 | | |---Cast[double] - scope-96
28 | | | |
29 | | | |---Project[bytearray][2] - scope-95
30 | | |
31 | | |---Cast[double] - scope-98
32 | | |
33 | | |---Project[bytearray][3] - scope-97
34 | |
35 | |---test-15: Load()
36 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/Comparison.gld:
--------------------------------------------------------------------------------
1 | A: Store()
2 | |
3 | |---A: Filter[bag] - scope-67
4 | | |
5 | | Greater Than[boolean] - scope-83
6 | | |
7 | | |---Add[double] - scope-72
8 | | | |
9 | | | |---Cast[double] - scope-69
10 | | | | |
11 | | | | |---Project[bytearray][0] - scope-68
12 | | | |
13 | | | |---Cast[double] - scope-71
14 | | | |
15 | | | |---Project[bytearray][1] - scope-70
16 | | |
17 | | |---Multiply[double] - scope-82
18 | | |
19 | | |---Subtract[double] - scope-77
20 | | | |
21 | | | |---Cast[double] - scope-74
22 | | | | |
23 | | | | |---Project[bytearray][0] - scope-73
24 | | | |
25 | | | |---Cast[double] - scope-76
26 | | | |
27 | | | |---Project[bytearray][1] - scope-75
28 | | |
29 | | |---Cast[double] - scope-81
30 | | |
31 | | |---Divide[int] - scope-80
32 | | |
33 | | |---Constant(4) - scope-78
34 | | |
35 | | |---Constant(2) - scope-79
36 | |
37 | |---test-13: Load()
38 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/ComplexForeach.gld:
--------------------------------------------------------------------------------
1 | C: Store()
2 | |
3 | |---C: New For Each(false)[bag] - scope-7
4 | | |
5 | | RelationToExpressionProject[bag][*] - scope-1
6 | | |
7 | | |---B: Filter[bag] - scope-3
8 | | | |
9 | | | Equal To[boolean] - scope-6
10 | | | |
11 | | | |---Project[bytearray][1] - scope-4
12 | | | |
13 | | | |---Project[bytearray][2] - scope-5
14 | | |
15 | | |---Project[bag][0] - scope-2
16 | |
17 | |---test-0: Load()
18 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/Distinct.gld:
--------------------------------------------------------------------------------
1 | test-7: Store()
2 | |
3 | |---test-6: PODistinct[bag] - scope-14
4 | |
5 | |---test-5: Load()
6 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/IsNull1.gld:
--------------------------------------------------------------------------------
1 | y: Filter[bag] - scope-170
2 | | |
3 | | Not[boolean] - scope-173
4 | | |
5 | | |---POIsNull[boolean] - scope-172
6 | | |
7 | | |---Project[bytearray][0] - scope-171
8 | |
9 | |---test-27: Split - scope-169
10 | |
11 | |---test-26: Load()
12 |
13 | x: Store()
14 | |
15 | |---x: Filter[bag] - scope-174
16 | | |
17 | | POIsNull[boolean] - scope-176
18 | | |
19 | | |---Project[bytearray][0] - scope-175
20 | |
21 | |---test-27: Split - scope-169
22 | |
23 | |---test-26: Load()
24 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/IsNull2.gld:
--------------------------------------------------------------------------------
1 | Filter[tuple] - Test-Plan-Builder-258
2 | | |
3 | | Not[boolean] - Test-Plan-Builder-261
4 | | |
5 | | |---POIsNull[tuple] - Test-Plan-Builder-260
6 | | |
7 | | |---Project[bytearray][0] - Test-Plan-Builder-259
8 | |
9 | |---Split - Test-Plan-Builder-257
10 | |
11 | |---Load(a:org.apache.pig.builtin.PigStorage) - Test-Plan-Builder-256
12 |
13 | Filter[tuple] - Test-Plan-Builder-262
14 | | |
15 | | POIsNull[tuple] - Test-Plan-Builder-264
16 | | |
17 | | |---Project[bytearray][0] - Test-Plan-Builder-263
18 | |
19 | |---Split - Test-Plan-Builder-257
20 | |
21 | |---Load(a:org.apache.pig.builtin.PigStorage) - Test-Plan-Builder-256
22 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/Limit.gld:
--------------------------------------------------------------------------------
1 | test-31: Store()
2 | |
3 | |---test-30: Limit - scope-179
4 | |
5 | |---test-29: Load()
6 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/MRC1.gld:
--------------------------------------------------------------------------------
1 | MapReduce(-1) - -3:
2 | | Store(DummyFil:DummyLdr) - -5515425171581967372
3 | | |
4 | | |---Filter[tuple] - --6061281703859425960
5 | | | |
6 | | | Constant(true) - --3396897091865664764
7 | | |
8 | | |---Package(Packager)[tuple]{Unknown} - --5758282087831209061
9 | | Local Rearrange[tuple]{Unknown}(false) - -3709512757404691843
10 | | |
11 | | |---Load(file:/tmp/temp-1456742965/tmp2077335416:org.apache.pig.impl.io.InterStorage) - -2
12 | |
13 | |---MapReduce(-1) - -0:
14 | | Store(file:/tmp/temp-1456742965/tmp2077335416:org.apache.pig.impl.io.InterStorage) - -1
15 | | |
16 | | |---Package(Packager)[tuple]{Unknown} - --2057425961601007773
17 | | Local Rearrange[tuple]{Unknown}(false) - --8361563503038121624
18 | | |
19 | | |---Load(DummyFil:DummyLdr) - -7506868571066332964
20 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/MRC12.gld:
--------------------------------------------------------------------------------
1 | MapReduce(-1) - -6:
2 | | Store(DummyFil:DummyLdr) - --1596982214453270401
3 | | |
4 | | |---Package(Packager)[tuple]{Unknown} - -2312201225366906989
5 | | Union[tuple] - -7
6 | | |
7 | | |---Local Rearrange[tuple]{Unknown}(false) - --4071762447953696591
8 | | | |
9 | | | |---Filter[tuple] - --6487150145665307346
10 | | | | |
11 | | | | Constant(true) - -7123161826157220327
12 | | | |
13 | | | |---Load(file:/tmp/temp-1456742965/tmp2077335416:org.apache.pig.impl.io.InterStorage) - -2
14 | | |
15 | | |---Local Rearrange[tuple]{Unknown}(false) - --3509976263222494134
16 | | |
17 | | |---Filter[tuple] - -340188275237520979
18 | | | |
19 | | | Constant(true) - --5941754500044119766
20 | | |
21 | | |---Load(file:/tmp/temp-1456742965/tmp2077335416:org.apache.pig.impl.io.InterStorage) - -4
22 | |
23 | |---MapReduce(-1) - -0:
24 | Reduce Plan Empty
25 | | Store(file:/tmp/temp-1456742965/tmp2077335416:org.apache.pig.impl.io.InterStorage) - -1
26 | | |
27 | | |---Load(DummyFil:DummyLdr) - -2626971498845605352
28 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/MRC17.gld:
--------------------------------------------------------------------------------
1 | MapReduce(1) - -0:
2 | | Store(DummyFil:DummyLdr) - --2731291429733866515
3 | | |
4 | | |---Limit - -6
5 | | |
6 | | |---New For Each(true)[bag] - -5
7 | | | |
8 | | | Project[tuple][1] - -4
9 | | |
10 | | |---Package(Packager)[tuple]{tuple} - -3
11 | | Local Rearrange[tuple]{tuple}(false) - -2
12 | | | |
13 | | | Project[tuple][*] - -1
14 | | |
15 | | |---Limit - --43001471365805096
16 | | |
17 | | |---Load(DummyFil:DummyLdr) - -5534705358975373945
18 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/MRC19.gld:
--------------------------------------------------------------------------------
1 | MapReduce(1) - -0:
2 | | Store(DummyFil:DummyLdr) - -1662763901266102631
3 | | |
4 | | |---New For Each(false)[tuple] - -6357361387299749270
5 | | | |
6 | | | POSortedDistinct[tuple] - -1793365165218576787
7 | | |
8 | | |---Package(Packager)[tuple]{Unknown} - --3258087883799592471
9 | | Local Rearrange[tuple]{Unknown}(false) - --8083579488061691196
10 | | |
11 | | |---Load(DummyFil:DummyLdr) - -698333249886773960
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/MRC2.gld:
--------------------------------------------------------------------------------
1 | MapReduce(-1) - -2:
2 | Reduce Plan Empty
3 | | Store(DummyFil:DummyLdr) - --2626287810923037076
4 | | |
5 | | |---Union[tuple] - --5768272326302808468
6 | | |
7 | | |---Load(file:/tmp/temp-1456742965/tmp2077335416:org.apache.pig.impl.io.InterStorage) - -3
8 | | |
9 | | |---Load(file:/tmp/temp-1456742965/tmp-26634357:org.apache.pig.impl.io.InterStorage) - -5
10 | |
11 | |---MapReduce(-1) - -0:
12 | | | Store(file:/tmp/temp-1456742965/tmp2077335416:org.apache.pig.impl.io.InterStorage) - -4
13 | | | |
14 | | | |---Package(Packager)[tuple]{Unknown} - --2829086180578157275
15 | | | Local Rearrange[tuple]{Unknown}(false) - -6435233330554227045
16 | | | |
17 | | | |---Load(DummyFil:DummyLdr) - --4168060277593001906
18 | |
19 | |---MapReduce(-1) - -1:
20 | | Store(file:/tmp/temp-1456742965/tmp-26634357:org.apache.pig.impl.io.InterStorage) - -6
21 | | |
22 | | |---Package(Packager)[tuple]{Unknown} - -7483213803049293823
23 | | Local Rearrange[tuple]{Unknown}(false) - --5190071275724378681
24 | | |
25 | | |---Load(DummyFil:DummyLdr) - --6957591191795645940
26 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/MRC5.gld:
--------------------------------------------------------------------------------
1 | MapReduce(-1) - -2:
2 | Reduce Plan Empty
3 | | Store(DummyFil:DummyLdr) - --8512881738335808286
4 | | |
5 | | |---Union[tuple] - -6693653468874366867
6 | | |
7 | | |---Filter[tuple] - -8515950928528386562
8 | | | | |
9 | | | | Constant(true) - -913122466036599874
10 | | | |
11 | | | |---Load(DummyFil:DummyLdr) - --203604194309414000
12 | | |
13 | | |---Filter[tuple] - -8554221887998033529
14 | | | |
15 | | | Constant(true) - --3347320220748403847
16 | | |
17 | | |---Load(DummyFil:DummyLdr) - -5969405952749301492
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/MRC9.gld:
--------------------------------------------------------------------------------
1 | MapReduce(-1) - -2:
2 | | Store(DummyFil:DummyLdr) - -7714111612268358662
3 | | |
4 | | |---Package(Packager)[tuple]{Unknown} - --1613182091613226659
5 | | Union[tuple] - -3
6 | | |
7 | | |---Filter[tuple] - -5165956429696944631
8 | | | | |
9 | | | | Constant(true) - -5321755951016030071
10 | | | |
11 | | | |---Load(DummyFil:DummyLdr) - -2197807331204639125
12 | | |
13 | | |---Filter[tuple] - -6139496040975471496
14 | | | |
15 | | | Constant(true) - --8447156979210379761
16 | | |
17 | | |---Load(DummyFil:DummyLdr) - -5878058249424113280
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/Sort.gld:
--------------------------------------------------------------------------------
1 | test-4: Store()
2 | |
3 | |---test-3: POSort[bag]() - scope-11
4 | | |
5 | | Project[bytearray][0] - scope-10
6 | |
7 | |---test-2: Load()
8 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/Split1.gld:
--------------------------------------------------------------------------------
1 | y: Filter[bag] - scope-157
2 | | |
3 | | Greater Than[boolean] - scope-161
4 | | |
5 | | |---Cast[chararray] - scope-159
6 | | | |
7 | | | |---Project[bytearray][0] - scope-158
8 | | |
9 | | |---Constant(7) - scope-160
10 | |
11 | |---test-24: Split - scope-156
12 | |
13 | |---test-23: Load()
14 |
15 | x: Store()
16 | |
17 | |---x: Filter[bag] - scope-162
18 | | |
19 | | Less Than[boolean] - scope-166
20 | | |
21 | | |---Cast[chararray] - scope-164
22 | | | |
23 | | | |---Project[bytearray][0] - scope-163
24 | | |
25 | | |---Constant(7) - scope-165
26 | |
27 | |---test-24: Split - scope-156
28 | |
29 | |---test-23: Load()
30 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/Split2.gld:
--------------------------------------------------------------------------------
1 | Filter[tuple] - Test-Plan-Builder-240
2 | | |
3 | | Less Than[boolean] - Test-Plan-Builder-243
4 | | |
5 | | |---Project[bytearray][0] - Test-Plan-Builder-241
6 | | |
7 | | |---Constant(7) - Test-Plan-Builder-242
8 | |
9 | |---Split - Test-Plan-Builder-239
10 | |
11 | |---Load(a:org.apache.pig.builtin.PigStorage) - Test-Plan-Builder-238
12 |
13 | Filter[tuple] - Test-Plan-Builder-244
14 | | |
15 | | Greater Than[boolean] - Test-Plan-Builder-247
16 | | |
17 | | |---Project[bytearray][0] - Test-Plan-Builder-245
18 | | |
19 | | |---Constant(7) - Test-Plan-Builder-246
20 | |
21 | |---Split - Test-Plan-Builder-239
22 | |
23 | |---Load(a:org.apache.pig.builtin.PigStorage) - Test-Plan-Builder-238
24 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/Union.gld:
--------------------------------------------------------------------------------
1 | A: Store()
2 | |
3 | |---A: Union[bag] - scope-153
4 | |
5 | |---test-19: Load()
6 | |
7 | |---test-20: Load()
8 | |
9 | |---test-21: Load()
10 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/jsTst3:
--------------------------------------------------------------------------------
1 | YPOODAGXEI,414
2 | OFWIXPNXJT,66
3 | KARRADPURE,305
4 | DTDPRBHLMH,19
5 | ADTXAGCZMH,172
6 | ULXMCNLRTE,449
7 | XZVAEEOCBF,214
8 | OKQPSAECSO,79
9 | XZIAJTPDEG,208
10 | TWFPATFMDB,307
11 | BQRDTLNRRN,157
12 | PNCMXJEGWU,440
13 | HWXVZZWVLW,93
14 | JJZLFNBXMZ,28
15 | SWROITWBRN,422
16 | GSGYGBZWMC,395
17 | RUUQJWYYXK,231
18 | HYZPWBFDEW,27
19 | DADHTIJBJU,13
20 | CUQHDLCNBQ,55
21 | MUXNTVANKS,377
22 | SRYEAIINHM,120
23 | ZCMAFXDCWC,477
24 | XMMNCYRSTK,175
25 | DMGLDTTNHN,15
26 | CCOXHORRTC,467
27 | IXKDFGECTL,394
28 | QIMXFQWPRX,58
29 | IMIGEEZXGX,48
30 | TVVEZUKEJX,207
31 | TWBRTCTJAU,484
32 | MAZPENXFJO,195
33 | NSWQJVIFRC,104
34 | OZDCZGJTTJ,295
35 | UHEZYGKTZU,232
36 | OYELBXNCTV,237
37 | TOWCLBYFDM,471
38 | HEOTEHYHXV,319
39 | BTQRUNOTPW,425
40 | YMFZNIUOMA,98
41 | FQPNSPUSAV,135
42 | WPNQFEFFCF,336
43 | OAUCJXFPMC,489
44 | XPYFBSVAZL,76
45 | TMXDXKBGDY,90
46 | SXHGTBGQYA,233
47 | BHVMQYNWJS,247
48 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/jsTst4:
--------------------------------------------------------------------------------
1 | ACEIXTCBOW,925
2 | EILBSMSUKV,959
3 | WIAZAYWLEI,809
4 | UTBSWQZACZ,827
5 | YQADCKFKUL,977
6 | VTMPACSASV,950
7 | DNFLELBCFY,829
8 | KKRLLORICZ,919
9 | VCQVFKTVSR,900
10 | IHTBBKZVBP,964
11 | JOTXNRVLSJ,920
12 | YISDNQVNLH,871
13 | TYZSOUDSMT,830
14 | KTCQNWGZCI,857
15 | IHCDPTBTMZ,869
16 | AWFCKJLFWT,968
17 | TDVUDCTMPK,943
18 | QCMEVUXQNI,811
19 | QFYGHDGYAT,904
20 | GDMDOZUFYB,815
21 | KQNVQUCMHP,921
22 | MCZLCFWGMF,854
23 | KZMOHJNKSM,885
24 | LHBPGFAJGI,958
25 | BIPGPJWDCI,860
26 | OFWIXPNXJT,66
27 | DTDPRBHLMH,19
28 | ADTXAGCZMH,172
29 | OKQPSAECSO,79
30 | BQRDTLNRRN,157
31 | HWXVZZWVLW,93
32 | JJZLFNBXMZ,28
33 | HYZPWBFDEW,27
34 | DADHTIJBJU,13
35 | CUQHDLCNBQ,55
36 | SRYEAIINHM,120
37 | XMMNCYRSTK,175
38 | DMGLDTTNHN,15
39 | QIMXFQWPRX,58
40 | IMIGEEZXGX,48
41 | MAZPENXFJO,195
42 | NSWQJVIFRC,104
43 | YMFZNIUOMA,98
44 | FQPNSPUSAV,135
45 | XPYFBSVAZL,76
46 | TMXDXKBGDY,90
47 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/spark/SPARKC-LoadStore-1-text.gld:
--------------------------------------------------------------------------------
1 | #--------------------------------------------------
2 | # Spark Plan
3 | #--------------------------------------------------
4 |
5 | Spark node scope-18
6 | a: Store(file:///tmp/pigoutput:org.apache.pig.builtin.PigStorage) - scope-8
7 | |
8 | |---a: New For Each(false,false)[bag] - scope-7
9 | | |
10 | | Cast[int] - scope-2
11 | | |
12 | | |---Project[bytearray][0] - scope-1
13 | | |
14 | | Cast[int] - scope-5
15 | | |
16 | | |---Project[bytearray][1] - scope-4
17 | |
18 | |---a: Load(file:///tmp/input:org.apache.pig.builtin.PigStorage) - scope-0--------
19 |
20 | Spark node scope-19
21 | b: Store(file:///tmp/pigoutput1:org.apache.pig.builtin.PigStorage) - scope-17
22 | |
23 | |---b: New For Each(false,false)[bag] - scope-16
24 | | |
25 | | Cast[int] - scope-11
26 | | |
27 | | |---Project[bytearray][0] - scope-10
28 | | |
29 | | Cast[int] - scope-14
30 | | |
31 | | |---Project[bytearray][1] - scope-13
32 | |
33 | |---b: Load(file:///tmp/pigoutput:org.apache.pig.builtin.PigStorage) - scope-9--------
34 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Limit-1.gld:
--------------------------------------------------------------------------------
1 | #--------------------------------------------------
2 | # There are 1 DAGs in the session
3 | #--------------------------------------------------
4 | #--------------------------------------------------
5 | # TEZ DAG plan: pig-0_scope-0
6 | #--------------------------------------------------
7 | Tez vertex scope-10 -> Tez vertex scope-12,
8 | Tez vertex scope-12
9 |
10 | Tez vertex scope-10
11 | # Plan on vertex
12 | POValueOutputTez - scope-11 -> [scope-12]
13 | |
14 | |---b: Limit - scope-1
15 | |
16 | |---a: Load(file:///tmp/input:org.apache.pig.builtin.PigStorage) - scope-0
17 | Tez vertex scope-12
18 | # Plan on vertex
19 | c: Store(file:///tmp/pigoutput:org.apache.pig.builtin.PigStorage) - scope-9
20 | |
21 | |---c: New For Each(false)[bag] - scope-8
22 | | |
23 | | Project[int][0] - scope-6
24 | |
25 | |---a: New For Each(false)[bag] - scope-5
26 | | |
27 | | Cast[int] - scope-3
28 | | |
29 | | |---Project[bytearray][0] - scope-2
30 | |
31 | |---b: Limit - scope-14
32 | |
33 | |---POValueInputTez - scope-13 <- scope-10
34 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Rank-1.gld:
--------------------------------------------------------------------------------
1 | #--------------------------------------------------
2 | # There are 1 DAGs in the session
3 | #--------------------------------------------------
4 | #--------------------------------------------------
5 | # TEZ DAG plan: pig-0_scope-0
6 | #--------------------------------------------------
7 | Tez vertex scope-11 -> Tez vertex scope-12,Tez vertex scope-14,
8 | Tez vertex scope-12 -> Tez vertex scope-14,
9 | Tez vertex scope-14
10 |
11 | Tez vertex scope-11
12 | # Plan on vertex
13 | POCounterTez - scope-8 -> scope-14,scope-12
14 | |
15 | |---a: New For Each(false,false)[bag] - scope-7
16 | | |
17 | | Cast[int] - scope-2
18 | | |
19 | | |---Project[bytearray][0] - scope-1
20 | | |
21 | | Cast[int] - scope-5
22 | | |
23 | | |---Project[bytearray][1] - scope-4
24 | |
25 | |---a: Load(file:///tmp/input1:org.apache.pig.builtin.PigStorage) - scope-0
26 | Tez vertex scope-12
27 | # Plan on vertex
28 | PORankStatsTez - scope-13 <- scope-11 -> scope-14
29 | Tez vertex scope-14
30 | # Plan on vertex
31 | b: Store(file:///tmp/pigoutput/d:org.apache.pig.builtin.PigStorage) - scope-10
32 | |
33 | |---PORankTez - scope-9 <- scope-11,scope-12
34 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Stream-1.gld:
--------------------------------------------------------------------------------
1 | #--------------------------------------------------
2 | # There are 1 DAGs in the session
3 | #--------------------------------------------------
4 | #--------------------------------------------------
5 | # TEZ DAG plan: pig-0_scope-0
6 | #--------------------------------------------------
7 | Tez vertex scope-10
8 |
9 | Tez vertex scope-10
10 | # Plan on vertex
11 | b: Store(file:///tmp/pigoutput:org.apache.pig.builtin.PigStorage) - scope-9
12 | |
13 | |---b: POStream[stream.pl -n 5 (stdin-org.apache.pig.builtin.PigStreaming/stdout-org.apache.pig.builtin.PigStreaming)] - scope-8
14 | |
15 | |---a: New For Each(false,false)[bag] - scope-7
16 | | |
17 | | Cast[int] - scope-2
18 | | |
19 | | |---Project[bytearray][0] - scope-1
20 | | |
21 | | Cast[int] - scope-5
22 | | |
23 | | |---Project[bytearray][1] - scope-4
24 | |
25 | |---a: Load(file:///tmp/input:PigStorage(',')) - scope-0
26 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/InputFiles/jsTst5.txt:
--------------------------------------------------------------------------------
1 | asldfkj, 1
2 | qweroj, 2
3 | zxcvlkjwer, 3
4 | xcovij, 2
5 | woi, 1
6 | asdlfkj, 1
7 | asdlkj, 2
8 | asdklfhqweur, 3
9 | zxcvoiu, 2
10 | zxcpiou, 1
11 | lkjqwer, 3
12 | xcviop, 2
13 | xcvpiouwer, 1
14 | zxcvju, 3
15 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/TestIllustrateInput.txt:
--------------------------------------------------------------------------------
1 | 4 6
2 | 3 1
3 | 5 7
4 | 1 4
5 | 0 9
6 | 7 8
7 | 10 9
8 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/TestIllustrateInput2.txt:
--------------------------------------------------------------------------------
1 | 14 16
2 | 13 11
3 | 15 17
4 | 11 14
5 | 17 18
6 | 20 19
7 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/TestIllustrateInput_invalid.txt:
--------------------------------------------------------------------------------
1 | ,
2 | 1,2
3 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/TestWordCount.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/org/apache/pig/test/data/TestWordCount.jar
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/blockEndingInCR.txt.bz2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/org/apache/pig/test/data/blockEndingInCR.txt.bz2
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/blockHeaderEndsAt136500.txt.bz2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/org/apache/pig/test/data/blockHeaderEndsAt136500.txt.bz2
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/bzipTest.bz2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/org/apache/pig/test/data/bzipTest.bz2
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/bzipdir1.bz2/bzipdir2.bz2/recordLossblockHeaderEndsAt136500.txt.bz2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/org/apache/pig/test/data/bzipdir1.bz2/bzipdir2.bz2/recordLossblockHeaderEndsAt136500.txt.bz2
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/explainScript.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | rmf input-copy.txt; cat 'foo'; a = load '1.txt' ; aliases;illustrate a; copyFromLocal foo bar; copyToLocal foo bar; describe a; mkdir foo; run bar.pig; exec bar.pig; cp foo bar; explain a;cd 'bar'; pwd; ls ; fs -ls ; fs -rmr foo; mv foo bar; dump a;store a into 'input-copy.txt' ; a = load '2.txt' as (b);explain a; rm foo; store a into 'bar';
20 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/generate_date.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | if "%1"=="" (
3 | echo 20080228
4 | ) else (
5 | echo %1
6 | )
7 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/generate_date.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing,
13 | # software distributed under the License is distributed on an
14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | # KIND, either express or implied. See the License for the
16 | # specific language governing permissions and limitations
17 | # under the License.
18 |
19 | if [ $# -eq 0 ]
20 | then
21 | echo "20080228";
22 | elif [ $# -eq 1 ]
23 | then
24 | #echo `date +%Y``date +%m``date +%d`;
25 | echo $1;
26 | fi
27 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/illustrate.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | A = load 'test/org/apache/pig/test/data/TestIllustrateInput.txt' as (x:int, y:int);
20 | B = distinct A;
21 | C = FILTER B by x > 3;
22 | D = FILTER B by x < 3;
23 | store C into 'Bigger';
24 | store D into 'Smaller';
25 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/illustrate2.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | A = load 'test/org/apache/pig/test/data/TestIllustrateInput.txt' as (x:int, y:int);
20 | B = FILTER A by x > 3;
21 | C = FILTER A by x < 3;
22 | store B into 'Bigger';
23 | store C into 'Smaller';
24 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/illustrate3.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | A = load 'test/org/apache/pig/test/data/TestIllustrateInput.txt' as (x:int);
20 | A1 = group A by x;
21 | A2 = foreach A1 generate group, COUNT(A);
22 | store A2 into 'A';
23 | B = load 'test/org/apache/pig/test/data/TestIllustrateInput.txt' as (x:double, y:int);
24 | B1 = group B by x;
25 | B2 = foreach B1 generate group, COUNT(B);
26 | store B2 into 'B';
27 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/illustrate4.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | A = load 'test/org/apache/pig/test/data/TestIllustrateInput_invalid.txt' using PigStorage(',') as (x:int, y:int);
20 | STORE A INTO 'A.txt';
21 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/illustrate5.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | A = load 'test/org/apache/pig/test/data/TestIllustrateInput.txt' as (x:int, y:int);
20 | B = group A by x;
21 | C = foreach B generate group, COUNT(A);
22 | store C into 'out1';
23 | store A into 'out2';
24 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/illustrate6.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | a = load 'test/org/apache/pig/test/data/TestIllustrateInput.txt' as (x:int, y:int);
20 | b = group a all;
21 | c = foreach b generate COUNT(a) as count; d = foreach a generate x / c.count; store d into 'test.out';
22 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/illustrate7.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | a = load 'test/org/apache/pig/test/data/TestIllustrateInput.txt' as (x:int, y:int);
20 | b = load 'test/org/apache/pig/test/data/TestIllustrateInput2.txt' as (x:int, y:int);
21 | c = join a by x, b by x;
22 | store c into 'test.out';
23 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/input5.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | %declare udfs /data/pigudf.jar
19 | register $udfs;
20 |
21 | aa = load '$loadfile ' using PigStorage('\x01');
22 | bb = filter aa by (ARITY == '16') and ( $4 eq '' or $4 eq 'NULL' or $4 eq 'ss') parallel 400;
23 | a = foreach bb generate $0,$12,$7;
24 | store inactiveAccounts into '$storefile';
25 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/inputDollarSign.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | a = load 'data';
20 | b = filter by $filter;
21 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/inputNoVars.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 |
20 | register /home/y/lib/java/pigtest/testudf.jar;
21 | A = load '/user/pig/tests/data/singlefile/textdoc' using TextLoader();
22 | define X `perl -ne 'chomp $_; print "$_\n"'` output (stdout using org.apache.pig.test.udf.storefunc.StringStore());
23 | B = stream A through X;
24 | store B into '/user/pig/tests/results/olgan.1209067990/DefineClause_4.out';
25 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/newinputS.txt:
--------------------------------------------------------------------------------
1 | key1=value1
2 | date=20080202
3 | mypath=/user/abhit/$date
4 | date2=20080202.txt
5 | path2='user/kal/$date/$date2'
6 |
7 |
8 | a = 2
9 | b = 3
10 | c = $a + $b
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/output26.pig:
--------------------------------------------------------------------------------
1 | avro = LOAD '/data/part-m-00000.avro' USING PigStorage ();
2 | avro2 = FOREACH avro GENERATE browser_id, component_version, member_id, page_key, session_id, tracking_time, type;
3 | fs -rmr testOut/out1;
4 | STORE avro2 INTO 'testOut/out2'
5 | USING PigStorage (
6 | ' {
7 | "debug": 5,
8 | "schema":
9 | { "type":"record","name":"TestRecord",
10 | "fields": [ {"name":"browser_id", "type":["null","string"]},
11 | {"name":"component_version","type":"int"},
12 | {"name":"member_id","type":"int"},
13 | {"name":"page_key","type":["null","string"]},
14 | {"name":"session_id","type":"long"},
15 | {"name":"tracking_time","type":"long"},
16 | {"name":"type","type":["null","string"]}
17 | ]
18 | }
19 | }
20 | ');
21 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/passwd:
--------------------------------------------------------------------------------
1 | root:x:0:0:root:/root:/bin/bash
2 | bin:x:1:1:bin:/bin:/sbin/nologin
3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin
4 | adm:x:3:4:adm:/var/adm:/sbin/nologin
5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
6 | sync:x:5:0:sync:/sbin:/bin/sync
7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
8 | halt:x:7:0:halt:/sbin:/sbin/halt
9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
10 | news:x:9:13:news:/etc/news:
11 | uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
12 | operator:x:11:0:operator:/root:/sbin/nologin
13 | games:x:12:100:games:/usr/games:/sbin/nologin
14 | gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
15 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/passwd2:
--------------------------------------------------------------------------------
1 | root:x:0:0:root:/root:/bin/bash
2 | bin:x:1:1:bin:/bin:/sbin/nologin
3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin
4 | adm:x:3:4:adm:/var/adm:/sbin/nologin
5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
6 | sync:x:5:0:sync:/sbin:/bin/sync
7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
8 | halt:x:7:0:halt:/sbin:/sbin/halt
9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
10 | news:x:9:13:news:/etc/news:
11 | uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
12 | operator:x:11:0:operator:/root:/sbin/nologin
13 | games:x:12:100:games:/usr/games:/sbin/nologin
14 | gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
15 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/pigtestloader.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/org/apache/pig/test/data/pigtestloader.jar
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/test.ppf:
--------------------------------------------------------------------------------
1 | LIMIT = 5
2 | FILE = foo
3 | FUNCTION = COUNT
4 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/test_broken.ppf:
--------------------------------------------------------------------------------
1 | LIMIT = WONTWORK
2 | FILE = foo
3 | FUNCTION = COUNT
4 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/testsub.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | foo = load '$FILE' as (foo, fast, regenerate);
20 | bar = limit foo $LIMIT;
21 | baz = foreach bar generate $FUNCTION($0);
22 | explain baz;
23 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/testsubnested_exec.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | exec -param_file test/org/apache/pig/test/data/test.ppf test/org/apache/pig/test/data/testsub.pig;
20 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/data/testsubnested_run.pig:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | run -param LIMIT=5 -param FILE=foo -param FUNCTION=COUNT test/org/apache/pig/test/data/testsub.pig;
20 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/utils/MultiLevelDerivedUDF3.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.pig.test.utils;
20 |
21 | public class MultiLevelDerivedUDF3 extends MultiLevelDerivedUDF2 {
22 | }
23 |
--------------------------------------------------------------------------------
/test/org/apache/pig/test/utils/UPPER.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.pig.test.utils;
20 |
21 | import org.apache.pig.EvalFunc;
22 | import org.apache.pig.data.Tuple;
23 |
24 | public class UPPER extends EvalFunc {
25 | public String exec(Tuple input) {
26 | final int quotient = 5/0;
27 | String str="hello";
28 | return str;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/test/perf/pigmix/conf/config.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | hdfsroot=/user/pig/tests/data/pigmix
4 | localtmp=/tmp
5 |
6 | # configure the number of mappers for data generator
7 | mappers=90
8 |
9 | # ~1600 bytes per row for page_views (it is the base for most other inputs)
10 | rows=625000000
11 |
12 | # only used in L11 (widerow, ~2500 bytes per row)
13 | widerowcnt=10000000
14 |
--------------------------------------------------------------------------------
/test/perf/pigmix/lib/sdsuLibJKD12.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/test/perf/pigmix/lib/sdsuLibJKD12.jar
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L1.pig:
--------------------------------------------------------------------------------
1 | -- This script tests reading from a map, flattening a bag of maps, and use of bincond.
2 | register $PIGMIX_JAR
3 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
4 | as (user, action, timespent, query_term, ip_addr, timestamp,
5 | estimated_revenue, page_info, page_links);
6 | B = foreach A generate user, (int)action as action, (map[])page_info as page_info,
7 | flatten((bag{tuple(map[])})page_links) as page_links;
8 | C = foreach B generate user,
9 | (action == 1 ? page_info#'a' : page_links#'b') as header;
10 | D = group C by user parallel $PARALLEL;
11 | E = foreach D generate group, COUNT(C) as cnt;
12 | store E into '$PIGMIX_OUTPUT/L1out';
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L10.pig:
--------------------------------------------------------------------------------
1 | --This script covers order by of multiple values.
2 | register $PIGMIX_JAR
3 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
4 | as (user, action, timespent:int, query_term, ip_addr, timestamp,
5 | estimated_revenue:double, page_info, page_links);
6 | B = order A by query_term, estimated_revenue desc, timespent parallel $PARALLEL;
7 | store B into '$PIGMIX_OUTPUT/L10out';
8 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L11.pig:
--------------------------------------------------------------------------------
1 | -- This script covers distinct and union.
2 | register $PIGMIX_JAR
3 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
4 | as (user, action, timespent, query_term, ip_addr, timestamp,
5 | estimated_revenue, page_info, page_links);
6 | B = foreach A generate user;
7 | C = distinct B parallel $PARALLEL;
8 | alpha = load '$HDFS_ROOT/widerow' using PigStorage('\u0001');
9 | beta = foreach alpha generate $0 as name;
10 | gamma = distinct beta parallel $PARALLEL;
11 | D = union C, gamma;
12 | E = distinct D parallel $PARALLEL;
13 | store E into '$PIGMIX_OUTPUT/L11out';
14 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L12.pig:
--------------------------------------------------------------------------------
1 | -- This script covers multi-store queries.
2 | register $PIGMIX_JAR
3 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
4 | as (user, action, timespent, query_term, ip_addr, timestamp,
5 | estimated_revenue, page_info, page_links);
6 | B = foreach A generate user, action, (int)timespent as timespent, query_term,
7 | (double)estimated_revenue as estimated_revenue;
8 | split B into C if user is not null, alpha if user is null;
9 | split C into D if query_term is not null, aleph if query_term is null;
10 | E = group D by user parallel $PARALLEL;
11 | F = foreach E generate group, MAX(D.estimated_revenue);
12 | store F into '$PIGMIX_OUTPUT/highest_value_page_per_user';
13 | beta = group alpha by query_term parallel $PARALLEL;
14 | gamma = foreach beta generate group, SUM(alpha.timespent);
15 | store gamma into '$PIGMIX_OUTPUT/total_timespent_per_term';
16 | beth = group aleph by action parallel $PARALLEL;
17 | gimel = foreach beth generate group, COUNT(aleph);
18 | store gimel into '$PIGMIX_OUTPUT/queries_per_action';
19 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L13.pig:
--------------------------------------------------------------------------------
1 | register $PIGMIX_JAR
2 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
3 | as (user, action, timespent, query_term, ip_addr, timestamp, estimated_revenue, page_info, page_links);
4 | B = foreach A generate user, estimated_revenue;
5 | alpha = load '$HDFS_ROOT/power_users_samples' using PigStorage('\u0001') as (name, phone, address, city, state, zip);
6 | beta = foreach alpha generate name, phone;
7 | C = join B by user left outer, beta by name parallel $PARALLEL;
8 | store C into '$PIGMIX_OUTPUT/L13out';
9 |
10 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L14.pig:
--------------------------------------------------------------------------------
1 | register $PIGMIX_JAR
2 | A = load '$HDFS_ROOT/page_views_sorted' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
3 | as (user, action, timespent, query_term, ip_addr, timestamp, estimated_revenue, page_info, page_links);
4 | B = foreach A generate user, estimated_revenue;
5 | alpha = load '$HDFS_ROOT/users_sorted' using PigStorage('\u0001') as (name, phone, address, city, state, zip);
6 | beta = foreach alpha generate name;
7 | C = join B by user, beta by name using 'merge';
8 | store C into '$PIGMIX_OUTPUT/L14out';
9 |
10 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L15.pig:
--------------------------------------------------------------------------------
1 | register $PIGMIX_JAR
2 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
3 | as (user, action, timespent, query_term, ip_addr, timestamp, estimated_revenue, page_info, page_links);
4 | B = foreach A generate user, action, estimated_revenue, timespent;
5 | C = group B by user parallel $PARALLEL;
6 | D = foreach C {
7 | beth = distinct B.action;
8 | rev = distinct B.estimated_revenue;
9 | ts = distinct B.timespent;
10 | generate group, COUNT(beth), SUM(rev), (int)AVG(ts);
11 | }
12 | store D into '$PIGMIX_OUTPUT/L15out';
13 |
14 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L16.pig:
--------------------------------------------------------------------------------
1 | register $PIGMIX_JAR
2 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
3 | as (user, action, timespent, query_term, ip_addr, timestamp, estimated_revenue, page_info, page_links);
4 | B = foreach A generate user, estimated_revenue;
5 | C = group B by user parallel $PARALLEL;
6 | D = foreach C {
7 | E = order B by estimated_revenue;
8 | F = E.estimated_revenue;
9 | generate group, SUM(F);
10 | }
11 |
12 | store D into '$PIGMIX_OUTPUT/L16out';
13 |
14 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L17.pig:
--------------------------------------------------------------------------------
1 | register $PIGMIX_JAR
2 | A = load '$HDFS_ROOT/widegroupbydata' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
3 | as (user, action, timespent, query_term, ip_addr, timestamp,
4 | estimated_revenue, page_info, page_links, user_1, action_1, timespent_1, query_term_1, ip_addr_1, timestamp_1,
5 | estimated_revenue_1, page_info_1, page_links_1, user_2, action_2, timespent_2, query_term_2, ip_addr_2, timestamp_2,
6 | estimated_revenue_2, page_info_2, page_links_2);
7 | B = group A by (user, action, timespent, query_term, ip_addr, timestamp,
8 | estimated_revenue, user_1, action_1, timespent_1, query_term_1, ip_addr_1, timestamp_1,
9 | estimated_revenue_1, user_2, action_2, timespent_2, query_term_2, ip_addr_2, timestamp_2,
10 | estimated_revenue_2) parallel $PARALLEL;
11 | C = foreach B generate SUM(A.timespent), SUM(A.timespent_1), SUM(A.timespent_2), AVG(A.estimated_revenue), AVG(A.estimated_revenue_1), AVG(A.estimated_revenue_2);
12 | store C into '$PIGMIX_OUTPUT/L17out';
13 |
14 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L2.pig:
--------------------------------------------------------------------------------
1 | -- This script tests using a join small enough to do in fragment and replicate.
2 | register $PIGMIX_JAR
3 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
4 | as (user, action, timespent, query_term, ip_addr, timestamp,
5 | estimated_revenue, page_info, page_links);
6 | B = foreach A generate user, estimated_revenue;
7 | alpha = load '$HDFS_ROOT/power_users' using PigStorage('\u0001') as (name, phone,
8 | address, city, state, zip);
9 | beta = foreach alpha generate name;
10 | C = join B by user, beta by name using 'replicated' parallel $PARALLEL;
11 | store C into '$PIGMIX_OUTPUT/L2out';
12 |
13 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L3.pig:
--------------------------------------------------------------------------------
1 | --This script tests a join too large for fragment and replicate. It also
2 | --contains a join followed by a group by on the same key, something that we
3 | --could potentially optimize by not regrouping.
4 | register $PIGMIX_JAR
5 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
6 | as (user, action, timespent, query_term, ip_addr, timestamp,
7 | estimated_revenue, page_info, page_links);
8 | B = foreach A generate user, (double)estimated_revenue;
9 | alpha = load '$HDFS_ROOT/users' using PigStorage('\u0001') as (name, phone, address,
10 | city, state, zip);
11 | beta = foreach alpha generate name;
12 | C = join beta by name, B by user parallel $PARALLEL;
13 | D = group C by $0 parallel $PARALLEL;
14 | E = foreach D generate group, SUM(C.estimated_revenue);
15 | store E into '$PIGMIX_OUTPUT/L3out';
16 |
17 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L4.pig:
--------------------------------------------------------------------------------
1 | -- This script covers foreach/generate with a nested distinct.
2 | register $PIGMIX_JAR
3 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
4 | as (user, action, timespent, query_term, ip_addr, timestamp,
5 | estimated_revenue, page_info, page_links);
6 | B = foreach A generate user, action;
7 | C = group B by user parallel $PARALLEL;
8 | D = foreach C {
9 | aleph = B.action;
10 | beth = distinct aleph;
11 | generate group, COUNT(beth);
12 | }
13 | store D into '$PIGMIX_OUTPUT/L4out';
14 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L5.pig:
--------------------------------------------------------------------------------
1 | --This script does an anti-join. This is useful because it is a use of
2 | --cogroup that is not a regular join.
3 | register $PIGMIX_JAR
4 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
5 | as (user, action, timespent, query_term, ip_addr, timestamp,
6 | estimated_revenue, page_info, page_links);
7 | B = foreach A generate user;
8 | alpha = load '$HDFS_ROOT/users' using PigStorage('\u0001') as (name, phone, address,
9 | city, state, zip);
10 | beta = foreach alpha generate name;
11 | C = cogroup beta by name, B by user parallel $PARALLEL;
12 | D = filter C by COUNT(beta) == 0;
13 | E = foreach D generate group;
14 | store E into '$PIGMIX_OUTPUT/L5out';
15 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L6.pig:
--------------------------------------------------------------------------------
1 | -- This script covers the case where the group by key is a significant
2 | -- percentage of the row.
3 | register $PIGMIX_JAR
4 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
5 | as (user, action, timespent, query_term, ip_addr, timestamp,
6 | estimated_revenue, page_info, page_links);
7 | B = foreach A generate user, action, (int)timespent as timespent, query_term, ip_addr, timestamp;
8 | C = group B by (user, query_term, ip_addr, timestamp) parallel $PARALLEL;
9 | D = foreach C generate flatten(group), SUM(B.timespent);
10 | store D into '$PIGMIX_OUTPUT/L6out';
11 |
12 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L7.pig:
--------------------------------------------------------------------------------
1 | -- This script covers having a nested plan with splits.
2 | register $PIGMIX_JAR
3 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader() as (user, action, timespent, query_term,
4 | ip_addr, timestamp, estimated_revenue, page_info, page_links);
5 | B = foreach A generate user, timestamp;
6 | C = group B by user parallel $PARALLEL;
7 | D = foreach C {
8 | morning = filter B by timestamp < 43200;
9 | afternoon = filter B by timestamp >= 43200;
10 | generate group, COUNT(morning), COUNT(afternoon);
11 | }
12 | store D into '$PIGMIX_OUTPUT/L7out';
13 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L8.pig:
--------------------------------------------------------------------------------
1 | -- This script covers group all.
2 | register $PIGMIX_JAR
3 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
4 | as (user, action, timespent, query_term, ip_addr, timestamp,
5 | estimated_revenue, page_info, page_links);
6 | B = foreach A generate user, (int)timespent as timespent, (double)estimated_revenue as estimated_revenue;
7 | C = group B all;
8 | D = foreach C generate SUM(B.timespent), AVG(B.estimated_revenue);
9 | store D into '$PIGMIX_OUTPUT/L8out';
10 |
--------------------------------------------------------------------------------
/test/perf/pigmix/src/pig/L9.pig:
--------------------------------------------------------------------------------
1 | --This script covers order by of a single value.
2 | register $PIGMIX_JAR
3 | A = load '$HDFS_ROOT/page_views' using org.apache.pig.test.pigmix.udf.PigPerformanceLoader()
4 | as (user, action, timespent, query_term, ip_addr, timestamp,
5 | estimated_revenue, page_info, page_links);
6 | B = order A by query_term parallel $PARALLEL;
7 | store B into '$PIGMIX_OUTPUT/L9out';
8 |
--------------------------------------------------------------------------------
/test/pigunit-tests:
--------------------------------------------------------------------------------
1 | **/TestPigTest.java
2 | **/TestGruntParser.java
3 |
--------------------------------------------------------------------------------
/test/resources/org/apache/pig/test/ClassLoaderSanityCheck.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.pig.test;
20 |
21 | /**
22 | * A dummy class to ensure PigContext's classloader's 'consistency'
23 | * after registering jars.
24 | */
25 | public class ClassLoaderSanityCheck {
26 | }
27 |
--------------------------------------------------------------------------------
/test/resources/org/apache/pig/test/RegisteredJarVisibilitySchema.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.pig.test;
19 |
20 | import java.io.Serializable;
21 |
22 | /**
23 | * Please see {@link TestRegisteredJarVisibility} for information about this class.
24 | */
25 | public class RegisteredJarVisibilitySchema implements Serializable {
26 | }
27 |
--------------------------------------------------------------------------------
/test/smoke-tests:
--------------------------------------------------------------------------------
1 | **/TestCommit.java
2 | **/TestMultiQueryLocal.java
3 | **/TestStreaming.java
4 | **/TestJoinSmoke.java
5 |
--------------------------------------------------------------------------------
/tutorial/data/excite.log.bz2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/tutorial/data/excite.log.bz2
--------------------------------------------------------------------------------
/tutorial/scripts/script1-hadoop.pig:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/pig/d795e8309d321a1b8b818e440348aab4ca3f8b5c/tutorial/scripts/script1-hadoop.pig
--------------------------------------------------------------------------------