SQL Graph Parsing for Target-Field Logic Extraction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The complexity of Structured Query Language (SQL) processing makes it challenging to determine the processing logic for fields related to data lakes and data warehouses.

Innovation Solution

A method involving parse processing to convert SQL into a graphic representation, cropping the graphic representation to focus on a target field, and performing inverse parse processing to obtain the corresponding SQL, utilizing tools like Apache Calcite for syntax tree conversion and custom visualization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If SQL is processed to extract processing logic for target fields, then extraction accuracy is improved, but the complexity of SQL processing increases

Engineering Contradiction:
Improveextraction accuracyVSAvoidSQL processing complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments the SQL processing into distinct phases: parsing phase (converting SQL to abstract syntax tree), graphic representation phase (converting AST to visual graph), cropping phase (extracting target field information), and inverse parsing phase (converting back to SQL). This segmentation allows complex processing to be broken down into manageable steps, improving accuracy while maintaining processability.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary graphic representation layer between the SQL statement and the target field extraction. This intermediate graphic representation (visual graph showing execution process) serves as a mediator that simplifies the complex SQL structure into an easily analyzable format, enabling accurate extraction without directly processing complex SQL logic.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If the graphic representation is cropped to focus on target field, then extraction efficiency is improved, but information loss may occur

Engineering Contradiction:
Improveextraction efficiencyVSAvoidprocessing logic information
Core Design Contradiction:
ProductivityVSLoss of information

Solution Approach 1:

The patent extracts only the necessary information related to the target field from the complete graphic representation. By identifying and isolating the specific portion of the execution process that pertains to the target field, the system achieves efficient extraction while maintaining completeness of the extracted information through the inverse parsing step.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent employs inverse parsing to reverse the cropping process. After extracting the target field's graphic representation, the inverse parsing operation reconstructs the complete processing logic by working backwards from the simplified representation, ensuring no information is lost and recovering the full SQL logic for the target field.

Inventive Principle:
Principle #13The other way round (Inversion)

3Ease of operation

If parse processing is performed to convert SQL to graphic representation, then processing logic becomes clearer, but processing time increases

Engineering Contradiction:
Improveprocessing logic clarityVSAvoidprocessing time
Core Design Contradiction:
Ease of operationVSLoss of time

Solution Approach 1:

The patent performs parse processing and graphic representation conversion as preliminary actions before the actual target field extraction. By pre-converting the SQL into a visual graphic representation, the system prepares the data in an easily analyzable format, making the subsequent extraction process faster and more efficient despite the initial time cost.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20250284684A1SQL processing method and apparatus, device, medium, and product
Publication Date: 2025.09.11 BEIJING VOLCANO ENGINE TECH CO LTD
  • US20250284684A1 patent drawing
  • US20250284684A1 patent drawing
  • US20250284684A1 patent drawing

AI summary

The present application discloses a SQL processing method, an apparatus, a device, a medium and a product. The method includes: after a SQL to-be-processed is acquired, performing parse processing on the SQL to-be-processed to obtain a graphic representation corresponding to the SQL to-be-processed, so that the graphic representation is used for describing an execution process of the SQL to-be-processed; then, when the execution process includes processing logic of at least one candidate field and the at least one candidate field includes a target field, cropping a graphic representation corresponding to the target field from the graphic representation corresponding to the SQL to-be-processed, so that the graphic representation corresponding to the target field is used for describing the processing logic of the target field; finally, performing inverse parse processing on the graphic representation corresponding to the target field to obtain a SQL corresponding to the target field.