Support Questions
Find answers, ask questions, and share your expertise

Hive Create View as select problem

Highlighted

Hive Create View as select problem

New Contributor

Hi !

I have following select statement :

Снимок экрана 2019-10-24 в 15.45.23.png

I need help with the following :

 When I try to create a View using this select statement I'm getting the next result : 

   Снимок экрана 2019-10-24 в 15.51.13.png

So, view is created but result set is empty ...

Also, there is a difference between creating table as select and creating a view using the same select :

 

create table as selectcreate table as select

 

create view as selectcreate view as select

 

Please help if you have any suggestions.

6 REPLIES 6

Re: Hive Create View as select problem

Contributor

Hi @Algrach ,

 

Could you try this and tell me if it works ?

 

create view if not exists tdv.test_rus as select * from tdv.test_t_rus where c1 = '<the value>';

 

Best,

Helmi KHALIFA

 

Highlighted

Re: Hive Create View as select problem

New Contributor

@helmi_khalifa , Hi !

This statement works, but the result is the same  

Highlighted

Re: Hive Create View as select problem

Contributor

I just tried it and it works for me as you can see in the print screen  below:

 

hive_view.png

Are you sure that the table is not empty ?

 

Best,

Helmi 

Highlighted

Re: Hive Create View as select problem

New Contributor

a problem with non-English characters ...

Could you try to insert this word : "ИТОГО" into your test table and use it in create view statement ?

Thank's   

Highlighted

Re: Hive Create View as select problem

Contributor

Could you try on another table?

Looks like you have an encoding problem with these caracteres.

 

Best,

Helmi KHALIFA

Highlighted

Re: Hive Create View as select problem

New Contributor

Hive works in UTF-8 by default

Create table as select with this condition works well, but view cannot be created correctly with the same condition.