Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Master views with complex types

Master views with complex types

Explorer

 

I have a wide table with a lot of complex type from which I would like to create simpler views for end user convenience. Ideally these views would expose one or more structs unaltered from the more complex table that is backing the view. Operations, and renames could occur on the other scalar fields. See snippet below.

 

CREATE TABLE complex_table (
  scalar1 BIGINT,
  scalar2 BIGINT,
  struct1 STRUCT <f1: STRING, f2: BIGINT>,
  struct2 STRUCT <f1: STRING, f2: BIGINT>
)
STORED AS PARQUET;

 

CREATE VIEW simple_view AS SELECT scalar1*2 as my_field1, scalar2*4 as my_field2, struct1, struct2 FROM complex_table;

 

This is currently not possible since a view cannot include a struct column but have to expand the fields in the structs as scalars in order to use them. Could anyone comment on if this will hold true for all forseabale future or if intermediate results from inner selects would be allowed to contain structs the future?

 

Any alternative approaches are also welcome. The environment is Impala 2.3.0 in CDH5.5.1

 

Br,

Pettax

 

1 REPLY 1

Re: Master views with complex types

Explorer

After som digging I found IMPALA-2777.