| java.lang.Object com.quadcap.sql.Expression com.quadcap.sql.TableExpression com.quadcap.sql.SelectExpression
Method Summary | |
public void | getBaseTables(Vector v) | public Cursor | getCursor(Session session, Cursor cur) This is the main entry point to this madness. | public Vector | getFrom() | public Value | getValue(Session session, Cursor cur) Return the expression as a scalar value. | public void | invert() | boolean | isAggregate(Session session, Vector items) Check the list of select items to see if any of them are aggregate
expressions. | public boolean | isUpdatable() Well, a bunch of things can prevent us from being updateable. | public String | name() | Cursor | optimizeAggregate(Session session, Cursor c, Vector items) Identify cases of MIN(column) or MAX(column) on indexed columns. | public int | rank() | public void | readExternal(ObjectInput in) | TableExpression | scheduleJoin() Cross-join multiple tables in 'from' clause.
TODO:
First, tables which have selection constraintsfind pairs
of tables that have candidate join columns and greedily join
them. | public void | setDistinct(boolean b) | public void | setFrom(Vector v) | public void | setGroupBy(Vector v) | public void | setHaving(Expression e) | public void | setItems(Vector v) | final public static void | showCursor(Cursor c) | public static void | showCursor(Cursor c, boolean really) | Cursor | staticCursor(Session session, Cursor c, Vector items, Value v) Helper to create a cursor containing a single constant value. | public String | toString() | public void | visitSubExpressions(ExpressionVisitor ev) Expression implementation... | public void | writeExternal(ObjectOutput out) |
distinct | boolean distinct(Code) | | |
SelectExpression | public SelectExpression()(Code) | | Default constructor
|
SelectExpression | public SelectExpression(String tableName, Expression where)(Code) | | The typical 'select from table where' stuff
|
getBaseTables | public void getBaseTables(Vector v)(Code) | | Get the base tables that participate in this select expression
|
getCursor | public Cursor getCursor(Session session, Cursor cur) throws SQLException(Code) | | This is the main entry point to this madness. Our handling of
selects is fairly literal, and pretty brute force. Things work
much better if there are appropriate indexes to use based on the
query.....
|
getValue | public Value getValue(Session session, Cursor cur) throws SQLException(Code) | | Return the expression as a scalar value. We try. If there's only
a single column in the result, we just return the column's value for
the first row of the result. Otherwise, return ValueNull.
|
isAggregate | boolean isAggregate(Session session, Vector items) throws SQLException(Code) | | Check the list of select items to see if any of them are aggregate
expressions. (Side effect: set 'aggregates' variable.)
|
isUpdatable | public boolean isUpdatable()(Code) | | Well, a bunch of things can prevent us from being updateable.
Here are the ones we know about:
|
optimizeAggregate | Cursor optimizeAggregate(Session session, Cursor c, Vector items) throws SQLException(Code) | | Identify cases of MIN(column) or MAX(column) on indexed columns.
Compute the value directly and replace the index cursor with a
static cursor containing the value.
|
rank | public int rank()(Code) | | We're a table
|
scheduleJoin | TableExpression scheduleJoin() throws SQLException(Code) | | Cross-join multiple tables in 'from' clause.
TODO:
First, tables which have selection constraintsfind pairs
of tables that have candidate join columns and greedily join
them. Next, pick tables which have matching non-key join
columns and join them Finally, join all the rest.
|
setDistinct | public void setDistinct(boolean b)(Code) | | Set the DISTINCT flag
|
setFrom | public void setFrom(Vector v)(Code) | | Set the from list (a list of tables is implicitly joined)
|
setGroupBy | public void setGroupBy(Vector v)(Code) | | Set the GROUP BY clause as a list of names
|
setItems | public void setItems(Vector v)(Code) | | Set the select items (i.e., the colums returned from this select)
|
showCursor | final public static void showCursor(Cursor c)(Code) | | Display a cursor (under trace control)
|
showCursor | public static void showCursor(Cursor c, boolean really)(Code) | | Display c cursor (or not)
|
toString | public String toString()(Code) | | Return a string representation for debugging purposes
|
|
|