Support Questions
Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

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

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

 

New Contributor

@helmi_khalifa , Hi !

This statement works, but the result is the same  

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 

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   

Contributor

Could you try on another table?

Looks like you have an encoding problem with these caracteres.

 

Best,

Helmi KHALIFA

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.