It substitutes a named data set for a table.
We added it to support SQLstream, a streaming SQL system. When developing
streaming queries, it was sometimes convenient to substitute a table for a
stream, because the table had predictable results and didn’t need another
process inserting the rows.
I don’t t think anyone is using this functionality, so in a dev branch [1] I
plan to remove the feature. See the commit 'Refactor: Remove TABLESAMPLE
SUBSTITUTE('name’)’.
Julian
[1]
https://github.com/apache/calcite/compare/main...julianhyde:calcite:xxxx-blackboard
> On Aug 8, 2023, at 4:27 AM, LakeShen <[email protected]> wrote:
>
> Hi all,
>
> Currently I see tablesample substitute('medium') in calcite's parser.jj
> file and some single tests, but I looked at the tablesample documentation
> for Postgresql and some other databases, Not seeing this SQL syntax, I was
> wondering what exactly tablesample substitute('medium') means?
> At the same time,consider the following SQL:
> select * from product TABLESAMPLE SUBSTITUTE('medium') After the SqlNode to
> RelNode, it also loses the TABLESAMPLE SUBSTITUTE('medium') information.
> Best, LakeShen