Showing posts with label hive view based on a table; hive table based on a view; hive view based on join; hive tables; hive CTAS;. Show all posts
Showing posts with label hive view based on a table; hive table based on a view; hive view based on join; hive tables; hive CTAS;. Show all posts

Wednesday, September 30, 2020

Can we create a table based on a view in HIve?

Can we create a table based on a view in Hive?

Yes, we can.!!

Let's create "View" by combining Emp and Dept tables.

-~ To create a view

CREATE VIEW Emp_View
AS
SELECT Ename, DName FROM Emp
INNER JOIN Dept ON Emp.DeptNo = Dept.DeptNo;

Now let's create the table based on the view.

CREATE TABLE EmpDept
AS
SELECT * FROM Emp_View;



Big Data & SQL

Hi Everybody, Please do visit my new blog that has much more information about Big Data and SQL. The site covers big data and almost all the...