methods (such as join() , select() , etc.) and then call execute to generate a query plan
for the query and get back an iterator over the resulting data set (which is not fully materialized:
the iterator generates each tuple as requested). The current implementation of execute simply
calls executeNaive , which joins tables in the order given; your task in Part 2 will be to
generate better query plans.
SelectPredicate
SelectPredicate is a helper class inside of QueryPlan.java that stores information about that
selection predicates that the user has applied, for example someTable.col1 < 186 . A select
predicate has four values that you can access:
tableName and columnName specify which column the predicate applies to
operator represents the type of operator being used (for example < , <= , > , etc…)
value is a DataBox containing a constant value that the column should be evaluated
against (in the above example, 186 would be the value).
All of the select predicates for the query are stored inside the selectPredicates instance variable.
JoinPredicate
JoinPredicate is a helper class insode of QueryPlan.java that stores information about the
conditions on which tables are joined together, for example: leftTable.leftColumn =
rightTable.rightColumn . All joins in RookieDB are equijoins. JoinPredicates have five
values:
joinTable : the name of one of the table’s being joined in. Only used for toString()
leftTable : the name of the table on the left side of the equality
leftColumn : the name of the column on the left side of the equality
rightTable : the name of the table on the right side of the equality
rightColumn : The name of the column on the right side of the equality
All of the join predicates for the query are stored inside of the joinPredicates instance variable.
Interface for querying
You should read through the Database.java section of the and browse
through examples in
to familiarize yourself with how queries are written in our database
main overview
src/test/java/edu/berkeley/cs186/database/TestDatabase.
java
CS186 Projects
Cookies
This site uses cookies to deliver its service and to analyse traffic. By browsing this site, you accept
our cookie policy.
Reject all
https://cs186.gitbook.io/project/#database-java
https://github.com/berkeley-cs186/fa21-rookiedb/blob/master/src/test/java/edu/berkeley/cs186/database/TestDatabase.java
https://cs186.gitbook.io/project/
https://policies.gitbook.com/privacy/cookies