Member since
06-04-2020
2
Posts
0
Kudos Received
0
Solutions
06-05-2020
04:49 AM
Hi, Complex types are generally used to aggregate the characteristics of an object, for example: Based on: https://impala.apache.org/docs/build/html/topics/impala_struct.html#struct type: current_address STRUCT <
street_address: STRUCT
<street_number: INT,
street_name: STRING,
street_type: STRING>,
country: STRING,
postal_code: STRING>
So now we have the 'current_address' attribute and its members grouped. This is not only organizational, but also has an impact on the performance of the processes related to this table. When you want to retrieve a data it can be done like this: SELECT id, name,
current_address.street_address.street_number,
current_address.street_address.street_name,
current_address.street_address.street_type,
current_address.country,
current_address.postal_code
FROM struct_demo; Despite the example they are giving, it refers to Apache Impala the concept is the same applied to Spark. Hope this helps.
... View more