Query Parser Error Recovery with Grammar-Based Statement Repair

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing query languages and translators struggle with identifying and correcting errors in database queries, particularly due to their complexity and the vast amount of information in databases, often providing limited feedback and handling errors on a case-by-case basis.

Innovation Solution

A system that performs automatic error recovery by determining and applying modifications to query language statements, using context-free grammars to identify and repair termination and scan errors, and providing on-the-fly error reporting and correction suggestions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If automatic error recovery techniques are employed to correct errors, then error correction capability is improved, but device complexity increases

Engineering Contradiction:
Improveerror correction capabilityVSAvoidparser complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The error recovery process is divided into distinct phases: lexical analysis phase, syntactic analysis phase, and semantic parsing phase. Each phase handles specific types of errors independently, allowing the system to recover from errors without requiring complete redesign of the entire parser. This segmentation reduces the complexity burden on any single component while improving overall error correction capability.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary lexical analysis to identify tokens and basic syntax errors before proceeding to syntactic analysis. By detecting and reporting lexical errors upfront, the parser can recover more efficiently without getting bogged down in complex syntactic ambiguities. This preliminary action allows the system to handle errors at the earliest possible stage, improving reliability without proportionally increasing complexity.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If comprehensive error handling is implemented, then error detection accuracy is improved, but computing resources increase

Engineering Contradiction:
Improveerror detection accuracyVSAvoidcomputing resources
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The parser implements partial error recovery by focusing computational resources on the most critical error types (lexical and syntactic errors) while using simpler heuristics for less common errors. The system performs comprehensive analysis only when necessary, such as when semantic errors are detected, rather than continuously applying full analysis to all input. This selective comprehensive action improves detection accuracy for important errors while reducing overall computing resource consumption.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The error recovery process operates in periodic cycles: lexical analysis, followed by optional syntactic analysis, then semantic parsing. The system periodically re-evaluates the query statement after each phase, allowing it to recover from errors at each stage without requiring continuous full-analysis computation. This periodic processing improves detection accuracy at each phase while managing computing resources through staged evaluation rather than continuous comprehensive analysis.

Inventive Principle:
Principle #19Periodic action

3Ease of operation

If detailed error feedback is provided to users, then ease of operation is improved, but loss of time increases

Engineering Contradiction:
Improveuser feedback understandingVSAvoiderror correction time
Core Design Contradiction:
Ease of operationVSLoss of time

Solution Approach 1:

The system provides feedback at multiple levels: lexical level (token identification), syntactic level (grammar rule violations), and semantic level (meaning-based errors). By providing detailed feedback at each level, users can understand the nature of errors and correct them more effectively. The feedback mechanism includes suggestions for corrections and explanations of why certain errors occurred, significantly improving ease of operation while the structured approach keeps time loss manageable.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

Error feedback is segmented by type and priority, allowing the system to present the most critical errors first and less critical errors second. Lexical errors are reported separately from syntactic and semantic errors, enabling users to address the most impactful issues first. This segmented feedback approach improves ease of operation by making error correction more systematic while minimizing time loss by prioritizing the most important corrections.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS12353452B2Automatic error recovery for parser
Publication Date: 2025.07.08 ORACLE INT CORP
  • US12353452B2 patent drawing
  • US12353452B2 patent drawing
  • US12353452B2 patent drawing

AI summary

Systems for repairing parse errors in query language statements are disclosed. In response to identifying one or more errors during parsing, a system can perform error recovery operations, including selecting a target sequence of parsable elements from candidate target sequences identified by a grammar. The operations can also include, determining a modification for the first sequence of elements including parsable elements corresponding to the target sequence. The operations can further include repairing first query by applying the modification to the first sequence. Additionally, the operations include generating error report, including information indicating the modifications that allowed parsing to succeed and suggested corrections.