postgresql - 通过方解石在 postgres 中创建物化 View

标签 postgresql apache-calcite

我想将 postgres 设置为 calcite 的数据源,并利用 calcite 的能力使用物化 View 重写查询。但是,当我尝试通过方解石创建物化 View 时,我收到有关插入不存在的关系的 postgres 错误。

经过进一步检查,方解石似乎从未创建物化 View ,而只是将查询转换为“插入”命令并将其发送到 postgres(失败,因为我最初想创建此 View )。

所以我的问题是:我应该如何在 postgres 上通过方解石创建物化 View ?

(我也在邮件列表上问过这个问题,不过发在这里似乎更合适)

最佳答案

也许解决方案是定义Lattices在定义架构并让 Calcite 为您创建物化 View 时。

当您在模式定义中定义物化 View 时,Calcite 只是假设您已经在 Postgres 中创建了它并且它可以自由使用它。这就是它使 insert into 语句的原因。

关于postgresql - 通过方解石在 postgres 中创建物化 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55629896/

相关文章:

ruby-on-rails - rails : must appear in the GROUP BY clause or be used in an aggregate function

postgresql - 在 Postgres 中的物化 View 上创建主键

java - Apache 方解石 : Convert a SQL parse tree into a tree of relational expressions WITHOUT validation

apache-calcite - 如何避免方解石在内存中进行聚合

sql - 如何计算 varchar 字段中的每个字符?

sql - PostgreSQL 无法聚合来自多个表的数据

postgresql - 有没有办法用 postgres 导入索引文件?

elasticsearch - 行类型为_MAP时,从表中选择方解石选择计数(intCol)(elasticsearch示例)

java - preparedStatement.getString() 方法不适用于嵌套 sql 查询

java - 如何在 Apache Calcite 中格式化日期字段?