Looks like it happens with the FlowExample if you add an order by. I modified the flow example to look like this:
package cascading.lingual.examples.foodmart;
import java.io.IOException;
import cascading.flow.Flow;
import cascading.flow.FlowDef;
import cascading.flow.local.LocalFlowConnector;
import cascading.lingual.flow.SQLPlanner;
import cascading.lingual.tap.local.SQLTypedTextDelimited;
import cascading.tap.SinkMode;
import cascading.tap.Tap;
import cascading.tap.local.FileTap;
import cascading.tuple.TupleEntryIterator;
/** A trivial Flow example */
public class FlowExample
{
public static void main( String[] args ) throws Exception
{
new FlowExample().run();
}
public void run() throws IOException
{
String statement = "select *\n"
+ "from \"example\".\"sales_fact_1997\" as s\n"
+ "join \"example\".\"employee\" as e\n"
+ "on e.\"EMPID\" = s.\"CUST_ID\"\n"
+ "order by e.\"EMPID\"";
Tap empTap = new FileTap( new SQLTypedTextDelimited( ",", "\"" ),
"src/main/resources/data/example/employee.tcsv", SinkMode.KEEP );
Tap salesTap = new FileTap( new SQLTypedTextDelimited( ",", "\"" ),
"src/main/resources/data/example/sales_fact_1997.tcsv", SinkMode.KEEP );
Tap resultsTap = new FileTap( new SQLTypedTextDelimited( ",", "\"" ),
"build/test/output/flow/results.tcsv", SinkMode.REPLACE );
FlowDef flowDef = FlowDef.flowDef()
.setName( "sql flow" )
.addSource( "example.employee", empTap )
.addSource( "example.sales_fact_1997", salesTap )
.addSink( "results", resultsTap );
SQLPlanner sqlPlanner = new SQLPlanner()
.setSql( statement );
flowDef.addAssemblyPlanner( sqlPlanner );
Flow flow = new LocalFlowConnector().connect( flowDef );
flow.complete();
TupleEntryIterator iterator = resultsTap.openForRead( flow.getFlowProcess() );
while( iterator.hasNext() )
System.out.println( iterator.next() );
iterator.close();
}
}
When you build the fatjar and run in the way documented in the README you see the same error:
/usr/local/Cellar/hadoop/2.2.0/bin/hadoop jar /Users/rwhitcomb/Documents/twitter/github/lingual/lingual-examples/build/libs/lingual-examples-1.2.0-wip-dev-fatjar.jar cascading.lingual.examples.foodmart.FlowExample
14/08/14 20:32:15 INFO property.AppProps: using app.id: C3AE880B1A174EAE97EF85D1F2D26E52 14/08/14 20:32:15 INFO tap.TapSchema: adding table on schema: example, table: employee, fields: 'EMPID', 'NAME' | int, String, identifier: src/main/resources/data/example/employee.tcsv
14/08/14 20:32:15 INFO tap.TapSchema: adding table on schema: example, table: sales_fact_1997, fields: 'CUST_ID', 'PROD_ID' | int, int, identifier: src/main/resources/data/example/sales_fact_1997.tcsv
14/08/14 20:32:15 INFO tap.TapSchema: adding table on schema: null, table: results, fields: UNKNOWN, identifier: build/test/output/flow/results.tcsv
Exception in thread "main" cascading.flow.planner.PlannerException: could not build flow from assembly: [null]
at cascading.flow.planner.FlowPlanner.handleExceptionDuringPlanning(FlowPlanner.java:577)
at cascading.flow.local.planner.LocalPlanner.buildFlow(LocalPlanner.java:108)
at cascading.flow.local.planner.LocalPlanner.buildFlow(LocalPlanner.java:40)
at cascading.flow.FlowConnector.connect(FlowConnector.java:459)
at cascading.lingual.examples.foodmart.FlowExample.run(FlowExample.java:70)
at cascading.lingual.examples.foodmart.FlowExample.main(FlowExample.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
Caused by: java.lang.NullPointerException
at cascading.lingual.optiq.enumerable.CascadingFlowRunnerEnumerable.createEnumerator(CascadingFlowRunnerEnumerable.java:141)