Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4804

Support Snapshot operator serialization and deserialization

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.33.0
    • None

    Description

      In my project, the dimension table has versions of the contents of the table. When I serialize the `Snapshot operator`, there are exceptions. Examples of exceptions can be reproduced as follows.

      // code placeholder
      @Test void testSnapshot() {
        // Equivalent SQL:
        //   SELECT *
        //   FROM products_temporal FOR SYSTEM_TIME AS OF TIMESTAMP '2011-07-20 12:34:56'
        final RelBuilder builder = RelBuilder.create(config().build());
        RelNode root =
            builder.scan("products_temporal")
                .snapshot(
                    builder.getRexBuilder().makeTimestampLiteral(
                        new TimestampString("2011-07-20 12:34:56"), 0))
                .build();
      
        RelJsonWriter jsonWriter = new RelJsonWriter();
        root.explain(jsonWriter);
        String relJson = jsonWriter.asString();
        String s = deserializeAndDumpToTextFormat(getSchema(root), relJson);
      }

      Exception:

      // code placeholder
      java.lang.RuntimeException: class does not have required constructor, class org.apache.calcite.rel.logical.LogicalSnapshot(RelInput)java.lang.RuntimeException: class does not have required constructor, class org.apache.calcite.rel.logical.LogicalSnapshot(RelInput)java.lang.RuntimeException: java.lang.RuntimeException: class does not have required constructor, class org.apache.calcite.rel.logical.LogicalSnapshot(RelInput) at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:193) at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:135) at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:153) at org.apache.calcite.test.RelBuilderTest.deserializeAndDump(RelBuilderTest.java:4005) at org.apache.calcite.test.RelBuilderTest.deserializeAndDumpToTextFormat(RelBuilderTest.java:3981)
      

      Attachments

        Issue Links

          Activity

            People

              jiajunbernoulli Jiajun Xie
              xzh_dz xzh_dz
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m