Package edu.caltech.nanodb.commands
Class DumpTableCommand
- java.lang.Object
-
- edu.caltech.nanodb.commands.Command
-
- edu.caltech.nanodb.commands.DumpCommand
-
- edu.caltech.nanodb.commands.DumpTableCommand
-
public class DumpTableCommand extends DumpCommand
This command object represents a DUMP TABLE command issued against the database. DUMP TABLE commands are pretty simple, having a single form: DUMP TABLE ... [TO FILE ...] [FORMAT ...].
This command is effectively identical to SELECT * FROM tbl; with the results being output to console or a data file for analysis. The command is particularly helpful when the planner only implements
Planner.makeSimpleSelect(java.lang.String, edu.caltech.nanodb.expressions.Expression, java.util.List<edu.caltech.nanodb.queryast.SelectClause>)
; no planning is needed for this command to work.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.caltech.nanodb.commands.DumpCommand
DumpCommand.TupleExporter
-
Nested classes/interfaces inherited from class edu.caltech.nanodb.commands.Command
Command.Type
-
-
Constructor Summary
Constructors Constructor Description DumpTableCommand(java.lang.String tableName, java.lang.String fileName, java.lang.String format)
Constructs a new dump-table command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getTableName()
Get the name of the table to be dumped.protected PlanNode
prepareDumpPlan(NanoDBServer server)
java.lang.String
toString()
-
Methods inherited from class edu.caltech.nanodb.commands.DumpCommand
execute, getFilename, getFormat
-
Methods inherited from class edu.caltech.nanodb.commands.Command
getCommandType
-
-
-
-
Constructor Detail
-
DumpTableCommand
public DumpTableCommand(java.lang.String tableName, java.lang.String fileName, java.lang.String format)
Constructs a new dump-table command.- Parameters:
tableName
- the name of the table to dumpfileName
- the path and file to dump the data to. The console will be used if this is @code{null}.format
- the format to dump the data in- Throws:
java.lang.IllegalArgumentException
- if tableName is null.
-
-
Method Detail
-
getTableName
public java.lang.String getTableName()
Get the name of the table to be dumped.- Returns:
- the name of the table to dump
-
prepareDumpPlan
protected PlanNode prepareDumpPlan(NanoDBServer server)
- Specified by:
prepareDumpPlan
in classDumpCommand
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-