US 12,321,361 B2
Unified structured and semi-structured data types in database systems
Xinzhu Cai, San Mateo, CA (US); Bowei Chen, San Bruno, CA (US); Prateek Gaur, San Jose, CA (US); Dmitry A. Lychagin, San Jose, CA (US); Muthunagappan Muthuraman, Sunnyvale, CA (US); Zhuo Peng, San Jose, CA (US); Mengran Wang, San Jose, CA (US); and Jiaqi Yan, Menlo Park, CA (US)
Assigned to Snowflake Inc., Bozeman, MT (US)
Filed by Snowflake Inc., Bozeman, MT (US)
Filed on Oct. 30, 2023, as Appl. No. 18/497,746.
Claims priority of provisional application 63/522,647, filed on Jun. 22, 2023.
Prior Publication US 2024/0427790 A1, Dec. 26, 2024
Int. Cl. G06F 16/20 (2019.01); G06F 16/25 (2019.01); G06F 16/835 (2019.01)
CPC G06F 16/254 (2019.01) [G06F 16/835 (2019.01)] 27 Claims
OG exemplary drawing
 
1. A system comprising:
at least one hardware processor; and
a memory storing instructions that cause the at least one hardware processor to perform operations comprising:
receiving a query, the query referencing a unified representation for structured type data and semi-structured type data, the unified representation being provided in storage and in memory during query processing, the unified representation comprising a set of structured type fields that include a set of semi-structured typed fields that enables type safety and enforcement for the set of structured type fields, and flexibility for the set of semi-structured typed fields in a same column, the unified representation in storage including type information for the semi-structured type data as part of the semi-structured type data, the unified representation being utilized for structured type data and semi-structured type data;
processing the query using the unified representation stored in the memory, the unified representation providing performance parity between structured type data and semi-structured type data;
receiving a set of code statements, the set of code statements including first code indicating a particular structured data type;
determining that the set of code statements includes a definition of content type for an array, an object, or a map;
determining that the set of code statements includes second code to perform a type conversion from the particular structured data type to a particular semi-structured data type; and
performing, using the second code, the type conversion from the particular structured data type to the particular semi-structured data type based at least in part on the definition of content type.