APISonar


org.apache.calcite.sql.SqlExplainFormat.JSON

> org > apache > calcite > sql > SqlExplainFormat > JSON
org APIs apache APIs calcite APIs sql APIs SqlExplainFormat APIs JSON APIs

Example 1
@Test public void testOverWithoutPartition() {
    // The rel stands for the sql of "select count(*) over (order by deptno) from EMP"
    final RelNode rel = mockCountOver("EMP", ImmutableList.of(), ImmutableList.of("DEPTNO"));
    String relJson = RelOptUtil.dumpPlan("", rel, SqlExplainFormat.JSON,
        SqlExplainLevel.EXPPLAN_ATTRIBUTES);
    String s = deserializeAndDumpToTextFormat(getSchema(rel), relJson);
    final String expected = ""
        + "LogicalProject($f0=[COUNT() OVER (ORDER BY $7 NULLS LAST ROWS"
        + " BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])\n"
        + "  LogicalTableScan(table=[[scott, EMP]])\n";
    assertThat(s, isLinux(expected));
  }