5 * Created on September 3, 2007, 11:47 AM
10 import com
.yahoo
.pig
.PigServer
.ExecType
;
11 import java
.io
.BufferedReader
;
12 import java
.io
.FileInputStream
;
13 import junit
.framework
.*;
19 public class PigServerTest
extends TestCase
{
21 public PigServerTest(String testName
) {
25 protected void setUp() throws Exception
{
28 protected void tearDown() throws Exception
{
31 public void testRegisterQuery() throws Exception
{
32 System
.out
.println("registerQuery");
34 String lineOne
= "a = load '/Users/trevor/Desktop/data.txt' as (f1, f2, f3);";
35 String lineTwo
= "b = FOREACH a GENERATE f1, f2;";
36 String lineThree
= "c = COGROUP b BY f1, b BY f2;";
37 PigServer instance
= null;
39 instance
= new PigServer( ExecType
.GALAGO
);
40 instance
.registerQuery( lineOne
);
41 instance
.registerQuery( lineTwo
);
42 instance
.registerQuery( lineThree
);
43 instance
.store( "b", "/tmp/outdb" );