MCPcopy Create free account
hub / github.com/apache/pig / testSchemaWithSplit

Method testSchemaWithSplit

test/org/apache/pig/test/TestPigSplit.java:109–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107 }
108
109 @Test
110 public void testSchemaWithSplit() throws Exception {
111 inputFileName = "testSchemaWithSplit-input.txt";
112 String[] input = { "2", "12", "42" };
113 for (ExecType execType : execTypes) {
114 try {
115 setUp(execType);
116 createInput(input, execType);
117 pigServer.registerQuery("a = load '" + inputFileName
118 + "' as (value:chararray);");
119 pigServer
120 .registerQuery("split a into b if value < '20', c if value > '10';");
121 pigServer.registerQuery("b1 = order b by value;");
122 pigServer.registerQuery("c1 = order c by value;");
123
124 // order in lexicographic, so 12 comes before 2
125 Iterator<Tuple> iter = pigServer.openIterator("b1");
126 assertTrue("b1 has an element", iter.hasNext());
127 assertEquals("first item in b1", "12", iter.next().get(0));
128 assertTrue("b1 has an element", iter.hasNext());
129 assertEquals("second item in b1", "2", iter.next().get(0));
130 assertFalse("b1 is over", iter.hasNext());
131
132 iter = pigServer.openIterator("c1");
133 assertTrue("c1 has an element", iter.hasNext());
134 assertEquals("first item in c1", "12", iter.next().get(0));
135 assertTrue("c1 has an element", iter.hasNext());
136 assertEquals("second item in c1", "2", iter.next().get(0));
137 assertTrue("c1 has an element", iter.hasNext());
138 assertEquals("third item in c1", "42", iter.next().get(0));
139 assertFalse("c1 is over", iter.hasNext());
140 } finally {
141 tearDown(execType);
142 }
143 }
144 }
145
146 @Test
147 public void testLongEvalSpec() throws Exception {

Callers

nothing calls this directly

Calls 9

setUpMethod · 0.95
createInputMethod · 0.95
tearDownMethod · 0.95
openIteratorMethod · 0.80
getMethod · 0.65
registerQueryMethod · 0.45
hasNextMethod · 0.45
assertEqualsMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected