zstan commented on code in PR #6593:
URL: https://github.com/apache/ignite-3/pull/6593#discussion_r2405703237
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/PrepareServiceImpl.java:
##########
@@ -984,4 +1306,87 @@ boolean matches() {
return matches;
}
}
+
+ static class PlanningContextState {
+ private final Int2ObjectMap<Object> parameters;
+
+ PlanningContextState(
+ Int2ObjectMap<Object> parameters
+ ) {
+ this.parameters = parameters;
+ }
+
+ Int2ObjectMap<Object> parameters() {
+ return parameters;
+ }
+
+ /** Get context builder. */
+ public static PlanningContextState.Builder builder() {
+ return new PlanningContextState.Builder();
+ }
+
+ public static class Builder {
+ private Int2ObjectMap<Object> parameters;
+
+ /** Values of dynamic parameters to assist with type inference. */
+ PlanningContextState.Builder parameters(Int2ObjectMap<Object>
parameters) {
+ this.parameters = parameters;
+ return this;
+ }
+
+ /** Builds planner context state. */
+ PlanningContextState build() {
+ return new PlanningContextState(parameters);
+ }
+ }
+ }
+
+ static class PlanInfo {
+ private final QueryPlan queryPlan;
+ @Nullable private final ValidStatement<ValidationResult> statement;
+ @Nullable private final PlanningContextState context;
+ @Nullable private final SchemaPlus defaultSchema;
+ private final IntSet sources;
+ private volatile boolean needToInvalidate;
+
+ private PlanInfo(
+ QueryPlan plan,
+ @Nullable ValidStatement<ValidationResult> statement,
+ @Nullable PlanningContextState context,
+ @Nullable SchemaPlus defaultSchema,
Review Comment:
it`s possible of course but for what purpose ? current cached is hold two
String and one reference in implementation, i mean:
RelOptTableImpl.MySchemaPlus, let`s do it if necessary in different one plz ?
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/CacheKey.java:
##########
@@ -51,14 +52,29 @@ public class CacheKey {
* LOCAL flag)
* @param paramTypes Types of all dynamic parameters, no any type can be
{@code null}.
*/
- public CacheKey(int catalogVersion, String schemaName, String query,
Object contextKey, ColumnType[] paramTypes) {
+ public CacheKey(
+ int catalogVersion,
+ String schemaName,
+ String query,
+ Object contextKey,
+ ColumnType[] paramTypes,
+ SchemaPlus defaultSchema
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]