Package cascading.tap.local

Examples of cascading.tap.local.FileTap


      + "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 );

    FlowConnector flowConnector = new LocalFlowConnector();

    SQLPlanner sqlPlanner = new SQLPlanner()
      .setSql( statement );

    flowDef.addAssemblyPlanner( sqlPlanner );

    Flow flow = flowConnector.connect( flowDef );

    flow.complete();

    TupleEntryIterator iterator = resultsTap.openForRead( flow.getFlowProcess() );

    while( iterator.hasNext() )
      System.out.println( iterator.next() );

    iterator.close();
View Full Code Here


    }

  @Override
  public FileType getFileTypeFor( String identifier )
    {
    return new FileTap( new TextLine(), identifier, SinkMode.KEEP );
    }
View Full Code Here

public class LocalDefaultFactory extends DefaultFactory
  {
  @Override
  protected Tap newTap( Scheme scheme, String identifier, SinkMode mode )
    {
    return new FileTap( scheme, identifier, mode );
    }
View Full Code Here

TOP

Related Classes of cascading.tap.local.FileTap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.