Skip to content

Commit e733686

Browse files
committed
[SQL] Do not serialize as JSON the contents of constant collections
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
1 parent d5343c2 commit e733686

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/util/RelJsonWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public RelJsonWriter(JsonBuilder jsonBuilder,
6060
this.verbosity = verbosity;
6161
}
6262

63-
final Set<String> highVerbosity = Set.of("exprs", "aggs", "condition");
63+
final Set<String> highVerbosity = Set.of("exprs", "aggs", "condition", "tuples");
6464

6565
protected void explain_(RelNode rel, List<Pair<String, Object>> values) {
6666
Map<String, Object> map = this.jsonBuilder.map();

sql-to-dbsp-compiler/SQL-compiler/src/test/java/org/dbsp/sqlCompiler/compiler/sql/MetadataTests.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,4 +2134,17 @@ public void testSilenceWarning() {
21342134
CREATE VIEW V AS SELECT x FROM T;""");
21352135
Assert.assertEquals(0, cc.compiler.messages.messages.size());
21362136
}
2137+
2138+
@Test
2139+
public void issue5896() throws IOException, SQLException {
2140+
String sql = "CREATE VIEW v AS select cot(0)";
2141+
File file = createInputScript(sql);
2142+
File json = this.createTempJsonFile();
2143+
CompilerMessages msg = CompilerMain.execute(
2144+
"--dataflow", json.getPath(), "--noRust", file.getPath());
2145+
Assert.assertEquals(0, msg.exitCode);
2146+
ObjectMapper mapper = Utilities.deterministicObjectMapper();
2147+
JsonNode parsed = mapper.readTree(json);
2148+
Assert.assertNotNull(parsed);
2149+
}
21372150
}

0 commit comments

Comments
 (0)