Automatic Query Code Generation for Diverse Storage Units
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current data querying methods require manual writing of query codes in specific languages for different storage units, leading to low efficiency due to the need for language learning and code writing for each query, especially when dealing with diverse storage units like Hadoop and Hive.
Innovation Solution
A method and apparatus that automatically describe attribute information of a target field in a language used by a query engine, allowing the engine to obtain corresponding data without manual code writing, utilizing languages like Microsoft (M) Language, R Language, Hive Query Language (HQL), or Structured Query Language (SQL).
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If manual query code writing is used for different storage units, then data can be queried with precise control, but the operation complexity and time consumption increase significantly
Solution Approach 1:
The system performs automatic language conversion and query code generation without requiring manual intervention. The conversion module automatically translates user intent into appropriate query languages (SQL, HQL, Pig Latin) based on the target storage unit type, eliminating the need for users to manually learn and write different query languages for different storage systems.
Solution Approach 2:
The patent introduces a conversion module as an intermediary between the user and the query engine. This module acts as a translator that converts user intent into language-specific query codes appropriate for different storage units, thereby simplifying the user's interaction while maintaining precise query capabilities across diverse storage systems.
2Adaptability or versatility
If manual query code writing is used for diverse storage units, then specific storage unit requirements can be met, but the time consumption and productivity decrease
Solution Approach 1:
The conversion module is designed to handle multiple storage unit types (relational databases, Hadoop, Hive, etc.) through a single unified interface. It automatically identifies the target storage unit type and selects the appropriate query language and conversion rules, enabling one system to serve multiple storage purposes without requiring separate manual coding for each type.
Solution Approach 2:
The system pre-establishes conversion rules and language mappings for different storage unit types. When a query is initiated, the conversion module quickly retrieves and applies the appropriate pre-configured rules for the target storage unit, eliminating the need for real-time analysis and manual code writing, thus significantly improving query efficiency.
3Reliability
If different query languages are used for different storage units, then each storage unit can be queried optimally, but the learning curve and operational difficulty increase
Solution Approach 1:
The conversion module serves as a language-agnostic intermediary that handles all language-specific complexities. Users interact with a unified interface that automatically translates their intent into the appropriate query language (SQL for relational databases, HQL for Hive, Pig Latin for Hadoop) based on the target storage unit, thereby maintaining query reliability while eliminating the need for users to learn multiple languages.
4Productivity
If automatic language conversion is implemented, then query efficiency improves, but the system complexity increases
Solution Approach 1:
The system is segmented into distinct functional modules: a user interface for receiving query intent, a conversion module for language translation, and a query engine for executing queries. The conversion module itself is further segmented into rule sets for different storage unit types. This modular segmentation manages system complexity by organizing functions into independent, manageable components with well-defined interfaces.
Data Source
AI summary
The embodiments of the present invention provide a method for processing information, comprising: obtaining attribute information about a target field; obtaining, according to the attribute information about the target field, attribute information about the target field described in a first language; and sending the attribute information about the target field described in the first language to a query engine using the first language, so that the query engine obtains, according to the attribute information about the target field described in the first language, data corresponding to the target field; and the embodiments of the present invention also provide an apparatus for processing information. According to the technical solutions provided in the embodiments of the present invention, attribute information about a target field being automatically described in a language can be realized, so as to improve the query efficiency of data.


