You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2023/01/14 13:25:59 UTC

[GitHub] [calcite] libenchao commented on a diff in pull request #2932: [CALCITE-5304] RelJson should support RexSubQuery

libenchao commented on code in PR #2932:
URL: https://github.com/apache/calcite/pull/2932#discussion_r1070270379


##########
core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java:
##########
@@ -122,10 +127,32 @@ public RelJson withInputTranslator(InputTranslator inputTranslator) {
     return new RelJson(jsonBuilder, inputTranslator);
   }
 
+  /** Returns a RelJson with a given RelJsonReader. */
+  @SuppressWarnings("initialization.invalid.field.write.initialized")
+  public RelJson withRelJsonReader(@UnknownInitialization RelJsonReader relJsonReader) {
+    this.relJsonReader = relJsonReader;
+    return this;
+  }
+
+  /** Returns a RelJson with a given RelJsonWriter. */
+  @SuppressWarnings("initialization.invalid.field.write.initialized")
+  public RelJson withRelJsonWriter(@UnknownInitialization RelJsonWriter relJsonWriter) {
+    this.relJsonWriter = relJsonWriter;
+    return this;
+  }
+
   private JsonBuilder jsonBuilder() {
     return requireNonNull(jsonBuilder, "jsonBuilder");
   }
 
+  private RelJsonWriter relJsonWriter() {
+    return requireNonNull(relJsonWriter, "relJsonWriter");
+  }
+
+  private RelJsonReader relJsonReader() {

Review Comment:
   Because there is a `RelNode` in `RexSubQuery`, to serialize/deserialize a `RelNode`, we need to use `RelJsonWriter` and `RelJsonReader`.



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org