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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]