CN101710273B - Method and device for analyzing multi-dimensional query sentence in online analysis processing server - Google Patents

Method and device for analyzing multi-dimensional query sentence in online analysis processing server Download PDF

Info

Publication number
CN101710273B
CN101710273B CN 200910110280 CN200910110280A CN101710273B CN 101710273 B CN101710273 B CN 101710273B CN 200910110280 CN200910110280 CN 200910110280 CN 200910110280 A CN200910110280 A CN 200910110280A CN 101710273 B CN101710273 B CN 101710273B
Authority
CN
China
Prior art keywords
function
self
defining
type
defining function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN 200910110280
Other languages
Chinese (zh)
Other versions
CN101710273A (en
Inventor
林志贤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN 200910110280 priority Critical patent/CN101710273B/en
Publication of CN101710273A publication Critical patent/CN101710273A/en
Application granted granted Critical
Publication of CN101710273B publication Critical patent/CN101710273B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

The embodiment of the invention discloses a method and a device for analyzing a multi-dimensional query sentence in an online analysis processing server. The method comprises the following steps of: analyzing a multi-dimensional query sentence and generating a syntactic tree according to an analyzed result, wherein a node of the syntactic tree comprises a horizontal axis object, a longitudinal axis object, a slicing axis object, a calculating member object, a calculating unit object and a custom function CDF object; when a multi-dimensional query expression of various objects on the syntactictree is executed, if a function needs to be called, judging whether the function is a custom function or not according to a function definition of the custom function, if so, entering the executing process of the custom function; otherwise, judging whether the function is a standard function or not according to the function definition of a standard function; and if so, entering the executing process of a marking function. By the embodiment of the invention, the working efficiency of a developer in the development process of the whole OLAP system can be improved.

Description

The analytic method of multi-dimensional query statement and device in the on-line analytical processing server
Technical field
The present invention relates to technical field of data processing, particularly relate to analytic method and the device of multi-dimensional query statement in the on-line analysing processing system
Background technology
Usually, be that enterprise has brought new data management mode in Enterprise Resources Plan (ERP, Enterprise Recourse Planning) system.By ERP system, enterprise can use more efficiently, all kinds of resources of management enterprise.Store lot of data in the ERP database, the processing of data generally needs multilist operation and long working time, therefore need be in conjunction with on-line analytical processing (OLAP, Online Analytic Processing) system.The OLAP system mainly comprises multidimensional on-line analysing processing system (MOLAP, Multi Dimensional OLAP) and concerns on-line analysing processing system (ROLAP, Relational OLAP).The OLAP system utilizes the multi-dimensional query statement that constitutes based on multidimensional query language (MDX, Multi Dimensional Expression) that the multidimensional data in the multi-dimensional database is inquired about.MDX is the OLAP query facility of industrywide standard, except providing basic syntax, also provides more than 100 canonical function.
In the OLAP system, developed various olap servers, for example, SQLServer2000, SQLServer2005 and Hyperion Essbase.Wherein, SQLServer2000/2005 is not supported in self-defining function among the MDX, need be by means of other programming tools and platform, and as using the platform programming language VBA of Microsoft, VB, VC .NET, and will define the storehouse and be registered in the Windows system.The programming language of Microsoft's platform all needs to compile, and this has brought very big trouble for application of developer, causes the performance history inefficiency of whole OLAP system.Hyperion Essbase is foremost olap server in the world, can support the MDX language, but be not supported in and use self-defining function among the MDX, self-defining function also needs further to be realized by the MaxL script, this has brought very big trouble for equally application of developer, causes the performance history inefficiency of whole OLAP system.
To sum up, the technical matters that presses for solution in the prior art is: olap server is supported in the multi-dimensional query statement expands self-defining function, that is to say, be implemented in the olap server, have the multi-dimensional query statement of self-defining function to resolve to expansion.
Summary of the invention
In order to solve the problems of the technologies described above, the embodiment of the invention provides analytic method and the device of multi-dimensional query statement in a kind of on-line analysis system, to improve the developer in the work efficiency of the performance history of whole OLAP system.
The embodiment of the invention discloses following technical scheme:
The analytic method of multi-dimensional query statement in a kind of on-line analytical processing server, comprise: resolve the multi-dimensional query statement, set according to the analysis result generative grammar, wherein, the node of described syntax tree comprises transverse axis object, longitudinal axis object, slice axis object, calculates member object, computing unit object and self-defining function CDF object; The self-defining function among the member is calculated in definition, on carrying out described syntax tree during the multi-dimensional query expression formula of various objects, call function if desired, function definition according to self-defining function judges whether to be self-defining function earlier, if enter the self-defining function implementation, if not, function definition according to canonical function judges whether to be canonical function, if canonical function then enters the canonical function implementation.
Preferably, the function declaration of described self-defining function can realize according to following any-mode according to the with key word among the MDX: utilize With[script-type] Function[ReturnType] FunName (ArgType arg1, ArgType arg2) the multi-dimensional query expression formula function of as ' [Script] ', wherein, [script-type] represents script type, ReturnType represents the return parameters type of self-defining function, arg1 and arg2 represent the parameter of self-defining function, ArgType represents the parameter type of self-defining function, the function body of [Script] expression self-defining function, FunName represents the function name of self-defining function; Perhaps, utilize With[script-type] Function[ReturnType] FunName (Context ctx, ArgType arg1, ArgType arg2) the Multidimensional Expressions function of as ' [Script] ', wherein, the Context parameter is represented the execution context of self-defining function, [script-type] represents script type, ReturnType represents the return parameters type of self-defining function, arg1 and arg2 represent the parameter of self-defining function, ArgType represents the parameter type of self-defining function, the function body of [Script] expression self-defining function, and FunName represents the function name of self-defining function.
Preferably, described return parameters type comprises: integer, floating number, character string, boolean, date, member, set or dimension.
Preferably, described self-defining function implementation comprises: the multi-dimensional query expression formula of compiling self-defining function generates the Dynamic Java class; Call the generation method of described Dynamic Java class, import the parameter of self-defining function into, and return execution result.
Preferably, described method also comprises: when the type of the parameter of described self-defining function and execution result is different from type in the function, if satisfy the implicit type conversion rule, the parameter of described self-defining function and the type of execution result are carried out implicit type conversion.
The resolver of multi-dimensional query statement in a kind of on-line analytical processing server, comprise: resolution unit, be used for resolving the multi-dimensional query statement, set according to the analysis result generative grammar, wherein, the node of described syntax tree comprises transverse axis object, longitudinal axis object, slice axis object, calculates member object, computing unit object and self-defining function CDF object; Performance element, be used for definition and calculate member's self-defining function, on carrying out described syntax tree during the multi-dimensional query expression formula of various objects, call function if desired, the function definition according to self-defining function judges whether to be self-defining function earlier, if, enter the self-defining function implementation, if not, judge whether to be canonical function according to the function definition of canonical function, if canonical function then enters the canonical function implementation.
Preferably, described performance element comprises: the self-defining function performance element, when being used for the multi-dimensional query expression formula of various objects on carrying out described syntax tree, call function if desired, function definition according to self-defining function judges whether to be self-defining function earlier, if enter the self-defining function implementation; The canonical function performance element is used for when judgement is not self-defining function, judges whether to be canonical function according to the function definition of canonical function, if canonical function then enters the canonical function implementation.
Preferably, the function declaration of described self-defining function can realize in the following manner according to the with key word among the MDX:
Utilize With[script-type] Function[ReturnType] FunName (ArgType arg1, ArgType arg2) the multi-dimensional query expression formula function of as ' [Script] ', wherein, [script-type] represents script type, ReturnType represents the return parameters type of self-defining function, arg1 and arg2 represent the parameter of self-defining function, ArgType represents the parameter type of self-defining function, the function body of [Script] expression self-defining function, FunName represents the function name of self-defining function;
Perhaps,
Utilize With[script-type] Function[ReturnType] FunName (Context ctx, ArgType arg1, ArgType arg2) the Multidimensional Expressions function of as ' [Script] ', wherein, the Context parameter is represented the execution context of self-defining function, [script-type] represents script type, ReturnType represents the return parameters type of self-defining function, arg1 and arg2 represent the parameter of self-defining function, ArgType represents the parameter type of self-defining function, the function body of [Script] expression self-defining function, FunName represents the function name of self-defining function.
Preferably, described return parameters type comprises: integer, floating number, character string, boolean, date, member, set or dimension.
Preferably, described performance element comprises: compilation unit and call unit,
Described compilation unit for the multi-dimensional query expression formula of compiling self-defining function, generates the Dynamic Java class;
Described call unit for the generation method of calling described Dynamic Java class, imports the parameter of self-defining function into, and returns execution result;
Described device also comprises: type conversion unit, be used for when the type of the parameter of described self-defining function and execution result is different from the type of function, if the type of the parameter of described self-defining function and execution result satisfies the implicit type conversion rule, the parameter of described self-defining function and the type of execution result are carried out implicit type conversion.
As can be seen from the above-described embodiment, in the MDX inquiry, directly define self-defining function, removed the complex processes such as compiling deployment that are similar to SqlServer from, simple and flexible.Improved the developer in the work efficiency of the performance history of whole OLAP system.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the process flow diagram of an embodiment of the analytic method of multi-dimensional query statement in a kind of on-line analytical processing server of the present invention;
Fig. 2 is the process flow diagram of another embodiment of the analytic method of multi-dimensional query statement in a kind of on-line analytical processing server of the present invention;
Fig. 3 is the structural drawing of an embodiment of the resolver of multi-dimensional query statement in a kind of on-line analytical processing device of the present invention server.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, below in conjunction with accompanying drawing the embodiment of the invention is described in detail.
The present invention can be used in numerous general or special purpose calculation element environment or the configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multiprocessor device, comprise distributed computing environment of above any device or equipment etc.
The present invention can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract data type, program, object, assembly, data structure etc.Also can in distributed computing environment, put into practice the present invention, in these distributed computing environment, be executed the task by the teleprocessing equipment that is connected by communication network.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
See also Fig. 1, it is the analytic method of multi-dimensional query expression formula in the on-line analytical processing server of the present invention, may further comprise the steps:
Step 101: resolve the multi-dimensional query statement, according to analysis result generative grammar tree, wherein, the node of described syntax tree comprises transverse axis object, longitudinal axis object, slice axis object, calculates member object, computing unit object and self-defining function CDF object;
Step 102: on carrying out described syntax tree during the multi-dimensional query expression formula of various objects, call function if desired, function definition according to self-defining function judges whether to be self-defining function earlier, if, enter the self-defining function implementation, if not, judge whether to be canonical function according to the function definition of canonical function, if canonical function then enters mark function implementation.
Wherein, the function declaration of self-defining function can realize according to following any-mode according to the with key word among the MDX:
Utilize With[script-type] Function[ReturnType] FunName (ArgType arg1, ArgType arg2) the multi-dimensional query expression formula function of as ' [Script] ', wherein, [script-type] represents script type, ReturnType represents the return parameters type of self-defining function, arg1 and arg2 represent the parameter of self-defining function, and ArgType represents the parameter type of self-defining function, the function body of [Script] expression self-defining function; Perhaps, utilize With[script-type] Function[ReturnType] the Multidimensional Expressions function of FunName (Context ctx, ArgType arg1, ArgType arg2) as ' [Script] ', wherein, the Contex parameter is represented the execution context of self-defining function.
Above-mentioned return parameters type comprises: integer, floating number, character string, boolean, date, member, set or dimension.
Wherein, the implementation of self-defining function comprises: the multi-dimensional query expression formula of compiling self-defining function generates the Dynamic Java class; Call the generation method of described Dynamic Java class, import the parameter of self-defining function into, and return execution result.
Need to prove, when the type of the parameter of described self-defining function and execution result and the type in the function not simultaneously, if satisfy the implicit type conversion rule, the parameter of described self-defining function and the type of execution result are carried out implicit type conversion.
As can be seen from the above-described embodiment, in the MDX inquiry, directly define self-defining function, removed the complex processes such as compiling deployment that are similar to SqlServer from, simple and flexible.Improved the developer in the work efficiency of the performance history of whole OLAP system.
In addition, present embodiment is supported multiple grammer, as Java, JavaScript, and expansion easily.There is the free script of much increasing income directly to use on the Java platform, and in Jdk6, preset multiple script.
In addition, owing to can import context Context into, the restriction that tradition can only be handled the fundamental type data can be broken through, the computing context can be visited, dimensional structure, and other resources.Open interface to greatest extent, the user can handle any complicated service.
See also Fig. 2, it is the process flow diagram of another embodiment of the analytic method of multi-dimensional query statement in a kind of on-line analytical processing server.Present embodiment is invoked as scene with self-defining function when carrying out the Multidimensional Expressions that calculates member object, describe the analytic method to the multi-dimensional query statement in detail, and this method may further comprise the steps:
Step 201: the self-defining function among the member is calculated in definition;
For example, present embodiment is stated according to the with key word among the MDX and is specifically as follows the self-defining function of various functions:
Figure GDA00003004397700071
From above-mentioned multi-dimensional query statement as can be seen, utilized With[script-type] Function[ReturnType] the multi-dimensional query expression formula function of FunName (ArgType arg1, ArgType arg2) as ' [Script] '.Wherein, [script-type] represents script type, stipulated that in above-mentioned multi-dimensional query statement script type is Java; ReturnType represents the return parameters type of self-defining function, has stipulated that in above-mentioned multi-dimensional query statement the return parameters type is integer Int; Arg1 and arg2 represent the parameter of self-defining function, have stipulated that in above-mentioned multi-dimensional query statement two parameters are respectively value and n; ArgType represents the parameter type of self-defining function, in above-mentioned multi-dimensional query statement separate provision the type of parameter value and n be integer; The function body of [Script] expression self-defining function has stipulated that in above-mentioned multi-dimensional query statement function body mainly is the power operation process of being finished by for loop statement, and result is n the power of value as a result.
Need to prove, can also utilize With[script-type] Function[ReturnType] FunName (Context ctx, ArgType arg1, ArgType arg2) the Multidimensional Expressions function of as ' [Script] ', wherein, the Contex parameter is represented the execution context of self-defining function.So that in self-defining function, context Context can be imported in system, the interface that provides by Context, make the user both can have access to current arithmetic element lattice, also can have access to the dimension metadata, can also have access to other any resources that may have access to, as JDBC, carry out further logical process.By these logical process, can realize the service logic that OLAP itself can't handle, as control of authority etc.
Step 202: resolve the multi-dimensional query statement, set according to the analysis result generative grammar;
Wherein, data processing terminal is resolved the multi-dimensional query statement according to the syntax rule of MDX in the processing procedure of carrying out statement, and MDX syntax parsing process realizes according to left and right LR recursive grammar analytical algorithm.
Described syntax tree is a MDXQurey object, and the node of syntax tree also comprises self-defining function CDF object except comprising transverse axis object, longitudinal axis object, slice axis object, calculating member object and the computing unit object.
For example, the structure of MDXQurey object is specifically as follows:
Figure GDA00003004397700081
Wherein, CalculatedMember and CellCalculation contain the multi-dimensional query expression formula that is useful on calculating, are used for calculating.SlicerExp becomes tuple after execution, AxisExp becomes set after execution.
For example, above-mentioned CDF object structure is specifically as follows:
Figure GDA00003004397700082
Step 203: the multi-dimensional query expression formula of carrying out transverse axis object, longitudinal axis object, slice axis object;
Wherein, transverse axis for the set Item1, Item2, Item3 ... .}, the longitudinal axis is set { Measures.Amount, Measures.Power5}.
Step 204: ergodic data zone, the value of cell in the execution data area;
Wherein, the cell of data area is transverse axis and longitudinal axis cross unit lattice, and for example, { Measures.Amount during Item1}, directly obtains data from the bottom data access layer, obtains 2 when carrying out when carrying out; { Measures.Power5 during Item1}, because Power5 calculates the member, then needs to call the multi-dimensional query expression formula Power that calculates the member (Measures.[Amount], 5) and carries out, and changes the multi-dimensional query expression formula over to and carries out flow process when carrying out.
For example, when carrying out the multi-dimensional query expression formula, at first call syntax parsing, obtain function name, parameter type and the parameter value of multi-dimensional query expression formula; And then whether judge whether to be self-defining function with the mode whether function definition of self-defining function mates according to the function name, parameter type and the parameter value that obtain the multi-dimensional query expression formula, if self-defining function, then enter the execution flow process of self-defining function, if not self-defining function, whether inquiry is canonical function from the OLAP system parameter table again, carries out flow process if canonical function then enters canonical function.
Concrete, the execution flow process of self-defining function can comprise:
If 1 carries out the multi-dimensional query expression formula of self-defining function for the first time, the multi-dimensional query expression formula of compiling self-defining function generates the Dynamic Java class.
Wherein, if the java class type uses compilation tool JavaC compiling to generate a class, a method; If the JavaScript type generates a proxy class, this proxy class is called Script by the JavaScript script engine of increasing income.
2, call the generation method of Dynamic Java class, import the parameter of self-defining function into, and return execution result.
3, the type of the parameter of self-defining function and execution result and the type in the function are carried out implicit type conversion to the parameter of described self-defining function and the type of execution result not simultaneously.As changing between int and the double, int, double can be exchanged into String etc.
Step 205: assembling execution result collection.
Wherein, through after the above-mentioned dissection process, the form of execution result is:
Item Amount Power5
Item1 2 32
Item2 4 1024
Item3 10 100000
? ?
As can be seen from the above-described embodiment, in the MDX inquiry, directly define self-defining function, removed the complex processes such as compiling deployment that are similar to SqlServer from, simple and flexible.Improved the developer in the work efficiency of the performance history of whole OLAP system.
In addition, support multiple grammer, as Java, JavaScript, and expansion easily.There is the free script of much increasing income directly to use on the Java platform, and in Jdk6, preset multiple script.
In addition, owing to can import context Context into, the restriction that tradition can only be handled the fundamental type data can be broken through, the computing context can be visited, dimensional structure, and other resources.Open interface to greatest extent, the user can handle any complicated service.
Corresponding with the analytic method of multi-dimensional query statement in above-mentioned a kind of on-line analytical processing server, the embodiment of the invention also provides the resolver of multi-dimensional query statement in a kind of on-line analytical processing device device.See also Fig. 3, it is the structural drawing of an embodiment of the resolver of multi-dimensional query statement in a kind of on-line analytical processing server of the present invention, and this device comprises: resolution unit 301 and performance element 302.Principle of work below in conjunction with this device is further introduced its inner structure and annexation.
Resolution unit 301, be used for resolving the multi-dimensional query statement, according to analysis result generative grammar tree, wherein, the node of described syntax tree comprises transverse axis object, longitudinal axis object, slice axis object, calculates member object, computing unit object and self-defining function CDF object;
Performance element 302, when being used for the multi-dimensional query expression formula of various objects on carrying out described syntax tree, call function if desired, function definition according to self-defining function judges whether to be self-defining function earlier, if enter the self-defining function implementation, if not, function definition according to canonical function judges whether to be canonical function, if canonical function then enters mark function implementation.
Wherein, performance element 302 comprises: self-defining function performance element 3021 and canonical function performance element 3022,
Self-defining function performance element 3021, when being used for the multi-dimensional query expression formula of various objects on carrying out described syntax tree, call function if desired, first function definition according to self-defining function judges whether to be self-defining function, if enter the self-defining function implementation;
Canonical function performance element 3022 is used for when judging when being not self-defining function, judges whether to be canonical function according to the function definition of canonical function, marks the function implementation if canonical function then enters.
Wherein, self-defining function performance element 3021 comprises: the first self-defined unit, compilation unit and call unit,
The first self-defined unit, be used for utilizing With[script-type] Function[ReturnType] FunName (ArgType arg1, ArgType arg2) the multi-dimensional query expression formula function of as ' [Script] ', wherein, [script-type] represents script type, ReturnType represents the return parameters type of self-defining function, arg1 and arg2 represent the parameter of self-defining function, ArgType represents the parameter type of self-defining function, the function body of [Script] expression self-defining function;
Compilation unit for the multi-dimensional query expression formula of compiling self-defining function, generates the Dynamic Java class;
Call unit for the generation method of calling described Dynamic Java class, imports the parameter of self-defining function into, and returns execution result.
Perhaps, the above-mentioned first self-defined unit also can replace with the second self-defined unit, and then self-defining function performance element 3021 comprises: the second self-defined unit, compilation unit and call unit,
The second self-defined unit, be used for utilizing With[script-type] Function[ReturnType] FunName (Context ctx, ArgType arg1, ArgType arg2) the Multidimensional Expressions function of as ' [Script] ', wherein, the Contex parameter is represented the execution context of self-defining function.
Compilation unit for the multi-dimensional query expression formula of compiling self-defining function, generates the Dynamic Java class;
Call unit for the generation method of calling described Dynamic Java class, imports the parameter of self-defining function into, and returns execution result.
Above-mentioned return parameters type comprises: integer, floating number, character string, boolean, date, member, set or dimension.
Need to prove, described device also comprises: type conversion unit, be used for when the type of the type of the parameter of described self-defining function and execution result and function not simultaneously, if satisfy the implicit type conversion rule, the parameter of described self-defining function and the type of execution result are carried out implicit type conversion.
As can be seen from the above-described embodiment, in the MDX inquiry, directly define self-defining function, removed the complex processes such as compiling deployment that are similar to SqlServer from, simple and flexible.Improved the work efficiency of developer in the performance history of whole M OLAP system.
In addition, support multiple grammer, as Java, JavaScript, and expansion easily.There is the free script of much increasing income directly to use on the Java platform, and in Jdk6, preset multiple script.
In addition, owing to can import context Context into, the restriction that tradition can only be handled the fundamental type data can be broken through, the computing context can be visited, dimensional structure, and other resources.Open interface to greatest extent, the user can handle any complicated service.
Need to prove, one of ordinary skill in the art will appreciate that all or part of flow process that realizes in above-described embodiment method, be to instruct relevant hardware to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
More than analytic method and the device of multi-dimensional query statement in a kind of on-line analysis provided by the present invention system is described in detail, used specific embodiment herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1. the analytic method of multi-dimensional query statement in the on-line analytical processing server is characterized in that, comprising:
Resolve the multi-dimensional query statement, according to analysis result generative grammar tree, wherein, the node of described syntax tree comprises transverse axis object, longitudinal axis object, slice axis object, calculates member object, computing unit object and self-defining function CDF object;
The self-defining function among the member is calculated in definition, on carrying out described syntax tree during the multi-dimensional query expression formula of various objects, call function if desired, function definition according to self-defining function judges whether to be self-defining function earlier, if enter the self-defining function implementation, if not, function definition according to canonical function judges whether to be canonical function, if canonical function then enters the canonical function implementation.
2. method according to claim 1 is characterized in that, the function declaration of described self-defining function can realize in the following manner according to the with key word among the MDX:
Utilize With[script-type] Function[ReturnType] FunName (ArgType arg1, ArgType arg2) the multi-dimensional query expression formula function of as ' [Script] ', wherein, [script-type] represents script type, ReturnType represents the return parameters type of self-defining function, arg1 and arg2 represent the parameter of self-defining function, ArgType represents the parameter type of self-defining function, the function body of [Script] expression self-defining function, FunName represents the function name of self-defining function;
Perhaps,
Utilize With[script-type] Function[ReturnType] FunName (Context ctx, ArgType arg1, ArgType arg2) the Multidimensional Expressions function of as ' [Script] ', wherein, the Context parameter is represented the execution context of self-defining function, [script-type] represents script type, ReturnType represents the return parameters type of self-defining function, arg1 and arg2 represent the parameter of self-defining function, ArgType represents the parameter type of self-defining function, the function body of [Script] expression self-defining function, FunName represents the function name of self-defining function.
3. method according to claim 2 is characterized in that, described return parameters type comprises: integer, floating number, character string, boolean, date, member, set or dimension.
4. method according to claim 1 is characterized in that, described self-defining function implementation comprises:
The multi-dimensional query expression formula of compiling self-defining function generates the Dynamic Java class;
Call the generation method of described Dynamic Java class, import the parameter of self-defining function into, and return execution result.
5. method according to claim 4 is characterized in that, described method also comprises:
When the type of the parameter of described self-defining function and execution result is different from type in the function, if the type of the parameter of described self-defining function and execution result satisfies the implicit type conversion rule, the parameter of described self-defining function and the type of execution result are carried out implicit type conversion.
6. the resolver of multi-dimensional query statement in the on-line analytical processing server is characterized in that, comprising:
Resolution unit is used for resolving the multi-dimensional query statement, and according to analysis result generative grammar tree, wherein, the node of described syntax tree comprises transverse axis object, longitudinal axis object, slice axis object, calculates member object, computing unit object and self-defining function CDF object;
Performance element, be used for definition and calculate member's self-defining function, on carrying out described syntax tree during the multi-dimensional query expression formula of various objects, call function if desired, the function definition according to self-defining function judges whether to be self-defining function earlier, if, enter the self-defining function implementation, if not, judge whether to be canonical function according to the function definition of canonical function, if canonical function then enters the canonical function implementation.
7. device according to claim 6 is characterized in that, described performance element comprises:
The self-defining function performance element, when being used for the multi-dimensional query expression formula of various objects on carrying out described syntax tree, call function if desired, first function definition according to self-defining function judges whether to be self-defining function, if enter the self-defining function implementation;
The canonical function performance element is used for when judgement is not self-defining function, judges whether to be canonical function according to the function definition of canonical function, if canonical function then enters the canonical function implementation.
8. device according to claim 6 is characterized in that, the function declaration of described self-defining function can realize in the following manner according to the with key word among the MDX:
Utilize With[script-type] Function[ReturnType] FunName (ArgType arg1, ArgType arg2) the multi-dimensional query expression formula function of as ' [Script] ', wherein, [script-type] represents script type, ReturnType represents the return parameters type of self-defining function, arg1 and arg2 represent the parameter of self-defining function, ArgType represents the parameter type of self-defining function, the function body of [Script] expression self-defining function, FunName represents the function name of self-defining function;
Perhaps,
Utilize With[script-type] Function[ReturnType] FunName (Context ctx, ArgType arg1, ArgType arg2) the Multidimensional Expressions function of as ' [Script] ', wherein, the Context parameter is represented the execution context of self-defining function, [script-type] represents script type, ReturnType represents the return parameters type of self-defining function, arg1 and arg2 represent the parameter of self-defining function, ArgType represents the parameter type of self-defining function, the function body of [Script] expression self-defining function, FunName represents the function name of self-defining function.
9. device according to claim 8 is characterized in that, described return parameters type comprises: integer, floating number, character string, boolean, date, member, set or dimension.
10. device according to claim 6 is characterized in that, described performance element comprises: compilation unit and call unit,
Described compilation unit for the multi-dimensional query expression formula of compiling self-defining function, generates the Dynamic Java class;
Described call unit for the generation method of calling described Dynamic Java class, imports the parameter of self-defining function into, and returns execution result;
Described device also comprises:
Type conversion unit, be used for when the type of the parameter of described self-defining function and execution result is different from the type of function, if the type of the parameter of described self-defining function and execution result satisfies the implicit type conversion rule, the parameter of described self-defining function and the type of execution result are carried out implicit type conversion.
CN 200910110280 2009-10-28 2009-10-28 Method and device for analyzing multi-dimensional query sentence in online analysis processing server Active CN101710273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200910110280 CN101710273B (en) 2009-10-28 2009-10-28 Method and device for analyzing multi-dimensional query sentence in online analysis processing server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200910110280 CN101710273B (en) 2009-10-28 2009-10-28 Method and device for analyzing multi-dimensional query sentence in online analysis processing server

Publications (2)

Publication Number Publication Date
CN101710273A CN101710273A (en) 2010-05-19
CN101710273B true CN101710273B (en) 2013-09-11

Family

ID=42403065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200910110280 Active CN101710273B (en) 2009-10-28 2009-10-28 Method and device for analyzing multi-dimensional query sentence in online analysis processing server

Country Status (1)

Country Link
CN (1) CN101710273B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102202242A (en) * 2011-05-19 2011-09-28 广东星海数字家庭产业技术研究院有限公司 Realization method of JavaScript interpreter based on set-top box browser
CN102663116B (en) * 2012-04-11 2014-04-23 中国人民大学 Multi-dimensional OLAP (On Line Analytical Processing) inquiry processing method facing column storage data warehouse
CN102663114B (en) * 2012-04-17 2013-09-11 中国人民大学 Database inquiry processing method facing concurrency OLAP (On Line Analytical Processing)
CN104794113B (en) * 2014-01-16 2019-04-23 中兴通讯股份有限公司 Data processing method and device
CN104461531B (en) * 2014-12-02 2017-11-07 福建工程学院 A kind of implementation method of reporting system SQL
CN104484392B (en) * 2014-12-11 2018-02-02 北京国双科技有限公司 Query sentence of database generation method and device
CN110197064B (en) * 2019-02-18 2023-08-25 腾讯科技(深圳)有限公司 Process processing method and device, storage medium and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006136025A1 (en) * 2005-06-24 2006-12-28 Orbital Technologies Inc. System and method for translating between relational database queries and multidimensional database queries
US20080235180A1 (en) * 2007-03-20 2008-09-25 Microsoft Corporation Extensibility mechanism for analysis services unified dimensional model
CN101556602A (en) * 2009-04-08 2009-10-14 王珊 Memory OLAP What-if analytical method based on a difference table
CN101561817A (en) * 2009-06-02 2009-10-21 天津大学 Conversion algorithm from XQuery to SQL query language and method for querying relational data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006136025A1 (en) * 2005-06-24 2006-12-28 Orbital Technologies Inc. System and method for translating between relational database queries and multidimensional database queries
US20080235180A1 (en) * 2007-03-20 2008-09-25 Microsoft Corporation Extensibility mechanism for analysis services unified dimensional model
CN101556602A (en) * 2009-04-08 2009-10-14 王珊 Memory OLAP What-if analytical method based on a difference table
CN101561817A (en) * 2009-06-02 2009-10-21 天津大学 Conversion algorithm from XQuery to SQL query language and method for querying relational data

Also Published As

Publication number Publication date
CN101710273A (en) 2010-05-19

Similar Documents

Publication Publication Date Title
CN101710273B (en) Method and device for analyzing multi-dimensional query sentence in online analysis processing server
CN108959433B (en) Method and system for extracting knowledge graph from software project data and asking for questions and answers
CN102799644B (en) Based on data base dynamic inquiry system and the data base dynamic inquiry method of metadata
CN101609460B (en) Searching method of supporting isomeric geoscientific data resources and searching system
CN108694214A (en) Generation method, generating means, readable medium and the electronic equipment of data sheet
CN103049251B (en) A kind of data base persistence layer device and database operation method
CN105183489A (en) Extjs frame based intelligent data analysis system and method
US20160239544A1 (en) Collaborative planning for accelerating analytic queries
CN106951231B (en) Computer software development method and device
CN110955410B (en) Code automatic generation method, device, equipment and medium
CN108369591A (en) System and method for caching and parameterizing ir
CN109522341A (en) Realize method, apparatus, the equipment of the stream data processing engine based on SQL
CN108766507B (en) CQL and standard information model openEHR-based clinical quality index calculation method
Hoeller et al. Efficient XML usage within wireless sensor networks
Bakli et al. Distributed moving object data management in MobilityDB
CN116166718B (en) Data blood margin acquisition method and device
CN112347120A (en) Automatic optimization method and device based on complex SQL
CN116795859A (en) Data analysis method, device, computer equipment and storage medium
CN114281842A (en) Method and device for sub-table query of database
CN110147396A (en) A kind of mapping relations generation method and device
Dikaiakos et al. The portable parallel implementation of two novel mathematical biology algorithms in ZPL
CN113836164A (en) Method, system, device and medium for unifying SQL
Bao et al. Data switching method among heterogeneous power information system databases based on knowledge graph
Frescino et al. Demonstrating a progressive FIA through FIESTA: A bridge between science and production
Chaturvedi et al. Design pattern detection using genetic algorithm for sub-graph isomorphism to enhance software reusability

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant