Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 07-09-2024 12:43 PM
Hi all - I am trying to create a Hive table from nested JSON parquet data. The problem is one object is dynamic and I want to store it as a string since it changes.
Example JSON:
Created 07-09-2024 02:26 PM
@Maicat Welcome to the Cloudera Community!
To help you get the best possible solution, I have tagged our Hive experts @caio_contente @cravani who may be able to assist you further.
Please keep us updated on your post, and we hope you find a satisfactory solution to your query.
Regards,
Diana Torres,Created 07-30-2024 08:19 AM
@Maicat You can not typecast array to the string. There are 2 ways you can use
1. Select the nth object of the array.
SELECT level5[0] AS first_genre FROM my_table;
WHere 0 is the first object
2. You can flatten it
SELECT column1 FROM my_table LATERAL VIEW explode(level5) genre_table AS level5;