简体   繁体   中英

Is it possible to store 2 different struct types in the same column of a data bricks delta table?

I'm receiving multiple XML files that need to be loaded into one table. Those XML files have different struct types for a particular column. I'm wondering if somehow this column could be stored in the same column of a data bricks table. please refer below for the different struct types I'm getting for the same column col1. In file1 col1 is struct and col1a is struct and col1a1, col1a2..are string types for file2 same col1 is a struct type but underlying col1b and col1c are string types.

file1: col1 col1a col1a1 col1a2. . col1b

file2: col1 col1b col1c

Read the two xmls saperatly then convert the data type of the 2 col to string or struct depending on your choice for respective dataframes.Finally do a union on the two data frames.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM