Class SelectCommand


  • public class SelectCommand
    extends QueryCommand
    This command object represents a top-level SELECT command issued against the database. The query itself is represented by the SelectClause class, particularly because a SELECT statement can itself contain other SELECT statements.
    See Also:
    SelectClause
    • Field Detail

      • logger

        private static org.apache.logging.log4j.Logger logger
        A logging object for reporting anything interesting that happens.
      • selClause

        private SelectClause selClause
        This object contains all the details of the top-level select clause, including any subqueries, that is going to be evaluated.
    • Constructor Detail

      • SelectCommand

        public SelectCommand​(SelectClause selClause)
    • Method Detail

      • getSelectClause

        public SelectClause getSelectClause()
        Returns the root select-clause for this select command.
        Returns:
        the root select-clause for this select command
      • prepareQueryPlan

        protected void prepareQueryPlan​(NanoDBServer server)
        Prepares the SELECT statement for evaluation by analyzing the schema details of the statement, and then preparing an execution plan for the statement.
        Specified by:
        prepareQueryPlan in class QueryCommand
        Parameters:
        server - the server to use for planning, fetching table schemas, statistics, and other details relevant for planning
      • setTupleProcessor

        public void setTupleProcessor​(TupleProcessor tupleProcessor)
      • getTupleProcessor

        protected TupleProcessor getTupleProcessor​(EventDispatcher eventDispatcher)
        Description copied from class: QueryCommand
        Creates a tuple-processor responsible for dealing with the tuples that are generated by the query command. Depending on the operation being performed, different tuple-processors are appropriate. For example, the SELECT processor sends the tuples to the console or to a remote client; the DELETE processor deletes the tuples from the referenced table.
        Specified by:
        getTupleProcessor in class QueryCommand
        Parameters:
        eventDispatcher - used for notifying other components in the database when rows are inserted/updated/deleted
        Returns:
        the tuple processor to use in processing tuples generated by the query
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object