Re: ViewTableMacro and empty parameteters

2018-10-23 Thread ptr.bo...@gmail.com
Thanks for explanation :) I've implemented the thing already for my needs - the only difference from TableViewMacro is that I create relational tree just on Table/Function creation to know dynamic parameter types (BasicSqlType), converting them to Java types and then passing through Function.getPa

Re: ViewTableMacro and empty parameteters

2018-10-22 Thread Stamatis Zampetakis
Below a few interesting pointers to the literature. Parameterized views are known as templates with binding patterns [1], views with access patterns [2]. There are many proposals and algorithms around these notions. I don't know if it is relevant to bring any of it into Calcite. Best, Stamatis [

Re: ViewTableMacro and empty parameteters

2018-10-22 Thread Julian Hyde
It’s a need idea, and it could easily be done by a table macro. I just wouldn’t call it a “view” anymore, because SQL views do not take parameters, and as you can see, the syntax to call is now table function syntax rather than view syntax. I like the idea of parameterized views. For instance a

ViewTableMacro and empty parameteters

2018-10-22 Thread ptr.bo...@gmail.com
Hello dear Calcite team :) I have one design question on ViewTableMacro: Why does it not implement parameters? I was thinking about dynamic parameters "?" here. For example, following view with dynamic parameters some_view: SELECT * FROM some_table WHERE id > ? AND LIMIT ? could handle two param