Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HIVE-1078. CREATE VIEW followup: CREATE OR REPLACE (Charles Chen via …
…jvs) git-svn-id: https://svn.apache.org/repos/asf/hive/trunk@1149727 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
John Sichi
committed
Jul 22, 2011
1 parent
cb2cf8f
commit 7366a5d
Showing
27 changed files
with
919 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Cannot add or drop partition columns with CREATE OR REPLACE VIEW if partitions currently exist (must specify partition columns) | ||
|
||
drop view v; | ||
create view v partitioned on (ds, hr) as select * from srcpart; | ||
alter view v add partition (ds='1',hr='2'); | ||
create or replace view v as select * from srcpart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Cannot add or drop partition columns with CREATE OR REPLACE VIEW if partitions currently exist | ||
|
||
drop view v; | ||
create view v partitioned on (ds, hr) as select * from srcpart; | ||
alter view v add partition (ds='1',hr='2'); | ||
create or replace view v partitioned on (hr) as select * from srcpart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- Existing table is not a view | ||
|
||
create or replace view src as select ds, hr from srcpart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- View must have at least one non-partition column. | ||
|
||
drop view v; | ||
create view v partitioned on (ds, hr) as select * from srcpart; | ||
create or replace view v partitioned on (ds, hr) as select ds, hr from srcpart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- Can't combine IF NOT EXISTS and OR REPLACE. | ||
|
||
drop view v; | ||
create view v partitioned on (ds, hr) as select * from srcpart; | ||
create or replace view if not exists v as select * from srcpart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- Can't update view to have an invalid definition | ||
|
||
drop view v; | ||
create view v partitioned on (ds, hr) as select * from srcpart; | ||
create or replace view v partitioned on (ds, hr) as blah; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Can't update view to have a view cycle (1) | ||
|
||
drop view v; | ||
create view v1 partitioned on (ds, hr) as select * from srcpart; | ||
create view v2 partitioned on (ds, hr) as select * from v1; | ||
create view v3 partitioned on (ds, hr) as select * from v2; | ||
create or replace view v1 partitioned on (ds, hr) as select * from v3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- Can't update view to have a view cycle (2) | ||
|
||
drop view v; | ||
create view v1 partitioned on (ds, hr) as select * from srcpart; | ||
create or replace view v1 partitioned on (ds, hr) as select * from v1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- Can't have recursive views | ||
|
||
drop table t; | ||
drop view r0; | ||
drop view r1; | ||
drop view r2; | ||
drop view r3; | ||
create table t (id int); | ||
create view r0 as select * from t; | ||
create view r1 as select * from r0; | ||
create view r2 as select * from r1; | ||
create view r3 as select * from r2; | ||
drop view r0; | ||
alter view r3 rename to r0; | ||
select * from r0; |
Oops, something went wrong.