[
https://issues.apache.org/jira/browse/PHOENIX-1505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16053023#comment-16053023
]
Julian Hyde commented on PHOENIX-1505:
--------------------------------------
I agree you have to track dependencies. A table or view can have 0 or more
dependencies that reference it and need to be re-compiled (or re-validated) if
that table or view is changed. If a view can reference multiple tables, then
the dependency graph becomes a DAG, not a hierarchy.
Having a dependencies table (dependency_object_id, dependent_object_id) is
pretty typical in DBMSs I've seen.
Yes, a view can be derived from another view. I would make v2 depend on v1 so
that if v1 changes (e.g. if its underlying table changes) then transitively v2
will need to change.
Regarding the "select *" case. In LucidDB we chose a behavior that if you
defined "create view v as select * from t", and added a column to t, the view
would not acquire the column until you re-created the view. In other words, the
* is expanded at creation time. There are fewer surprises that way.
I see SPARK-18209 coming to similar conclusions.
> Support defining a VIEW over multiple tables
> --------------------------------------------
>
> Key: PHOENIX-1505
> URL: https://issues.apache.org/jira/browse/PHOENIX-1505
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: James Taylor
> Labels: SFDC
>
> Our current view implementation only supports views over a single table. We
> should enhance this to support creating a view over multiple tables. For
> example: CREATE VIEW v AS SELECT * FROM DEPT d, EMPL e WHERE d.dept_id =
> e.dept_id
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)