yanlin-Lynn commented on a change in pull request #2110:
URL: https://github.com/apache/calcite/pull/2110#discussion_r473703312
##########
File path: core/src/test/java/org/apache/calcite/plan/RelWriterTest.java
##########
@@ -1131,6 +1132,36 @@ private RelNode mockCountOver(String table,
assertThat(s, isLinux(expected));
}
+ @Test void testDeserializeInvalidOperatorName() {
+ final FrameworkConfig config = RelBuilderTest.config().build();
+ final RelBuilder builder = RelBuilder.create(config);
+ final RelNode rel = builder
+ .scan("EMP")
+ .project(
+ builder.field("JOB"),
+ builder.field("SAL"))
+ .aggregate(
+ builder.groupKey("JOB"),
+ builder.max("max_sal", builder.field("SAL")),
+ builder.min("min_sal", builder.field("SAL")))
+ .project(
+ builder.field("max_sal"),
+ builder.field("min_sal"))
+ .build();
+ final RelJsonWriter jsonWriter = new RelJsonWriter();
+ rel.explain(jsonWriter);
+ // mock a non exist SqlOperator
+ String relJson = jsonWriter.asString().replace("\"name\": \"MAX\"",
"\"name\": \"MAXS\"");
+ try {
+ deserializeAndDumpToTextFormat(getSchema(rel), relJson);
+ fail();
+ } catch (Exception e) {
Review comment:
Sure, I'll update
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]