cascading.lingual.flow
Class SQLPlanner

java.lang.Object
  extended by cascading.lingual.flow.SQLPlanner
All Implemented Interfaces:
AssemblyPlanner

public class SQLPlanner
extends Object
implements AssemblyPlanner

Class SQLPlanner is an implementation of an AssemblyPlanner that supports parsing ANSI SQL statements against Tap meta-data into a pipe assembly, which in turn is used by a FlowConnector to create a new Flow instance.

SQLPlanner uses available meta-data from a partially initialized Flow instance created by the current FlowPlanner for the given platform. Specifically, internal "table" meta-data is created from source and sink Tap instances provided by the current FlowDef.

Currently table names as expected in the given SQL statement are expected to match the source and sink names, if the SQL names have a schema, setDefaultSchema(String) must be called, or it must be prepended to the names as provided to the FlowDef instance.

For example with this from clause "select * from employees.salaries", either the source Tap should be named "employees.salaries" or sqlPlanner.setDefaultSchema( "employees" ); must be called if the source Tap is named "salaries". Both approaches result in an internal "table" being named "employees.salaries".

See Also:
FlowDef

Nested Class Summary
 
Nested classes/interfaces inherited from interface cascading.flow.AssemblyPlanner
AssemblyPlanner.Context
 
Field Summary
protected  String defaultSchema
           
protected  String sql
           
protected  String tailName
           
 
Constructor Summary
SQLPlanner()
           
 
Method Summary
 String getDefaultSchema()
           
 String getSql()
           
 String getTailName()
           
 List<Pipe> resolveTails(AssemblyPlanner.Context context)
           
 SQLPlanner setDefaultSchema(String defaultSchema)
           
 SQLPlanner setSql(String sql)
           
 SQLPlanner setTailName(String tailName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sql

protected String sql

defaultSchema

protected String defaultSchema

tailName

protected String tailName
Constructor Detail

SQLPlanner

public SQLPlanner()
Method Detail

getSql

public String getSql()

setSql

public SQLPlanner setSql(String sql)

getTailName

public String getTailName()

setTailName

public SQLPlanner setTailName(String tailName)

getDefaultSchema

public String getDefaultSchema()

setDefaultSchema

public SQLPlanner setDefaultSchema(String defaultSchema)

resolveTails

public List<Pipe> resolveTails(AssemblyPlanner.Context context)
Specified by:
resolveTails in interface AssemblyPlanner


Copyright © 2007-2013 Concurrent, Inc. All Rights Reserved.