Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to create a view with IMPALA including a query option

avatar
New Contributor

Hello! I am creating a view `view_business` with IMPALA: since the source table `table_a` is a parquet formatted table with complex data types such as array and struct, I have to always run an query option statement "SET PARQUET_ARRAY_RESOLUTION=TWO_LEVEL_THEN_THREE_LEVEL" to load the arrays; otherwise those array columns are showing NULL value. 

DROP VIEW IF EXISTS discovery_database.view_business;
SET PARQUET_ARRAY_RESOLUTION=TWO_LEVEL_THEN_THREE_LEVEL;
CREATE VIEW discovery_database.view_business AS (
  SELECT * FROM table_a
)

Once the view is created, if I want to query the view, I still need to run the query option statement first as follows: 

SET PARQUET_ARRAY_RESOLUTION=TWO_LEVEL_THEN_THREE_LEVEL; 
SELECT * FROM discovery_database.view_business

However, the query option statement above is not supported in ODBC connector when I tried to use the statements above to link the curated table `view_business` as a data source in a power BI report. 

 

My question is: is it possible to create a view INCLUDING the query option statement "SET PARQUET_ARRAY_RESOLUTION=TWO_LEVEL_THEN_THREE_LEVEL", so every time when I query the view, I don't need to run this statement any more?

 

Thank you very much in advance!

 

Please note that IMPALA does not support scheduled query (to create a table instead a view). I also don't have a access right to create a scheduled query with HIVE in the HUE console. Therefore, creating a table with scheduled query cannot be the solution... 

 

 

 

1 ACCEPTED SOLUTION

avatar
Master Collaborator

Hi, I do not think we have such option to create a view along with query option, you can follow any one of below:

> Set the query option at session level before running the query.

> Add this query option globally in impala configurations -> "default_query_options" section.

> Add it in impala admission control pool for a specific pool where this query runs, edit the pool and add the property into "Default query options" section.

 

Regards,

Chethan YM

 

 

View solution in original post

2 REPLIES 2

avatar
Master Collaborator

Hi, I do not think we have such option to create a view along with query option, you can follow any one of below:

> Set the query option at session level before running the query.

> Add this query option globally in impala configurations -> "default_query_options" section.

> Add it in impala admission control pool for a specific pool where this query runs, edit the pool and add the property into "Default query options" section.

 

Regards,

Chethan YM

 

 

avatar
Community Manager

@tsunamisabelladid the responses from @ChethanYM  assist you in resolving your concerns? If so, could you kindly designate the most suitable response as the solution? This will be beneficial for other members who might come across a similar issue.

 



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: