Automatic Scala Code Generation for Data Lake Transformation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing data transformation solutions lack flexibility to handle a wide variety of data formats and are inefficient for large data volumes, especially when transitioning data from a data lake to a data warehouse.

Innovation Solution

Automatically generate Scala Spark computer code using transformation frameworks that process data transformation rules from spreadsheets, SQL scripts, or semi-structured text documents to convert data from a data lake into a structured format suitable for a data warehouse.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If manual code generation is used for data transformation, then flexibility to handle different data formats is maintained, but productivity and efficiency are low

Engineering Contradiction:
Improvedata transformation efficiencyVSAvoidflexibility to handle different data formats
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The patent uses templates to generate transformation code automatically. Instead of manually writing code for each transformation, pre-defined templates are copied and adapted based on the source and target data formats, enabling high productivity while maintaining flexibility through template customization.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The system allows dynamic configuration of transformation parameters through metadata and mapping files. By changing parameters in configuration files rather than rewriting code, the system adapts to different data formats efficiently, resolving the contradiction between productivity and adaptability.

Inventive Principle:
Principle #35Parameter changes

2Productivity

If custom transformation code is written for each data format, then handling of large data volumes becomes inefficient, but adaptability to different formats is achieved

Engineering Contradiction:
Improvetransformation speed for large data volumesVSAvoidcomplexity of transformation solution
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent implements a universal transformation framework that can handle multiple data formats through a single codebase. The framework uses format-agnostic transformation logic combined with format-specific configuration, allowing it to process large volumes of diverse data efficiently without requiring separate custom code for each format.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The system introduces an intermediary layer consisting of mapping files and metadata that mediate between source and target formats. This intermediary approach allows the core transformation engine to remain simple and efficient while handling complexity through configuration rather than complex code structures.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If automated code generation is implemented, then productivity increases with 5-10× efficiency gains, but complexity of the transformation framework increases

Engineering Contradiction:
Improvecode generation efficiencyVSAvoidcomplexity of transformation framework
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The transformation framework is segmented into distinct modular components: code generation engine, template system, metadata parser, and execution engine. This segmentation allows each component to be independently developed and maintained, reducing overall framework complexity while enabling automated code generation that delivers 5-10× productivity improvements.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS12578929B2Method and system for performing automatic source code generation for use in a data transformation process
Publication Date: 2026.03.17 ROYAL BANK OF CANADA
  • US12578929B2 patent drawing
  • US12578929B2 patent drawing
  • US12578929B2 patent drawing

AI summary

Methods, systems, and techniques for performing automatic source code generation for use in a data transformation process. A computer obtains a data file comprising data transformation rules. Using those rules, the computer automatically generates computer source code for use in a data transformation process to transform source data into target data. The source data may, for example, be raw data from a data lake, and the computer source code may be Scala computer code for execution within an Apache Spark™ framework. The data lake may execute the computer source code to transform the raw data stored in the data lake into the target data, and the target data may then be stored in the data warehouse.