Attributes in Code Generation
How active polymorphic versions become SQL columns in Dynamic Tables, including transformation application and array table generation.
Dynamic Table Column Generation
For each active polymorphic version, DataPancake generates a column in the Dynamic Table following this process:
Example: Column Generation
For attribute customer.email with polymorphic version email_string:
Configuration:
Data Platform Data Type:
VARCHAR(255)Transformation Type:
No TransformationNull Value Expression:
COALESCE({attribute_name}, '[email protected]')Alias Name:
customer_email
Generated SQL:
COALESCE(json_data:"customer"."email"::VARCHAR(255), '[email protected]') AS customer_emailWith Transformation Expression:
If transformation type is 'SQL Expression' with:
Transformation Expression:
UPPER({attribute_name})
Generated SQL:
Array Table Generation
For array attributes, DataPancake generates separate tables.
Object Arrays
Primitive Arrays
May be stored as VARIANT or array types in root table
Or flattened into separate table depending on configuration
Array primitive type determines element handling
ITDCs (Immutable Typed Derived Columns)
DataPancake uses ITDCs (Immutable Typed Derived Columns) in generated SQL to prevent technical debt.
Characteristics:
Type-safe column definitions
Explicit type casting
No implicit conversions
Prevents future breaking changes
Example:
Code Generation Process Flow
Metadata Tracking
DataPancake can generate metadata tracking objects:
Streams:
Tracks changes to Dynamic Tables
Enables change data capture
Tasks:
Scheduled jobs for metadata synchronization
Updates metadata tables
Metadata Tables:
Track insert and last updated datetime
Monitor Dynamic Table changes
Support audit and compliance
Last updated
Was this helpful?