Phoenix view 视图注意事项: 一个view只能由一个table创建

测试结果:

    1. 只能使用一个select, 下一个select会提示结束符, 也就是不能有子查询

    2. 且不能出现括号 ( , 有括号会提示语法错误

测试结果表明: 一个view只能通过一个table表创建

现在是2018年4月24日, 测试环境Phoenix 4.8, 这个问题官网说正在解决

Phoenix官网view介绍

Limitations

Views have the following restrictions:

  1. An INDEX over a VIEW is only maintained if the updates are made through the VIEW. Updates made through the underlying TABLE or the parent VIEW will not be reflected in the index (PHOENIX-1499).
  2. A primary key column may not be added to a VIEW when its base table has a primary key constraint that ends with a variable length column (PHOENIX-2157).
  3. A VIEW may be defined over only a single table through a simple SELECT * query. You may not create a VIEW over multiple, joined tables nor over aggregations (PHOENIX-1505PHOENIX-1506).
  4. When a column is added to a VIEW, the new column will not be automatically added to any child VIEWs (PHOENIX-2054). The workaround is to manually add the column to the child VIEWs.
  5. All columns must be projected into a VIEW when it’s created (i.e. only CREATE VIEW … AS SELECT * is supported). Note, however, you may drop non primary key columns inherited from the base table in a VIEW after it is created through the ALTER VIEW command. Providing a subset of columns and or expressions in the SELECT clause will be supported in a future release (PHOENIX-1507).


谷歌翻译

限制

视图有以下限制:

  1. 只有通过VIEW进行更新时,才能维护VIEW上的INDEX。通过底层TABLE或父VIEW进行的更新不会反映在索引(PHOENIX-1499)中。
  2. 如果主键列的主键约束以可变长度列(PHOENIX-2157结尾,则主键列不能添加到VIEW中
  3. VIEW可以通过简单的SELECT *查询仅在单个表上定义。您不能在多个连接的表格或聚合(PHOENIX-1505PHOENIX-1506)上创建VIEW 
  4. 当一个列添加到VIEW时,新列不会自动添加到任何子视图(PHOENIX-2054)。解决方法是手动将该列添加到子视图。
  5. 所有列在创建时都必须投影到VIEW中(即仅支持CREATE VIEW ... AS SELECT *)。但是,请注意,在通过ALTER VIEW命令创建后,您可以在VIEW中删除从基表继承的非主键列。在未来的版本(PHOENIX-1507)中支持在SELECT子句中提供列和或表达式的子集


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值