You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Chunwei Lei (Jira)" <ji...@apache.org> on 2021/11/18 09:04:00 UTC

[jira] [Created] (CALCITE-4893) JsonParseException happens when externalizing expressions with escape character from JSON

Chunwei Lei created CALCITE-4893:
------------------------------------

             Summary: JsonParseException happens when externalizing expressions with escape character from JSON
                 Key: CALCITE-4893
                 URL: https://issues.apache.org/jira/browse/CALCITE-4893
             Project: Calcite
          Issue Type: Bug
            Reporter: Chunwei Lei
            Assignee: Chunwei Lei


The following test can reproduce the error.
{code:java}
// RelWriterTest.java
@Test void testEscapeCharacter() {
  final FrameworkConfig config = RelBuilderTest.config().build();
  final RelBuilder builder = RelBuilder.create(config);
  final RelNode rel = builder
      .scan("EMP")
      .project(
          builder.call(new MockSqlOperatorTable.SplitFunction(),
              builder.field("ENAME"), builder.literal("\r")))
      .build();
  final String relJson = RelOptUtil.dumpPlan("", rel,
      SqlExplainFormat.JSON, SqlExplainLevel.EXPPLAN_ATTRIBUTES);
  final String s = deserializeAndDumpToTextFormat(getSchema(rel), relJson);
  final String expected = ""
      + "LogicalProject($f0=[SPLIT($1, '\r')])\n"
      + "  LogicalTableScan(table=[[scott, EMP]])\n";
  assertThat(s, isLinux(expected));
} {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)