Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

I will describe the necessary modifications from several stages of SQL compilation and parsing.

1.  Convert SQL String to SqlNode and Validate

During this stage, schema validation will be performed. Therefore, when before calling CalciteSchema the method getTable, the time in SqlSnapshot can  , The period  of SqlSnapshot should be parsed and converted to a long , which is then passed to FlinkSchematimestamp, We can generate a LongSchemaVersion  and generate a  SchemaSnapshot for the current Schema. Finally, catalogManager.getTable(Object object, long timestamp) is called to obtain the specified timestampget the table for the corresponding time.

2.  SqlNode To RelNode.

During this stage, schema validation will also be performed. It is necessary to parse the SqlSnapshot and obtain convert the corresponding peroid to a long value, which will be passed to FlinkSchematimestamp, then we should generate a LongSchemaVersion and generate a Schema Snapshot. Finally, catalogManager.getTable(Object, long timestamp) can obtain the table at the corresponding point in time.

...

Remove some validation logic. The early AS OF syntax was only applicable to temporal joins. Adding timetravel scenarios will remove some of the check items.time travel  support should remove 

4.  Convert RelNode to Transformation (Convert CommonExecTableSourceScan To Transformation)

...