cascading.lingual.flow
Class SQLPlanner
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sql
protected String sql
defaultSchema
protected String defaultSchema
tailName
protected String tailName
SQLPlanner
public SQLPlanner()
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.