- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to create partitioned view
Created on ‎03-12-2015 04:05 PM - edited ‎09-16-2022 02:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got a 'log' table which is currently partitioned by year, month and day. I'm looking to create a partitioned view on top of 'log' table but running into this error:
hive> CREATE VIEW log_view PARTITIONED ON (pagename,year,month,day) AS SELECT pagename year,month,day,uid,properties FROM log;
FAILED: SemanticException [Error 10093]: Rightmost columns in view output do not match PARTITIONED ON clause
~~
Whats the right way to create a partitioned views? I'm using Hive 0.13 in CDH 5.3.2.
Thanks!
Created ‎03-12-2015 04:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Created ‎03-12-2015 04:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, was a copy/paste error. I did have a comma between pagename and year but got the error I pasted.
Thanks!
Created ‎10-08-2018 12:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this:
hive> CREATE VIEW log_view PARTITIONED ON (pagename,year,month,day) AS SELECTuid,properties,pagename year,month,day FROM log;
Reason:
The column names used in the partition must be available at the end of view creation in the same order as mentioned in as partitions.
