MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / addJoin

Method addJoin

src/java/simpledb/optimizer/LogicalPlan.java:123–137  ·  view source on GitHub ↗

Add a join between two fields of two different tables. @param joinField1 The name of the first join field; this can be a fully qualified name (e.g., tableName.field or alias.field) or may be an unqualified unique field name. If the name is ambiguous or unknown, a ParsingException will be throw

( String joinField1, String joinField2, Predicate.Op pred)

Source from the content-addressed store, hash-verified

121 */
122
123 public void addJoin( String joinField1, String joinField2, Predicate.Op pred) throws ParsingException {
124 joinField1 = disambiguateName(joinField1);
125 joinField2 = disambiguateName(joinField2);
126 String table1Alias = joinField1.split("[.]")[0];
127 String table2Alias = joinField2.split("[.]")[0];
128 String pureField1 = joinField1.split("[.]")[1];
129 String pureField2 = joinField2.split("[.]")[1];
130
131 if (table1Alias.equals(table2Alias))
132 throw new ParsingException("Cannot join on two fields from same table");
133 LogicalJoinNode lj = new LogicalJoinNode(table1Alias,table2Alias,pureField1, pureField2, pred);
134 System.out.println("Added join between " + joinField1 + " and " + joinField2);
135 joins.add(lj);
136
137 }
138
139 /** Add a join between a field and a subquery.
140 * @param joinField1 The name of the first join field; this can

Callers 1

processExpressionMethod · 0.80

Calls 2

disambiguateNameMethod · 0.95
equalsMethod · 0.65

Tested by

no test coverage detected