-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
213 changed files
with
34,251 additions
and
866 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,3 +170,8 @@ hs_err_pid* | |
|
||
/src/test/resources/vitess_env/build_vitess/ | ||
dependency-reduced-pom.xml | ||
|
||
|
||
# vscode | ||
|
||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
Copyright 2023 JD Project Authors. Licensed under Apache-2.0. | ||
Copyright 2022 The Vitess Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package com.jd.jdbc.context; | ||
|
||
import com.jd.jdbc.planbuilder.semantics.SemTable; | ||
import com.jd.jdbc.planbuilder.semantics.VSchema; | ||
import com.jd.jdbc.sqlparser.ast.SQLExpr; | ||
import com.jd.jdbc.vindexes.VKeyspace; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class PlanningContext { | ||
|
||
private Object reservedVars; | ||
|
||
private SemTable semTable; | ||
|
||
private VKeyspace keyspace; | ||
|
||
private VSchema vschema; | ||
|
||
// here we add all predicates that were created because of a join condition | ||
// e.g. [FROM tblA JOIN tblB ON a.colA = b.colB] will be rewritten to [FROM tblB WHERE :a_colA = b.colB], | ||
// if we assume that tblB is on the RHS of the join. This last predicate in the WHERE clause is added to the | ||
// map below | ||
|
||
private Map<SQLExpr, List<SQLExpr>> joinPredicates; | ||
|
||
private Map<SQLExpr, Object> skipPredicates; | ||
|
||
private boolean rewriteDerivedExpr; | ||
|
||
public PlanningContext(Object reservedVars, SemTable semTable, VSchema vschema, VKeyspace keyspace) { | ||
this.reservedVars = reservedVars; | ||
this.semTable = semTable; | ||
this.vschema = vschema; | ||
this.keyspace = keyspace; | ||
this.skipPredicates = new HashMap<>(); | ||
this.joinPredicates = new HashMap<>(); | ||
this.rewriteDerivedExpr = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.