JP2015011484A - Data processing method and computer - Google Patents
Data processing method and computer Download PDFInfo
- Publication number
- JP2015011484A JP2015011484A JP2013135734A JP2013135734A JP2015011484A JP 2015011484 A JP2015011484 A JP 2015011484A JP 2013135734 A JP2013135734 A JP 2013135734A JP 2013135734 A JP2013135734 A JP 2013135734A JP 2015011484 A JP2015011484 A JP 2015011484A
- Authority
- JP
- Japan
- Prior art keywords
- operator
- column
- query
- tuple
- data processing
- 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.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本発明は、配列型データを扱うストリームデータ処理の処理効率を向上させるデータ処理方法に関する。 The present invention relates to a data processing method for improving the processing efficiency of stream data processing that handles array type data.
近年、処理するデータ量が増大しており、リアルタイムにデータを集計し、また、分析することを可能とするストリームデータ処理システムが注目を集めている。ストリームデータ処理システムは、ストリームデータを処理対象とする。ここで、ストリームデータとは、途切れることなく到来する時系列順のデータ列である。 In recent years, the amount of data to be processed has increased, and a stream data processing system that can aggregate and analyze data in real time has attracted attention. The stream data processing system targets stream data. Here, the stream data is a data sequence in chronological order that arrives without interruption.
ストリームデータ処理システムでは、予め定義されたクエリにしたがって所定のストリームデータ処理が実行される。クエリとは、処理の対象とするデータ及び処理内容を示すシナリオである。クエリを定義する計算機言語の例は、非特許文献1に開示されている。
In the stream data processing system, predetermined stream data processing is executed according to a predefined query. A query is a scenario indicating the data to be processed and the processing content. An example of a computer language that defines a query is disclosed in Non-Patent
ストリームデータ処理のアプリケーションにおいては、回帰分析による時系列予測計算などの数値計算が必要となるケースがある。このような計算は、ベクトル計算や行列計算となるため、配列型データを用いた処理として定義される。 In a stream data processing application, there are cases where numerical calculation such as time series prediction calculation by regression analysis is required. Since such calculation is vector calculation or matrix calculation, it is defined as a process using array type data.
ストリームデータではないが、ストックされたデータに対する標準クエリ言語であるSQL99では、配列型データを単一のカラム値として表現する、配列型カラムの仕様を規定している。この仕様は、ストリーム処理のクエリ言語にも適用可能である。同じく、ストックされた多次元配列のデータを効率的に処理する技術としては、非特許文献2に記載された技術が知られている。非特許文献2には、膨大なスケールの配列データを管理するデータ管理システムであるSciDBについて記載されている。
Although it is not stream data, SQL99, which is a standard query language for stocked data, defines an array type column specification that represents array type data as a single column value. This specification can also be applied to a query language for stream processing. Similarly, a technique described in Non-Patent
従来、配列型データを扱うストリームデータ処理の高速化を実現するためには、配列の検索処理のコスト、及びメモリの利用効率が問題となる。ここで、二つの行列の積を算出する演算処理の例を用いて、従来の課題について説明する。 Conventionally, in order to realize high-speed stream data processing that handles array-type data, the cost of array search processing and the efficiency of use of memory are problematic. Here, a conventional problem will be described using an example of calculation processing for calculating the product of two matrices.
図11は、従来の二つの行列の積を算出する演算処理を実現するためのクエリの一例を示す図である。図11に示すクエリでは、行列Aと行列Bとの積を算出するための演算処理が実行される。 FIG. 11 is a diagram illustrating an example of a query for realizing a calculation process for calculating a product of two conventional matrices. In the query shown in FIG. 11, an arithmetic process for calculating the product of the matrix A and the matrix B is executed.
図11に示すクエリでは、行列のデータは、行のカラム、列のカラム、及び行列成分の値のカラムから構成されるタプルを複数含むデータ構造で管理される。したがって、一般的な行列表現のデータと比較して、データ量が増加するため、メモリの利用効率が低いという問題がある。 In the query shown in FIG. 11, matrix data is managed in a data structure including a plurality of tuples configured from row columns, column columns, and matrix component value columns. Therefore, there is a problem in that the use efficiency of the memory is low because the amount of data increases as compared with general matrix representation data.
また、クエリに基づく演算処理では、行列Aの列のカラムの値と、行列Bの行のカラムの値とが一致する組合せを検索する処理が必要となる。したがって、行及び列の数が大きくなると検索処理のコストの増大し、これに伴って、演算処理の性能が低下するという問題がある。 In addition, in the arithmetic processing based on the query, it is necessary to search for a combination in which the column value of the matrix A and the column value of the row of the matrix B match. Therefore, as the number of rows and columns increases, the cost of search processing increases, and there is a problem in that the performance of arithmetic processing decreases accordingly.
前述した二つの問題を解決する方法として、以下のような従来技術が知られている。 The following conventional techniques are known as methods for solving the above two problems.
一つの方法は、予め、行列Aの列のカラムの値、及び行列Bの行のカラムの値との組合せを指定するインデクスを用いる方法である。当該インデクスを用いることによって、前述した検索処理のコストの増大を抑制することができる。しかし、インデクスを格納するメモリ領域を確保する必要があるため、メモリの利用効率がさらに低くなるという問題がある。 One method is a method using an index that specifies a combination of a column value of a column of the matrix A and a column value of a row of the matrix B in advance. By using the index, it is possible to suppress an increase in the cost of the search process described above. However, since it is necessary to secure a memory area for storing the index, there is a problem in that the memory utilization efficiency is further reduced.
他の方法は、前述のSQL99と同様の配列型カラムを利用する方法である。図12は、配列型カラムを用いたクエリの一例を示す図である。図12に示すクエリでは、行列成分そのものが配列として管理される。単純に配列型カラムを用いたクエリでは以下のような問題がある。 The other method is a method using an array type column similar to the above-mentioned SQL99. FIG. 12 is a diagram illustrating an example of a query using an array type column. In the query shown in FIG. 12, the matrix components themselves are managed as an array. A query using an array type column has the following problems.
一つの問題は、一つの行列成分のデータ更新に伴う演算処理が効率的に行えないことである。例えば、行列の積が算出された後に行列成分の一つが更新された場合、その更新によって変化する積の成分は、更新された成分と行又は列が一致する成分に限られる。このように、更新後の行列の積を得るためには、変化した成分の演算処理のみを実行すればよい。しかし、配列型カラムでは行列全体が一つのカラムに対応するため、一つの行列成分の更新に伴って配列型カラム(行列)そのものが更新される。改めて行列の積を算出しなければならない。したがって、一部の値の更新に関する演算処理を効率的に行えないという問題がある。 One problem is that the arithmetic processing associated with the data update of one matrix component cannot be performed efficiently. For example, when one of the matrix components is updated after the matrix product is calculated, the product component that is changed by the update is limited to a component whose row or column matches the updated component. Thus, in order to obtain the updated matrix product, it is only necessary to execute the arithmetic processing of the changed component. However, in the array type column, the entire matrix corresponds to one column, and therefore the array type column (matrix) itself is updated as one matrix component is updated. It is necessary to calculate the matrix product anew. Therefore, there is a problem that the arithmetic processing related to the updating of some values cannot be performed efficiently.
他の問題は、行列の積を算出するための組込関数を定義する必要がある。配列型カラムを用いた場合、演算に必要な関数を新たに定義する必要がある。また、予めライブラリとして用意されていない関数が必要になる場合がある。そのため、開発効率が悪いという問題点がある。 Another problem is the need to define built-in functions for calculating matrix products. When using an array type column, it is necessary to define a new function necessary for the operation. In some cases, a function that is not prepared in advance as a library is required. Therefore, there is a problem that development efficiency is poor.
本願発明は前述した課題に鑑みてなされた発明である。すなわち、配列型データを扱うストリームデータ処理の高速化が実現可能なデータ処理方法及び計算機を提供することを目的とする。 The present invention has been made in view of the above-described problems. That is, an object of the present invention is to provide a data processing method and computer capable of realizing high-speed stream data processing for handling array type data.
本願において開示される発明の代表的な一例を示せば以下の通りである。すなわち、ストリームデータ処理を実行する計算機におけるデータ処理方法であって、前記計算機は、プロセッサ、前記プロセッサに接続されるメモリ、前記プロセッサに接続されるネットワークインタフェースを有し、前記ストリームデータ処理は、処理の最小単位となるオペレータを複数含み、前記ストリームデータ処理の対象であるストリームデータは、複数のカラムから構成されるタプルを複数含み、前記計算機は、前記ストリームデータ処理を実現するための一つ以上のクエリを含む分析シナリオを受け付け、前記分析シナリオを解析することによって、前記ストリームデータ処理における前記オペレータの構成を示すクエリグラフの情報を生成するクエリ解析部と、前記クエリグラフの情報に基づいて、前記オペレータに対応する処理を実行するオペレータ実行部を生成するクエリ構築部と、前記クエリ構築部によって生成された前記オペレータ実行部に基づいて、入力されたストリームデータを処理するクエリ実行部と、を有し、前記方法は、前記クエリ構築部が、前記ストリームデータ処理に含まれる前記複数のオペレータの中から処理対象のオペレータを選択する第1のステップと、前記クエリ構築部が、前記クエリグラフの情報に基づいて、前記選択されたオペレータの処理内容を解析し、前記解析の結果に基づいて、前記選択されたオペレータに対応する前記オペレータ実行部に割り当てられるデータ格納領域におけるデータ構造を決定する第2のステップと、前記クエリ構築部が、前記解析の結果及び前記決定されたデータ構造の情報に基づいて、前記選択されたオペレータに対応するオペレータ実行部を生成する第3のステップと、前記クエリ構築部が、前記生成されたオペレータ実行部を前記クエリ実行部に登録する第4のステップと、を含むことを特徴とする。 A typical example of the invention disclosed in the present application is as follows. That is, a data processing method in a computer that executes stream data processing, wherein the computer includes a processor, a memory connected to the processor, and a network interface connected to the processor. The stream data that is the target of the stream data processing includes a plurality of tuples composed of a plurality of columns, and the computer has at least one for realizing the stream data processing. Based on the information of the query graph, the query analysis unit that generates the information of the query graph indicating the configuration of the operator in the stream data processing by receiving the analysis scenario including the query of, and analyzing the analysis scenario, Corresponding to the operator A query construction unit that generates an operator execution unit that executes processing, and a query execution unit that processes input stream data based on the operator execution unit generated by the query construction unit, and the method A first step in which the query construction unit selects an operator to be processed from the plurality of operators included in the stream data processing, and the query construction unit, based on information in the query graph, A second step of analyzing a processing content of the selected operator and determining a data structure in a data storage area allocated to the operator execution unit corresponding to the selected operator based on a result of the analysis; The query construction unit selects the selection based on the analysis result and the information on the determined data structure. A third step of generating an operator execution unit corresponding to the generated operator, and a fourth step of the query construction unit registering the generated operator execution unit in the query execution unit. And
本発明によれば、ストリームデータ処理に含まれるオペレータ毎に、配列データのデータ構造を最適化することができるため、計算処理のコストの低減及びメモリ利用効率を向上させることができる。したがって、ストリームデータ処理の高速化が可能となる。 According to the present invention, since the data structure of the array data can be optimized for each operator included in the stream data processing, the calculation processing cost can be reduced and the memory utilization efficiency can be improved. Therefore, it is possible to speed up the stream data processing.
上記した以外の課題、構成及び効果は、以下の実施形態の説明により明らかにされる。 Problems, configurations, and effects other than those described above will be clarified by the following description of embodiments.
以下、本発明の実施例を添付図面に基づいて説明する。 Embodiments of the present invention will be described below with reference to the accompanying drawings.
図1は、本発明の実施例1におけるストリームデータ処理システムの構成例を示すブロック図である。
FIG. 1 is a block diagram showing a configuration example of a stream data processing system in
ストリームデータ処理システムは、ストリームデータ処理サーバ100、及び、複数のホスト計算機120、130、140から構成される。
The stream data processing system includes a stream
ストリームデータ処理サーバ100は、ネットワーク150を介して複数のホスト計算機120、130、140と接続される。なお、ネットワーク150は、WAN(Wide Area Network)及びLAN(Local Area Network)などを用いることが考えられるが、本発明はネットワーク150の接続形式に限定されない。
The stream
ストリームデータ処理サーバ100は、ホスト計算機120から送信されるストリームデータを受信し、また、指示されたクエリに従ってストリームデータを処理し、処理結果を出力タプル141として出力する。
The stream
ストリームデータは、複数の入力タプル121を含む。本実施例では、入力タプル121は、値のカラム、及び当該値を特定するためのインデクスのカラムを含む。なお、入力タプル121には、インデクスのカラムが一つ以上含まれるものとする。また、入力タプル121は、タイムスタンプのカラムを含んでいてもよい。
The stream data includes a plurality of
ストリームデータ処理サーバ100は、プロセッサ101、メモリ102、ネットワークインタフェース104、及びストレージ装置105を備え、各構成はバス103を介して接続される。
The stream
プロセッサ101は、メモリ102に格納されるプログラムを実行することによって各種処理を実行する。以下の説明では、プログラムを主体に処理を記載する場合、当該プログラムがプロセッサ101によって実行されていることを示す。
The
メモリ102は、プロセッサ101が実行するプログラム及び当該プログラムを実行するために必要な情報を格納する。具体的には、メモリ102は、ストリームデータ処理部110を実現するプログラムを格納する。
The
ストリームデータ処理部110は、ストリームデータを処理する。ストリームデータ処理部110の詳細については、図2を用いて後述する。
The stream
ストレージ装置105は、ストリームデータ、クエリ、及びその他の情報を格納する。ストレージ装置105は、例えば、HDD(Hard Disk Drive)又はSSD(Solid State Drive)等の記憶媒体が考えられる。なお、本発明は記憶媒体の種類に限定されない。
The
なお、メモリ102に格納されるプログラム及び情報は、ストレージ装置105に格納されてもよい。この場合、プロセッサ101がストレージ装置105からプログラム及び情報を読み出し、読み出されたプログラム及び情報をメモリ102にロードする。
Note that the program and information stored in the
ホスト計算機120、130、140は、ストリームデータ処理サーバ100を利用するユーザが利用する計算機であり、プロセッサ(図示省略)、メモリ(図示省略)、及びネットワークインタフェース(図示省略)を備える。
The
ホスト計算機120は、ストリームデータ処理サーバ100が処理するストリームデータ(入力タプル121)を送信する。なお、入力タプル121は、複数のホスト計算機120を含むシステムから送信されてもよい。
The
ホスト計算機140は、ストリームデータ処理サーバ100によって処理された出力タプル141を受信する。なお、出力タプル141は、複数のホスト計算機140を含むシステムが受信してもよい。
The host computer 140 receives the
ホスト計算機130は、クエリ登録インタフェース131を実現するためのプログラムを実行する。クエリ登録インタフェース131は、分析シナリオ132を登録し、また、当該分析シナリオ132の実行を命令するためのインタフェースである。
The
ここで、分析シナリオ132は、一つ以上のクエリを含む。また、クエリは、一つ以上のオペレータを含む。オペレータは、ストリームデータ処理における最小単位の処理を示す。オペレータは、例えば、データの抽出処理、データの集約処理等が対応する。
Here, the
本実施例の分析シナリオ132には、一つ以上の入力ストリームを定義するストリーム定義情報、及び一つ以上のクエリを定義するクエリ定義情報が含まれる。なお、分析シナリオ132の詳細については、図3を用いて後述する。
The
ストリームデータ処理サーバ100は、分析シナリオ132が入力されると、当該分析シナリオ132を分析し、所定のストリームデータ処理を実行するためのクエリグラフを構成する。ストリームデータ処理サーバ100は、クエリグラフにしたがって、ストリームデータ(入力タプル121)を処理する。
When the
図2は、本発明の実施例1におけるストリームデータ処理部110の構成例を示すブロック図である。
FIG. 2 is a block diagram illustrating a configuration example of the stream
ストリームデータ処理部110は、クエリパーサ201、クエリ構築部203、クエリ実行部210、タプル入力部221、及びタプル出力部222を備える。また、ストリームデータ処理部110は、クエリグラフ構成情報202を保持する。
The stream
クエリパーサ201は、分析シナリオ132の入力を受け付け、受け付けた分析シナリオ132を解析し、解析結果に基づいてクエリグラフを生成する。生成されたクエリグラフに関する情報は、クエリグラフ構成情報202として保持される。クエリグラフ構成情報202の詳細については、図4を用いて後述する。
The
前述したように、分析シナリオには一つ以上のオペレータが含まれる。したがって、クエリグラフは、一つ以上のオペレータから構成される。 As described above, the analysis scenario includes one or more operators. Therefore, the query graph is composed of one or more operators.
図2に示す例では、オペレータ1、オペレータ2、オペレータ3、オペレータ4、オペレータ5、及びオペレータ6から構成されるクエリグラフを示す。なお、本発明は、オペレータの処理内容に限定されない。
In the example illustrated in FIG. 2, a query graph including an
クエリ構築部203は、クエリグラフ構成情報202に基づいて、オペレータ実行部211を生成し、生成されたオペレータ実行部211をクエリ実行部210に出力する。
The
オペレータ実行部211は、クエリグラフに含まれるオペレータの具体的な処理を実行するモジュールである。オペレータ実行部211には、処理対象のタプル、タプルに含まれるカラム、及び処理に使う関数等の、処理の実行に必要な設定情報が含まれる。本実施例では、さらに、オペレータのデータ格納領域の設定情報が含まれる。 The operator execution unit 211 is a module that executes specific processing of the operator included in the query graph. The operator execution unit 211 includes setting information necessary for execution of processing, such as processing target tuples, columns included in the tuples, and functions used for processing. In the present embodiment, setting information of the operator's data storage area is further included.
ここで、データ格納領域は、オペレータに対応するオペレータ実行部211が一時的にタプルを保持する記憶領域である。また、データ格納領域の設定情報は、データ格納領域に保持されるデータの構造を設定するための情報であり、例えば、多次元配列のデータ構造を設定するための情報が考えられる。データ格納領域の設定情報の例は、図6を用いて後述する。 Here, the data storage area is a storage area in which the operator execution unit 211 corresponding to the operator temporarily holds tuples. The data storage area setting information is information for setting the structure of data held in the data storage area. For example, information for setting the data structure of a multidimensional array can be considered. An example of the setting information of the data storage area will be described later with reference to FIG.
クエリ構築部203は、クエリ最適化部204を含む。クエリ最適化部204は、クエリグラフ構成情報202に基づいて、分析シナリオ132を解析し、各オペレータのデータ格納領域の管理方法を決定する。
The
本実施例では、クエリグラフに含まれるオペレータとして、Partitionウィンドウ演算に対応するオペレータ、Joinオペレータ、及びGroupByオペレータを想定する。したがって、クエリ最適化部204は、Partitionウィンドウ最適化部205、Joinオペレータ最適化部206、及びGroupByオペレータ最適化部207を含む。
In the present embodiment, as operators included in the query graph, an operator corresponding to a Partition window operation, a Join operator, and a GroupBy operator are assumed. Therefore, the
Partitionウィンドウ最適化部205は、Partitionウィンドウ演算に対応するオペレータのデータ格納領域の管理方法を決定する。Joinオペレータ最適化部206は、Joinオペレータのデータ格納領域の管理方法を決定する。GroupByオペレータ最適化部207は、GroupByオペレータのデータ格納領域の管理方法を決定する。
The partition
本実施例では、クエリ最適化部204が、各オペレータのデータ格納領域の管理方法を決定し、当該処理結果を出力する。クエリ構築部203は、当該処理結果に基づいて、各オペレータに対応するオペレータ実行部211を生成する。
In this embodiment, the
なお、クエリ最適化部204が実行する処理の詳細については、図5から図8を用いて後述する。
Details of processing executed by the
タプル入力部221は、ストリームデータ(入力タプル121)の入力を受け付ける。また、タプル入力部221は、受け付けたストリームデータ(入力タプル121)をクエリ実行部210に出力する。
The
クエリ実行部210は、入力タプル121を用いてストリームデータ処理を実行し、また、処理結果をタプル出力部222に出力する。
The
クエリ実行部210は、クエリグラフを構成するオペレータ毎に、オペレータ実行部を含む。図2に示す例では、クエリ実行部210には、オペレータ1実行部211−1、オペレータ2実行部211−2、オペレータ3実行部211−3、オペレータ4実行部211−4、オペレータ5実行部211−5、及びオペレータ6実行部211−6が含まれる。
The
以下の説明では、各オペレータ実行部211−1、211−2、211−3、211−4、211−5、211−6を区別しない場合、オペレータ実行部211とも記載する。 In the following description, the operator execution units 211-1, 211-2, 211-3, 211-4, 211-5, and 211-6 are also referred to as operator execution units 211 when not distinguished.
タプル出力部222は、クエリ実行部210から出力された処理結果を、出力タプル141としてホスト計算機140に送信する。
The
図3は、本発明の実施例1の分析シナリオ132の一例を示す説明図である。
FIG. 3 is an explanatory diagram illustrating an example of the
図3に示す分析シナリオ132は、行列Aと行列Bの各成分を表現するストリーム定義情報、及び両行列の積を算出するための一つのクエリ定義情報から構成される。
The
なお、カラム「i」は行列の行に対応するインデクス、カラム「j」は行列の列に対応するインデクス、カラム「v」は行列成分の値を表す。また、カラム「A.i」は行列Aのカラム「i」、カラム「A.j」は行列Aのカラム「j」、カラム「A.v」は行列Aのカラム「v」を表す。行列Bについても同様である。 The column “i” represents an index corresponding to a matrix row, the column “j” represents an index corresponding to a matrix column, and the column “v” represents a matrix component value. The column “A.i” represents the column “i” of the matrix A, the column “A.j” represents the column “j” of the matrix A, and the column “A.v” represents the column “v” of the matrix A. The same applies to the matrix B.
図3に示すクエリCでは、以下のような行列の積の演算が定義される。 In the query C shown in FIG. 3, the following matrix product operations are defined.
まず、PARTITIONウィンドウの指定に従って、ストリームデータAのカラム「i」、及びカラム「j」の組合せに対してカラム「v」の値が一つだけ抽出される。同様に、ストリームデータBのカラム「i」、カラム「j」の組合せに対してカラム「v」の値が一つだけ抽出される。 First, only one value of the column “v” is extracted for the combination of the column “i” and the column “j” of the stream data A according to the designation of the PARTION window. Similarly, only one value of the column “v” is extracted for the combination of the column “i” and the column “j” of the stream data B.
次に、WHERE句の指定に従って、カラム「A.j」及びカラム「B.i」が一致するタプルが結合される。 Next, tuples matching the columns “A.j” and “B.i” are combined according to the specification of the WHERE clause.
次に、GROUP BY句の指定に従って、カラム「A.i」及び「B.j」の組合せ毎にタプルのグループ分けが行われ、SELECT句の指定に従って、グループ内のタプルのカラム「A.v」とカラム「B.v」との積の総和が算出される。 Next, tuples are grouped for each combination of the columns “A.i” and “B.j” according to the specification of the GROUP BY clause, and the tuple columns “A.v” within the group according to the specification of the SELECT clause. ”And the column“ Bv ”is calculated.
本実施例では、入力ストリームを定義するREGISTER STREAM句に、インデクスに対応するカラムが配列インデクス型カラムであることを指定する文字列「ARRAY_INDEX」を用いる。 In this embodiment, a character string “ARRAY_INDEX” that specifies that the column corresponding to the index is an array index type column is used in the REGISTER STREAM clause that defines the input stream.
ここで、配列インデクス型カラムは、カラムの値域が1から連続する整数であるカラムを表す。なお、以下の説明では、配列インデクス型カラム以外のカラムを通常型カラムとも記載する。 Here, the array index type column represents a column whose value range is an integer that continues from 1. In the following description, columns other than the array index type column are also referred to as normal type columns.
図3に示す例では、入力ストリームAのカラム「i」及びカラム「j」、並びに、入力ストリームBのカラム「i」及びカラム「j」が、配列インデクス型カラムとして指定されている。 In the example illustrated in FIG. 3, the column “i” and the column “j” of the input stream A and the column “i” and the column “j” of the input stream B are designated as the array index type columns.
図4は、本発明の実施例1のクエリグラフ構成情報202の一例を示す説明図である。
FIG. 4 is an explanatory diagram illustrating an example of the query
クエリグラフ構成情報202は、複数の情報(テーブル)を含む。具体的には、クエリグラフ構成情報202は、オペレータ管理情報410、Partitionウィンドウ管理情報420、Joinオペレータ管理情報430、及びGroupByオペレータ管理情報440を含む。
The query
オペレータ管理情報410は、クエリグラフに含まれる全てのオペレータの概要を管理するための情報である。オペレータ管理情報410は、オペレータID411、タイプ412、及び入力413を含む。
The
オペレータID411は、クエリグラフに含まれるオペレータを一意に識別するための識別情報である。
The
タイプ412は、オペレータの種別を示す情報である。本実施例では、「Partition」、「Join」又は「GroupBy」のいずれかの情報がタイプ412に格納される。
入力413は、オペレータに対して入力されるデータの識別情報である。
The
Partitionウィンドウ管理情報420は、Partitionウィンドウ演算に対応するオペレータの詳細情報である。Partitionウィンドウ管理情報420は、オペレータID421、入力カラム422、Groupingカラム423、Array Indexカラム424、及びウィンドウサイズ425を含む。
The partition
オペレータID421は、オペレータID411と同一のものである。
The
入力カラム422は、Partitionウィンドウ演算に対応するオペレータに入力されるタプルに含まれるカラムの識別情報である。
The
Groupingカラム423は、Partitionウィンドウ演算におけるグループ分け対象のカラムの識別情報である。なお、Partitionウィンドウ演算では、複数のタプルの集合から複数の部分集合(グループ)が生成される。
A
Array Indexカラム424は、配列インデクス型カラムに対応するカラムの識別情報である。
The
ウィンドウサイズ425は、部分集合に含まれる要素の数を示す。図4に示す例では、カラム「i」とカラム「j」との組合せに対して、同時に生存できるタプルが高々一つに限られることを示す。したがって、カラム「i」が「1」、カラム「j」が「2」のタプルが入力された後、新たに、カラム「i」が「1」、カラム「j」が「2」のタプルが入力されると、新たなタプルのみが存在することができる。
The
Joinオペレータ管理情報430は、Joinオペレータの詳細情報である。Joinオペレータ管理情報430は、オペレータID431、入力カラム432、Joinカラム433、及びArray Indexカラム434を含む。
Join
オペレータID431は、オペレータID411と同一のものである。
The
入力カラム432は、Joinオペレータに入力されるタプルに含まれるカラムの識別情報である。
The
Joinカラム433は、結合対象のカラムの識別情報である。
The
Array Indexカラム434は、配列インデクス型カラムに対応するカラムの識別情報である。
The
GroupByオペレータ管理情報440は、GroupByオペレータの詳細情報である。GroupByオペレータ管理情報440は、オペレータID441、入力カラム442、Groupingカラム443、及びArray Indexカラム444を含む。
The GroupBy
オペレータID441は、オペレータID411と同一のものである。
The
入力カラム442は、GroupByオペレータに入力されるタプルに含まれるカラムの識別情報である。
The
Groupingカラム443は、GroupByオペレータにおけるグループ分け対象のカラムの識別情報である。
The
Array Indexカラム444は、配列インデクス型カラムに対応するカラムの識別情報である。
The
図5は、本発明の実施例1のストリームデータ処理部110が分析シナリオ132の登録時に実行する処理を説明するフローチャートである。
FIG. 5 is a flowchart for describing processing executed by the stream
ストリームデータ処理部110は、分析シナリオ132を受け付けると(ステップS501)、当該分析シナリオ132に基づいて、クエリグラフ構成情報202を生成する(ステップS502)。具体的には、以下のような処理が実行される。なお、ここでは、図3に示す分析シナリオ132を受け付けたものとする。
Upon receiving the analysis scenario 132 (step S501), the stream
まず、クエリパーサ201は、分析シナリオ132に基づいて、クエリCに含まれるオペレータを特定する。本実施例では、クエリパーサ201は、クエリCの定義情報から、二つのPartitionウィンドウ演算に対応するオペレータ、一つのJoinオペレータ、及びの一つのGroupByオペレータを特定する。
First, the
クエリパーサ201は、オペレータ管理情報410、Partitionウィンドウ管理情報420、Joinオペレータ管理情報430、及びGroupByオペレータ管理情報440を初期化する。
The
クエリパーサ201は、特定されたオペレータに「1」から「4」の識別番号を付与する。例えば、クエリパーサ201は、オペレータの実行順序に識別番号を付与する。
The
クエリパーサ201は、オペレータ管理情報410にエントリを生成し、生成されたエントリのオペレータID411に付与された識別番号を格納し、タイプ412に各オペレータの識別情報を格納する。
The
また、クエリパーサ201は、クエリCの定義情報から各オペレータの入出力関係を解析し、解析結果に基づいて入力413に入力されるデータの識別情報を格納する。例えば、オペレータID411が「1」のエントリは、入力ストリームAが入力されるPartitionウィンドウ演算に対応するオペレータであるため、タイプ412には「Partition」が格納され、入力413には「Stream A」が格納される。
Further, the
次に、クエリパーサ201は、各オペレータの管理情報を生成する。本実施例では、Partitionウィンドウ管理情報420、Joinオペレータ管理情報430、及びGroupByオペレータ管理情報440が生成される。
Next, the
Partitionウィンドウ管理情報420は以下のようにして生成される。
The partition
クエリパーサ201は、入力ストリームAの定義情報に基づいて、タプルに含まれるカラムを特定する。また、クエリパーサ201は、入力ストリームAの定義情報に基づいて、配列インデクス型カラムを特定する。本実施例では、クエリパーサ201は、カラムi及びカラムjが配列インデクス型カラムであることが分かる。
The
また、クエリパーサ201は、クエリCの定義情報のFROM句に基づいて、グループ分けの条件、及びウィンドウサイズを特定する。
Further, the
クエリパーサ201は、Partitionウィンドウ管理情報420にエントリを生成し、前述した解析結果に基づいて、生成されたエントリに必要な情報を格納する。入力ストリームBが入力されるPartitionウィンドウ演算に対応するオペレータについても同様の処理が実行される。
The
Joinオペレータ管理情報430は以下のようにして生成される。
Join
クエリパーサ201は、入力ストリームAの定義情報、入力ストリームBの定義情報、及びクエリCの定義情報のWHERE句に基づいて、タプルに含まれるカラム、及び結合条件を特定する。
The
また、クエリパーサ201は、入力ストリームAの定義情報、及び入力ストリームBの定義情報に基づいて、タプルに含まれるカラムの中から配列インデクス型カラムを特定する。
In addition, the
本実施例では、カラム「i」及びカラム「j」が配列インデクス型カラムとして指定されているため、クエリパーサ201は、当該カラムに対応するカラム「Ai」、カラム「Aj」、カラム「Bi」、及びカラム「Bj」も配列インデクス型カラムであることが分かる。
In this embodiment, since the column “i” and the column “j” are designated as the array index type column, the
クエリパーサ201は、Joinオペレータ管理情報430にエントリを生成し、前述した解析結果に基づいて、生成されたエントリに必要な情報を格納する。
The
GroupByオペレータ管理情報440は以下のようにして生成される。
The GroupBy
クエリパーサ201は、入力ストリームAの定義情報、入力ストリームBの定義情報、及びクエリCの定義情報のGROUP BY句に基づいて、タプルに含まれるカラム、及びグループ分けの条件を特定する。また、クエリパーサ201は、入力ストリームAの定義情報、及びストリームデータBの定義情報に基づいて、タプルに含まれるのカラムの中から配列インデクス型カラムを特定する。
The
本実施例では、カラム「i」及びカラム「j」が配列インデクス型カラムとして指定されているため、クエリパーサ201は、当該カラムに対応するカラム「Ai」、カラム「Aj」、カラム「Bi」、及びカラム「Bj」も配列インデクス型カラムであることが分かる。
In this embodiment, since the column “i” and the column “j” are designated as the array index type column, the
クエリパーサ201は、GroupByオペレータ管理情報440にエントリを生成し、解析結果に基づいて、生成されたエントリに必要な情報を格納する。
The
以上が、ステップS502の処理の説明である。なお、前述した処理は一例であって本発明はこれに限定されない。 The above is the description of the process in step S502. The above-described processing is an example, and the present invention is not limited to this.
次に、ストリームデータ処理部110は、オペレータのループ処理を開始する(ステップS503)。具体的には、以下のような処理が実行される。
Next, the stream
ストリームデータ処理部110は、クエリ構築部203を呼び出し、処理の開始を指示する。クエリ構築部203は、クエリ最適化部204を呼び出し、処理の開始を指示する。
The stream
クエリ最適化部204は、クエリグラフ構成情報202のオペレータ管理情報410を参照し、分析シナリオ132に含まれるオペレータの中から処理対象のオペレータを一つ選択する。ここでは、オペレータ管理情報410の上のエントリから順に選択するものとする。なお、本発明は、オペレータの選択方法に限定されない。
The
クエリ最適化部204は、選択されたオペレータがPartitionウィンドウ演算に対応するオペレータであるか否かを判定する(ステップS504)。
The
具体的には、クエリ最適化部204は、選択されたオペレータに対応するエントリのタイプ412が「Partition」であるか否かを判定する。タイプ412が「Partition」である場合、クエリ最適化部204は、選択されたオペレータがPartitionウィンドウ演算に対応するオペレータであると判定する。
Specifically, the
選択されたオペレータがPartitionウィンドウ演算に対応するオペレータでないと判定された場合、クエリ最適化部204は、ステップS506に進む。
If it is determined that the selected operator is not an operator corresponding to the Partition window calculation, the
選択されたオペレータがPartitionウィンドウ演算に対応するオペレータであると判定された場合、クエリ最適化部204は、Partitionウィンドウ最適化部205を呼び出し、処理の開始を指示する(ステップS505)。なお、Partitionウィンドウ最適化部205が実行する処理については、図6を用いて後述する。
When it is determined that the selected operator is an operator corresponding to the Partition window calculation, the
クエリ最適化部204は、Partitionウィンドウ最適化部205から処理結果が出力されるまで待ち状態となる。
The
クエリ最適化部204は、選択されたオペレータがJoinオペレータであるか否かを判定する(ステップS506)。
The
具体的には、クエリ最適化部204は、選択されたオペレータに対応するエントリのタイプ412が「Join」であるか否かを判定する。タイプ412が「Join」である場合、クエリ最適化部204は、選択されたオペレータがJoinオペレータであると判定する。
Specifically, the
選択されたオペレータがJoinオペレータでないと判定された場合、クエリ最適化部204は、ステップS508に進む。
If it is determined that the selected operator is not a Join operator, the
選択されたオペレータがJoinオペレータであると判定された場合、クエリ最適化部204は、Joinオペレータ最適化部206を呼び出し、処理の開始を指示する(ステップS507)。なお、Joinオペレータ最適化部206が実行する処理については、図7を用いて後述する。
When it is determined that the selected operator is a Join operator, the
クエリ最適化部204は、Joinオペレータ最適化部206から処理結果が出力されるまで待ち状態となる。
The
クエリ最適化部204は、選択されたオペレータがGroupByオペレータであるか否かを判定する(ステップS508)。
The
具体的には、クエリ最適化部204は、選択されたオペレータに対応するエントリのタイプ412が「GroupBy」であるか否かを判定する。タイプ412が「GroupBy」である場合、クエリ最適化部204は、選択されたオペレータがGroupByオペレータであると判定する。
Specifically, the
選択されたオペレータがGroupByオペレータでないと判定された場合、クエリ最適化部204は、ステップS510に進む。
If it is determined that the selected operator is not a GroupBy operator, the
選択されたオペレータがGroupByオペレータであると判定された場合、クエリ最適化部204は、GroupByオペレータ最適化部207を呼び出し、処理の開始を指示する(ステップS509)。
If it is determined that the selected operator is a GroupBy operator, the
クエリ最適化部204は、GroupByオペレータ最適化部207から処理結果が出力されるまで待ち状態となる。クエリ最適化部204は、GroupByオペレータ最適化部207から処理結果が出力された後、Partitionウィンドウ最適化部205、Joinオペレータ最適化部206、又はGroupByオペレータ最適化部207から出力された処理結果をクエリ構築部203に出力し、処理を終了する。
The
クエリ構築部203は、クエリグラフ構成情報202、及びクエリ最適化部204から出力された処理結果に基づいて、オペレータ実行部211を生成する(ステップS510)。具体的には、以下のような処理が実行される。
The
クエリ構築部203は、クエリグラフ構成情報202に基づいて、処理の実行に必要な設定情報を生成し、また、クエリ最適化部204から出力された処理結果に基づいて、オペレータのデータ格納領域の設定情報を生成する。
The
クエリ構築部203は、生成された各設定情報に基づいて、オペレータ実行部211を生成する。また、クエリ構築部203は、生成されたオペレータ実行部211をクエリ実行部210に登録する。
The
以上がステップS510の処理の説明である。 The above is the description of step S510.
次に、クエリ最適化部204は、分析シナリオ132に含まれる全てのオペレータについて処理を完了したか否かを判定する(ステップS511)。
Next, the
分析シナリオ132に含まれる全てのオペレータについて処理が完了していないと判定された場合、クエリ最適化部204は、ステップS503に戻り、同様の処理を実行する。
When it is determined that the processing has not been completed for all operators included in the
分析シナリオ132に含まれる全てのオペレータについて処理が完了したと判定された場合、クエリ最適化部204は、処理を終了する。
When it is determined that the processing has been completed for all operators included in the
なお、ストリームデータ処理部110は、分析シナリオ132の受付を契機に処理を開始しているが、処理開始の契機はこれに限定されない。例えば、ストリームデータ処理部110は、受け付けた分析シナリオ132をストレージ装置105等に格納し、ユーザ等から処理開始の指示が入力された場合に、処理を開始してもよい。
Note that the stream
図6は、本発明の実施例1のPartitionウィンドウ最適化部205が実行する処理を説明するフローチャートである。
FIG. 6 is a flowchart illustrating processing executed by the partition
Partitionウィンドウ最適化部205は、クエリ最適化部204から呼び出されると以下で説明する処理を開始する。このとき、クエリ最適化部204は、処理対象のオペレータの識別情報(オペレータID)を出力する。
When the partition
Partitionウィンドウ最適化部205は、クエリグラフ構成情報202に含まれるPartitionウィンドウ管理情報420を参照し、グループ分け対象のカラムに配列インデクス型カラムが含まれるか否かを判定する(ステップS601)。具体的には、以下のような処理が実行される。
The partition
Partitionウィンドウ最適化部205は、Partitionウィンドウ管理情報420を参照し、オペレータID421が入力されたオペレータの識別情報と一致するエントリを検索する。
The partition
Partitionウィンドウ最適化部205は、検索されたエントリのGroupingカラム423とArray Indexカラム424とを比較し、Array Indexカラム424に、Groupingカラム423に格納されるカラムと一致するカラムが一つ以上存在するか否かを判定する。
The partition
なお、Groupingカラム423がグループ分け対象のカラムに対応し、Array Indexカラム424が配列インデクス型カラムに対応する。
The
Array Indexカラム424に、Groupingカラム423に格納されるカラムと一致するカラムが一つ以上存在する場合、Partitionウィンドウ最適化部205は、グループ分け対象のカラムに配列インデクス型カラムが含まれると判定する。
If there is at least one column in the
以上がステップS601の処理の説明である。 The above is the description of the process in step S601.
グループ分け対象のカラムに配列インデクス型カラムが含まれないと判定された場合、Partitionウィンドウ最適化部205は、データ格納領域の設定情報が必要ない旨を処理結果として、クエリ最適化部204に出力し(ステップS606)、処理を終了する。
When it is determined that the column to be grouped does not include an array index type column, the Partition
グループ分け対象のカラムに配列インデクス型カラムが含まれると判定された場合、Partitionウィンドウ最適化部205は、Partitionウィンドウ管理情報420に基づいて、グループ分け対象のカラムを配列インデクス型カラムと通常型カラムとに分類する(ステップS602)。
If it is determined that the column to be grouped includes an array index type column, the Partition
Partitionウィンドウ最適化部205は、分類結果に基づいて、グループ分け対象のカラムの中に通常型カラムが含まれるか否かを判定する(ステップS603)。
The partition
例えば、Groupingカラム423に格納される全てのカラムの識別情報が、Array Indexカラム424に格納される場合、Partitionウィンドウ最適化部205は、グループ分け対象のカラムの中に、通常型カラムが含まれないと判定する。
For example, when the identification information of all the columns stored in the
図4に示す例では、Partitionウィンドウ最適化部205は、グループ分け対象のカラムの中に通常型カラムが含まれないと判定する。
In the example illustrated in FIG. 4, the partition
グループ分け対象のカラムの中に、通常型カラムが含まれないと判定された場合、Partitionウィンドウ最適化部205は、データ格納領域におけるデータ構造を決定する(ステップS604)。その後、Partitionウィンドウ最適化部205は、決定されたデータ格納領域におけるデータ構造の情報を処理結果として出力し(ステップS606)、処理を終了する。
If it is determined that the normal column is not included in the grouping target column, the partition
具体的には、Partitionウィンドウ最適化部205は、配列インデクス型カラムの数と同数の次元の配列としてタプルを保持するように決定する。
Specifically, the partition
図4に示す例では、Array Indexカラム424には、カラム「i」、「j」の二つ2つのカラムの識別情報が格納される。したがって、Partitionウィンドウ最適化部205は、2次元配列としてタプルを保持するように決定する。
In the example illustrated in FIG. 4, the
グループ分け対象のカラムの中に通常型カラムが含まれると判定された場合、Partitionウィンドウ最適化部205は、データ格納領域におけるデータ構造を決定する(ステップS605)。その後、Partitionウィンドウ最適化部205は、決定されたデータ格納領域におけるデータ構造の情報を処理結果として出力し(ステップS606)、処理を終了する。
If it is determined that the normal type column is included in the grouping target column, the partition
具体的には、Partitionウィンドウ最適化部205は、通常型カラムをキーとし、配列インデクス型カラムの数と同数の次元の配列を値とするハッシュマップとしてタプルを保持するように決定する。
Specifically, the partition
例えば、配列インデクス型カラム「i」、「j」、通常型カラム「k」を含むタプルの場合、Partitionウィンドウ最適化部205は、通常型カラム「k」をキーとし、2次元配列を値とするハッシュマップとしてタプルを保持するように決定する。
For example, in the case of a tuple including an array index type column “i”, “j”, and a normal type column “k”, the partition
以上のように決定したデータ構造は、データ格納領域の設定情報として、オペレータ実行部211に保持する。オペレータ実行部211は、クエリ実行時に、当該設定情報に従って各タプルのデータを一時保存する。 The data structure determined as described above is held in the operator execution unit 211 as setting information of the data storage area. The operator execution unit 211 temporarily stores data of each tuple according to the setting information when executing a query.
当該設定情報は、データ格納領域の形態(すなわち、多次元配列又はハッシュマップの何れであるか)と、多次元配列又はハッシュマップに関する情報から構成される。多次元配列又はハッシュマップに関する情報は、多次元配列の場合、各次元の配列インデクス型カラムの名前が含まれ、ハッシュマップの場合、ハッシュマップのキーとなる通常型カラムの名前、及びハッシュマップの値となる多次元配列の、各次元の配列インデクス型カラムの名前が含まれる。 The setting information includes a data storage area form (that is, a multi-dimensional array or a hash map) and information related to the multi-dimensional array or the hash map. In the case of a multidimensional array, the information about the multidimensional array or hash map includes the name of the array index type column of each dimension. In the case of a hash map, the name of the normal type column that is the key of the hash map, and the hash map Contains the name of the array index type column for each dimension of the multidimensional array that is the value.
例えば、上記の二つの例における設定情報は、(形態=多次元配列,配列インデクスカラム=「i」、「j」)、及び(形態=ハッシュマップ,ハッシュキーカラム=「k」,配列インデクスカラム=「i」、「j」)のように表現される。 For example, the setting information in the above two examples includes (form = multidimensional array, array index column = “i”, “j”), and (form = hash map, hash key column = “k”, array index column = “I”, “j”).
図7は、本発明の実施例1のJoinオペレータ最適化部206が実行する処理を説明するフローチャートである。
FIG. 7 is a flowchart illustrating processing executed by the Join
Joinオペレータ最適化部206は、クエリ最適化部204から呼び出されると以下で説明する処理を開始する。このとき、クエリ最適化部204は、処理対象のオペレータの識別情報(オペレータID)を出力する。
When called from the
Joinオペレータ最適化部206は、クエリグラフ構成情報202に含まれるJoinオペレータ管理情報430を参照し、入力スキーマに配列インデクス型カラムが含まれるか否かを判定する(ステップS701)。具体的には、以下のような処理が実行される。
The Join
Joinオペレータ最適化部206は、オペレータ管理情報410を参照し、オペレータID411が入力されたオペレータの識別情報と一致するエントリを検索する。
The Join
Joinオペレータ最適化部206は、検索されたエントリの入力413を参照し、入力先のオペレータの識別情報を取得する。また、Joinオペレータ最適化部206は、検索されたエントリのタイプ412に基づいて、参照する管理情報を特定する。
The Join
図4に示す例では、オペレータID411が「1」、「2」のタイプ412が「Partition」であるため、Joinオペレータ最適化部206は、Partitionウィンドウ管理情報420を参照する。
In the example shown in FIG. 4, since the
Joinオペレータ最適化部206は、Partitionウィンドウ管理情報420を参照し、取得されたオペレータの識別情報と一致するエントリを検索する。Joinオペレータ最適化部206は、検索されたエントリのArray Indexカラム424に格納されるカラムの識別情報を取得する。
The Join
Joinオペレータ最適化部206は、Joinオペレータ管理情報430を参照し、オペレータID431が入力されたオペレータの識別情報と一致するエントリを検索する。
The Join
Joinオペレータ最適化部206は、検索されたエントリの入力カラム432から、入力スキーマのカラムの識別情報を取得する。
The Join
Joinオペレータ最適化部206は、Array Indexカラム424から取得されたカラムの識別情報と、入力カラム432から取得されたカラムの識別情報とを比較し、Array Indexカラム424に格納されるカラムと一致するカラムが入力カラム432に一つ以上存在するか否かを判定する。
The Join
Array Indexカラム424に格納されるカラムと一致するカラムが入力カラム432に一つ以上存在する場合、Joinオペレータ最適化部206は、入力スキーマに配列インデクス型カラムが含まれると判定する。
If there is at least one column in the
以上がステップS701の処理の説明である。 The above is the description of the processing in step S701.
入力スキーマに配列インデクス型カラムが含まれないと判定された場合、Joinオペレータ最適化部206は、データ格納領域の設定情報が必要ない旨を処理結果として、クエリ最適化部204に出力し(ステップS704)、処理を終了する。
When it is determined that the array index type column is not included in the input schema, the Join
入力スキーマに配列インデクス型カラムが含まれると判定された場合、Joinオペレータ最適化部206は、Joinオペレータにおける結合条件が配列インデクス型カラムに関する結合条件であるか否かを判定する(ステップS702)。具体的には、以下のような処理が実行される。
When it is determined that the array index type column is included in the input schema, the Join
Joinオペレータ最適化部206は、Partitionウィンドウ管理情報420から検索されたエントリのArray Indexカラム424と、Joinオペレータ管理情報430から検索されたエントリのJoinカラム433とを参照する。
The Join
Joinオペレータ最適化部206は、Joinカラム433に格納される結合条件が配列インデクス型カラムに関する結合条件であるか否かを判定する。
The Join
図4に示す例では、Joinカラム433には、配列インデクス型カラムであるカラム「A.j」とカラム「B.i」に関する結合条件が格納される。したがって、Joinオペレータ最適化部206は、Joinオペレータにおける結合条件が配列インデクス型カラムに関する結合条件であると判定する。
In the example illustrated in FIG. 4, the
以上がステップS702の処理の説明である。 The above is the description of the processing in step S702.
Joinオペレータにおける結合条件が配列インデクス型カラムに関する結合条件でないと判定された場合、Joinオペレータ最適化部206は、データ格納領域の設定情報が必要ない旨を処理結果として、クエリ最適化部204に出力し(ステップS704)、処理を終了する。
When it is determined that the join condition in the Join operator is not a join condition related to the array index type column, the Join
Joinオペレータにおける結合条件が配列インデクス型カラムに関する結合条件であると判定された場合、Joinオペレータ最適化部206は、データ格納領域におけるデータ構造を決定する(ステップS703)。その後、Joinオペレータ最適化部206は、決定されたデータ格納領域におけるデータ構造の情報を処理結果として出力し(ステップS704)、処理を終了する。
When it is determined that the join condition in the Join operator is a join condition related to the array index type column, the Join
具体的には、Joinオペレータ最適化部206は、配列インデクス型カラムの数と同数の次元の配列としてタプルを保持するように決定する。
Specifically, the Join
図4に示す例では、ストリームデータAのArray Indexカラム424には、カラム「i」、「j」の二つのカラムの識別情報が格納される。したがって、Joinオペレータ最適化部206は、2次元配列として入力ストリームAに含まれるタプルを保持するように決定する。ストリームデータBについても同様である。
In the example shown in FIG. 4, the identification information of the two columns “i” and “j” is stored in the
図8は、本発明の実施例1のGroupByオペレータ最適化部207が実行する処理を説明するフローチャートである。
FIG. 8 is a flowchart illustrating processing executed by the GroupBy
GroupByオペレータ最適化部207は、クエリ最適化部204から呼び出されると以下で説明する処理を開始する。このとき、クエリ最適化部204は、処理対象のオペレータの識別情報(オペレータID)を出力する。
When called from the
GroupByオペレータ最適化部207は、クエリグラフ構成情報202に含まれるGroupByオペレータ管理情報440を参照し、グループ分け対象のカラムに配列インデクス型カラムが含まれるか否かを判定する(ステップS801)。具体的には、以下のような処理が実行される。
The GroupBy
GroupByオペレータ最適化部207は、GroupByオペレータ管理情報440を参照し、オペレータID441が入力されたオペレータの識別情報と一致するエントリを検索する。
The GroupBy
GroupByオペレータ最適化部207は、検索されたエントリのGroupingカラム443とArray Indexカラム444とを比較し、Groupingカラム443に格納されるカラムと一致するカラムがArray Indexカラム444に一つ以上存在するか否かを判定する。
The GroupBy
Groupingカラム443に格納されるカラムと一致するカラムが一つ以上存在する場合、GroupByオペレータ最適化部207は、グループ分け対象のカラムに配列インデクス型カラムが含まれると判定する。
If there is one or more columns that match the columns stored in the
以上がステップS801の処理の説明である。 The above is the description of the process in step S801.
グループ分け対象のカラムに配列インデクス型カラムが含まれないと判定された場合、GroupByオペレータ最適化部207は、データ格納領域の設定情報が必要ない旨を処理結果として、クエリ最適化部204に出力し(ステップS806)、処理を終了する。
When it is determined that the column to be grouped does not include an array index type column, the GroupBy
グループ分け対象のカラムに配列インデクス型カラムが含まれると判定された場合、GroupByオペレータ最適化部207は、GroupByオペレータ管理情報440に基づいて、グループ分け対象のカラムを配列インデクス型カラムと通常型カラムとに分類する(ステップS802)。
When it is determined that the column to be grouped includes an array index type column, the GroupBy
GroupByオペレータ最適化部207は、分類結果に基づいて、グループ分け対象のカラムの中に通常型カラムが含まれるか否かを判定する(ステップS803)。
The GroupBy
例えば、Groupingカラム443に格納される全てのカラムの識別情報が、Array Indexカラム444に格納される場合、GroupByオペレータ最適化部207は、グループ分け対象のカラムの中に、通常型カラムが含まれないと判定する。
For example, when the identification information of all the columns stored in the
図4に示す例では、Array Indexカラム444に、Groupingカラム443に格納される全てのカラム「A.i」、カラム「B.j」が格納されるため、GroupByオペレータ最適化部207は、グループ分け対象のカラムの中に、通常型カラムが含まれないと判定する。
In the example shown in FIG. 4, since all the columns “A.i” and “B.j” stored in the
グループ分け対象のカラムの中に通常型カラムが含まれないと判定された場合、GroupByオペレータ最適化部207は、データ格納領域におけるデータ構造を決定する(ステップS804)。その後、GroupByオペレータ最適化部207は、決定されたデータ格納領域におけるデータ構造の情報を処理結果として出力し(ステップS806)、処理を終了する。
When it is determined that the normal column is not included in the grouping target column, the GroupBy
具体的には、GroupByオペレータ最適化部207は、配列インデクス型カラム、かつ、グループ分け対象のカラムであるカラムの数と同数の次元の配列として集計値を保持するように決定する。
Specifically, the GroupBy
図4に示す例では、Array Indexカラム444には、カラム「A.i」、カラム「A.j」、カラム「B.i」、及びカラム「B.j」が格納され、Groupingカラム443には、カラム「A.i」、及びカラム「B.j」が格納される。そのため、配列インデクス型カラム、かつ、Groupingカラムであるカラムの数は「2」となる。したがって、GroupByオペレータ最適化部207は、2次元配列として集計値を保持するように決定する。
In the example illustrated in FIG. 4, the column “A.i”, the column “A.j”, the column “B.i”, and the column “B.j” are stored in the
グループ分け対象のカラムの中に通常型カラムが含まれると判定された場合、GroupByオペレータ最適化部207は、データ格納領域におけるデータ構造を決定する(ステップS805)。その後、GroupByオペレータ最適化部207は、決定されたデータ格納領域におけるデータ構造の情報を処理結果として出力し(ステップS806)、処理を終了する。
If it is determined that the normal column is included in the grouping target column, the GroupBy
具体的には、GroupByオペレータ最適化部207は、通常型カラムをキーとし、配列インデクス型カラム、かつ、グループ分け対象の数と同数の次元の配列を値とするハッシュマップとしてタプルを保持するように決定する。
Specifically, the GroupBy
例えば、配列インデクス型カラム「A.i」、「B.j」、通常型カラム「A.k」を含むタプルの場合、GroupByオペレータ最適化部207は、通常型カラム「A.k」をキーとし、2次元配列を値とするハッシュマップとして集計値を保持するように決定する。
For example, in the case of a tuple including an array index type column “A.i”, “B.j”, and a normal type column “A.k”, the GroupBy
以上が、各最適化部が実行する処理の説明である。本実施例では、各最適化部が、配列インデクス型カラム等の情報に基づいて、処理に最適なデータ構造を決定する。また、クエリ構築部203は、図6から図8を用いて説明した処理結果に基づいて、オペレータのデータ格納領域の設定情報を生成する。これによって、オペレータ実行部211は、クエリの実行時に、当該データ格納領域の設定情報に基づいて、処理に最適なデータ構造のデータを管理できる。
The above is description of the process which each optimization part performs. In this embodiment, each optimization unit determines a data structure optimal for processing based on information such as an array index type column. In addition, the
多次元配列のデータを管理することによって、各オペレータにおける処理の効率を向上させることが可能となる。また、多次元配列として管理する必要がない場合には、通常のタプルとして扱う。これによって、不要なメモリの消費を低減することができる。すなわち、メモリの利用効率を向上させることができる。 By managing the data of the multidimensional array, it is possible to improve the processing efficiency in each operator. When it is not necessary to manage as a multidimensional array, it is handled as a normal tuple. As a result, unnecessary memory consumption can be reduced. That is, the memory utilization efficiency can be improved.
これは、全てのタプルを多次元配列として保持すると、不必要なインデクスが生成されることによって、メモリの消費量が増大する可能性があるためである。そのため、本実施例では、クエリ最適化部204が、クエリグラフの解析結果に基づいて、検索処理の効率化、及びメモリ消費量の削減が可能なデータの管理方法を決定する。
This is because holding all tuples as a multidimensional array may increase memory consumption by generating unnecessary indexes. Therefore, in this embodiment, the
ここで、クエリ実行時におけるデータの取り扱いの一例を説明する。 Here, an example of data handling during query execution will be described.
なお、以下の説明では、クエリ実行部210にクエリグラフに含まれる全てのオペレータのオペレータ実行部211が登録されているものとする。
In the following description, it is assumed that operator execution units 211 of all operators included in the query graph are registered in the
図9は、本発明の実施例1のオペレータ間のデータの流れを示す説明図である。 FIG. 9 is an explanatory diagram illustrating a data flow between operators according to the first embodiment of this invention.
図9に示すクエリグラフは、図3に示す分析シナリオ132に対応するクエリグラフである。図9に示すクエリグラフには、Partitionウィンドウ901−1、901−2、Joinオペレータ902、GroupByオペレータ903の四つのオペレータが含まれる。したがって、クエリ実行部210には、四つのオペレータ実行部211が登録される。
The query graph shown in FIG. 9 is a query graph corresponding to the
以下の説明では、Partitionウィンドウ901−1に対応するオペレータ実行部211を第1のオペレータ実行部と記載し、Partitionウィンドウ901−2に対応するオペレータ実行部211を第2のオペレータ実行部と記載し、Joinオペレータ902に対応するオペレータ実行部211を第3のオペレータ実行部と記載し、GroupByオペレータ903に対応するオペレータ実行部211を第4のオペレータ実行部と記載する。
In the following description, the operator execution unit 211 corresponding to the Partition window 901-1 is described as a first operator execution unit, and the operator execution unit 211 corresponding to the Partition window 901-2 is described as a second operator execution unit. The operator execution unit 211 corresponding to the
Partitionウィンドウ901−1には、カラム「i」、カラム「j」、カラム「v」を含む入力タプル921、922、923が入力される。
In the Partition window 901-1, input
このとき、第1のオペレータ実行部は、入力タプルを2次元配列として保持するように設定されているため、入力タプル921、922、923を、2次元配列としてデータ格納領域911−1に保持する。
At this time, since the first operator execution unit is set to hold the input tuple as a two-dimensional array, the
また、第1のオペレータ実行部は、カラム「i」、カラム「j」の組合せ毎に1つの値を抽出し、カラム「i」、カラム「j」及び抽出された値のカラムから構成されるタプル931、932、933をJoinオペレータ902に出力する。
Further, the first operator execution unit extracts one value for each combination of the column “i” and the column “j”, and includes the column “i”, the column “j”, and the column of the extracted value.
第2のオペレータ実行部も同様に、入力タプル924、925、926を2次元配列としてデータ格納領域911−2に保持する。
Similarly, the second operator execution unit holds the
第3のオペレータ実行部は、Partitionウィンドウ901−1及びPartitionウィンドウ901−2のそれぞれから出力されるタプルを2次元配列として保持するように設定されている。したがって、第3のオペレータ実行部は、タプル931、932、933を2次元配列としてデータ格納領域912に保持し、また、タプル934、935、936を2次元配列としてデータ格納領域912に保持する。
The third operator execution unit is set to hold tuples output from the Partition window 901-1 and the Partition window 901-2 as a two-dimensional array. Therefore, the third operator execution unit holds the
第3のオペレータ実行部は、カラム「A.j」とカラム「B.j」とが一致するタプルを結合するために、入力ストリームAの列の位置と、入力ストリームBの行の位置とが同一となる要素を結合する。 The third operator execution unit combines the tuples in which the columns “A.j” and “B.j” match, so that the column position of the input stream A and the row position of the input stream B are Combine identical elements.
第3のオペレータ実行部は、入力ストリームAの要素の位置をカラム「A.i」、カラム「A.j」とし、入力ストリームBの要素の位置をカラム「B.i」、カラム「B.j」とし、さらに、結合された入力ストリームAの要素をカラム「A.v」、結合された入力ストリームBの要素をカラム「B.v」とするタプル941、942、943を出力する。
The third operator execution unit sets the position of the element of the input stream A to the column “A.i” and the column “A.j”, and sets the position of the element of the input stream B to the column “B.i” and the column “B. j ”, and further,
本実施例では、18個のタプルが出力されることとなる。 In this embodiment, 18 tuples are output.
第4のオペレータ実行部は、カラム「A.i」とカラム[B.j]とに基づいて、Joinオペレータ902から出力されたタプルを複数のグループに分ける。また、第4のオペレータ実行部は、グループ毎に、タプルの要素の積を算出し、さらに、各タプルの積の合計値を算出する。
The fourth operator execution unit includes column “A.i” and column [B. j] and the tuples output from the
第4のオペレータ実行部は、集計結果を2次元配列として保持するように設定されているため、各グループの合計値を2次元配列としてデータ格納領域913に保持する。
Since the fourth operator execution unit is set to hold the total result as a two-dimensional array, the total value of each group is held in the
また、第4のオペレータ実行部は、合計値が格納される位置をカラム「A.i」、カラム「B.j」とし、合計値をカラム「v」とするタプル951、952、953を処理結果として出力する。
In addition, the fourth operator execution unit processes the
以上で説明したように、多次元配列としてデータを管理することによってオペレータの処理効率を向上することができる。また、各オペレータのデータ格納領域に最適なデータ形式が決定されるため、メモリ消費量を低減することができる。 As described above, it is possible to improve the processing efficiency of the operator by managing data as a multidimensional array. In addition, since an optimal data format is determined for each operator's data storage area, memory consumption can be reduced.
図10は、本発明の実施例1におけるオペレータ間のデータの流れを示す説明図である。 FIG. 10 is an explanatory diagram showing the flow of data between operators in the first embodiment of the present invention.
図10は、一つのタプルの値の更新に伴った、データの流れを示す。 FIG. 10 shows the flow of data accompanying the updating of the value of one tuple.
Partitionウィンドウ901−2に新たなタプル1001が入力された場合、第2のオペレータ実行部は、ストリームデータBの2次元配列の位置に基づいて、入力されたタプルに含まれるインデクスに一致するデータを検索する。
When a
Partitionウィンドウ901−2では、カラム「i」、「j」の組合せに対して、一つの値しか存在することができないため、検索されたデータが削除されることとなる。したがって、第2のオペレータ実行部は、削除されるデータのタプル1002、更新されるデータのタプル1003をJoinオペレータ902に出力する。
In the Partition window 901-2, only one value can exist for the combination of the columns “i” and “j”, and thus the retrieved data is deleted. Therefore, the second operator execution unit outputs a
第3のオペレータ実行部は、削除されるデータに関連するタプルを結合し、結合結果をタプル1004、1006、1008として出力し、また、更新されるデータに関連するタプルを結合し、結合結果をタプル1005、1007、1009として出力する。
The third operator execution unit combines the tuples related to the data to be deleted, outputs the combined result as
第4のオペレータ実行部は、Joinオペレータから入力されたタプルに含まれるカラム「A.i」、カラム「B.j」を参照し、更新される集計値の位置を特定する。第4のオペレータ実行部は、特定された集計値の位置から値を読み出し、また、特定された集計値に関する集計処理を実行する。 The fourth operator execution unit refers to the column “A.i” and the column “B.j” included in the tuple input from the Join operator, and specifies the position of the total value to be updated. The fourth operator execution unit reads a value from the position of the specified total value, and executes a total process regarding the specified total value.
さらに、第4のオペレータ実行部は、削除される集計値のタプル1010、1012、1014を出力し、更新される集計値のタプル1011、1013、1015を出力する。
Further, the fourth operator execution unit outputs the
本実施例では、多次元配列でデータを管理することによって、一部の要素の更新時に伴った処理を高速に実行することができる。 In the present embodiment, by managing data in a multidimensional array, it is possible to execute processing accompanying updating of some elements at high speed.
本実施例では、一つのストリームデータ処理サーバ100がストリームデータの処理を実行したが本発明はこれに限定されない。
In this embodiment, one stream
例えば、複数のサーバから構成される計算機システムであってもよい。この場合、複数のサーバの各々が、ストリームデータ処理部110を備える形態が考えられる。また、ストリームデータ処理部110の各機能部を複数のサーバに分散して配置してもよい。
For example, a computer system composed of a plurality of servers may be used. In this case, a form in which each of the plurality of servers includes the stream
また、一つのサーバ上に複数の仮想サーバを生成し、当該仮想サーバを用いて同様の構成を実現してもよい。 A plurality of virtual servers may be generated on one server, and the same configuration may be realized using the virtual servers.
以上で説明したように、実施例1によれば、クエリグラフの解析に基づいて、オペレータのデータ格納領域における最適なデータ構造を決定することができる。これによって、検索処理の高速化、及びメモリ使用量の低減が可能となる。また、行列の演算において、特殊な組込関数を定義する必要がないため、ユーザの開発効率を改善することができる。 As described above, according to the first embodiment, the optimum data structure in the data storage area of the operator can be determined based on the analysis of the query graph. This makes it possible to speed up the search process and reduce the memory usage. In addition, since it is not necessary to define a special built-in function in the matrix operation, the development efficiency of the user can be improved.
なお、本実施例で例示した種々のソフトウェアは、電磁的、電子的及び光学式等の種々の記録媒体(例えば、非一時的な記憶媒体)に格納可能であり、インターネット等の通信網を通じて、コンピュータにダウンロード可能である。 The various software illustrated in the present embodiment can be stored in various recording media (for example, non-temporary storage media) such as electromagnetic, electronic, and optical, and through a communication network such as the Internet. It can be downloaded to a computer.
さらに、本実施例では、ソフトウェアによる制御を用いた例について説明したが、その一部をハードウェアによって実現することも可能である。 Furthermore, in the present embodiment, the example using the control by software has been described, but a part thereof may be realized by hardware.
以上、本発明を添付の図面を参照して詳細に説明したが、本発明はこのような具体的構成に限定されるものではなく、添付した請求の範囲の趣旨内における様々な変更及び同等の構成を含むものである。 Although the present invention has been described in detail with reference to the accompanying drawings, the present invention is not limited to such specific configurations, and various modifications and equivalents within the spirit of the appended claims Includes configuration.
100 ストリームデータ処理サーバ
101 プロセッサ
102 メモリ
103 バス
104 ネットワークインタフェース
105 ストレージ装置
110 ストリームデータ処理部
120 ホスト計算機
121 入力タプル
130 ホスト計算機
131 クエリ登録インタフェース
132 分析シナリオ
140 ホスト計算機
141 出力タプル
150 ネットワーク
201 クエリパーサ
202 クエリグラフ構成情報
203 クエリ構築部
204 クエリ最適化部
205 Partitionウィンドウ最適化部
206 Joinオペレータ最適化部
207 GroupByオペレータ最適化部
210 クエリ実行部
211 オペレータ実行部
221 タプル入力部
222 タプル出力部
410 オペレータ管理情報
420 Partitionウィンドウ管理情報
430 Joinオペレータ管理情報
440 GroupByオペレータ管理情報
901 Partitionウィンドウ
902 Joinオペレータ
903 GroupByオペレータ
911、912、913 データ格納領域
100 stream
Claims (10)
前記計算機は、プロセッサ、前記プロセッサに接続されるメモリ、前記プロセッサに接続されるネットワークインタフェースを有し、
前記ストリームデータ処理は、処理の最小単位となるオペレータを複数含み、
前記ストリームデータ処理の対象であるストリームデータは、複数のカラムから構成されるタプルを複数含み、
前記計算機は、
前記ストリームデータ処理を実現するための一つ以上のクエリを含む分析シナリオを受け付け、前記分析シナリオを解析することによって、前記ストリームデータ処理における前記オペレータの構成を示すクエリグラフの情報を生成するクエリ解析部と、
前記クエリグラフの情報に基づいて、前記オペレータに対応する処理を実行するオペレータ実行部を生成するクエリ構築部と、
前記クエリ構築部によって生成された前記オペレータ実行部に基づいて、入力されたストリームデータを処理するクエリ実行部と、
を有し、
前記方法は、
前記クエリ構築部が、前記ストリームデータ処理に含まれる前記複数のオペレータの中から処理対象のオペレータを選択する第1のステップと、
前記クエリ構築部が、前記クエリグラフの情報に基づいて、前記選択されたオペレータの処理内容を解析し、前記解析の結果に基づいて、前記選択されたオペレータに対応する前記オペレータ実行部に割り当てられるデータ格納領域におけるデータ構造を決定する第2のステップと、
前記クエリ構築部が、前記解析の結果及び前記決定されたデータ構造の情報に基づいて、前記選択されたオペレータに対応するオペレータ実行部を生成する第3のステップと、
前記クエリ構築部が、前記生成されたオペレータ実行部を前記クエリ実行部に登録する第4のステップと、
を含むことを特徴とするデータ処理方法。 A data processing method in a computer that executes stream data processing,
The computer has a processor, a memory connected to the processor, a network interface connected to the processor,
The stream data processing includes a plurality of operators as minimum processing units,
The stream data that is the target of the stream data processing includes a plurality of tuples composed of a plurality of columns,
The calculator is
Query analysis that receives an analysis scenario including one or more queries for realizing the stream data processing and generates information of a query graph indicating the configuration of the operator in the stream data processing by analyzing the analysis scenario And
A query construction unit that generates an operator execution unit that executes processing corresponding to the operator based on the information of the query graph;
A query execution unit that processes the input stream data based on the operator execution unit generated by the query construction unit;
Have
The method
A first step in which the query construction unit selects an operator to be processed from the plurality of operators included in the stream data processing;
The query construction unit analyzes the processing content of the selected operator based on the information of the query graph, and is assigned to the operator execution unit corresponding to the selected operator based on the result of the analysis. A second step of determining a data structure in the data storage area;
A third step in which the query construction unit generates an operator execution unit corresponding to the selected operator based on the result of the analysis and information on the determined data structure;
A fourth step in which the query construction unit registers the generated operator execution unit in the query execution unit;
A data processing method comprising:
前記方法は、
前記クエリ解析部が、前記分析シナリオを解析することによって、前記ストリームデータ処理の対象となる前記タプルを構成するカラムのうち、1から連続する整数である配列インデクス型のカラムを特定するステップと、
前記クエリ解析部が、前記特定された配列インデクス型のカラムの情報を含む、前記クエリグラフの情報を生成するステップと、
を含み、
前記2のステップは、
前記クエリグラフの情報を参照し、前記選択されたオペレータによって処理されるタプルが前記配列インデクス型のカラムを含むか否かを判定する第5のステップと、
前記選択されたオペレータによって処理されるタプルが前記配列インデクス型のカラムを含むと判定された場合、前記データ格納領域における当該タプルを前記配列インデクス型に基づいて定義される多次元配列として管理するように決定し、前記タプルを多次元配列として管理するための設定情報を生成する第6のステップと、を含むことを特徴とするデータ処理方法。 A data processing method according to claim 1, comprising:
The method
The query analysis unit analyzing the analysis scenario to identify an array index type column that is an integer continuous from 1 among the columns constituting the tuple that is the target of the stream data processing;
The query analysis unit generating information of the query graph including information of the identified sequence index type column;
Including
The two steps are:
A fifth step of referring to the information of the query graph and determining whether a tuple processed by the selected operator includes the column of the array index type;
When it is determined that the tuple to be processed by the selected operator includes the array index type column, the tuple in the data storage area is managed as a multidimensional array defined based on the array index type. And a sixth step of generating setting information for managing the tuple as a multidimensional array.
前記ストリームデータ処理は、前記ストリームデータから所定数の前記タプルを抽出する第1のオペレータを含み、
前記第6のステップは、
前記選択されたオペレータによって処理されるタプルを構成するカラムを、前記配列インデクス型のカラムと、当該配列インデクス型以外のカラムである通常型のカラムとに分類するステップと、
前記分類の結果に基づいて、前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含むか否かを判定するステップと、
前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含まないと判定された場合、前記配列インデクス型のカラムの数と同数の次元の多次元配列として前記タプルを保持するための前記設定情報を生成するステップと、
前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含むと判定された場合、前記通常型のカラムをキーとし、前記配列インデクス型のカラムの数と同数の次元の多次元配列が値となるハッシュマップとして前記タプルを保持するための前記設定情報を生成するステップと、
を含むことを特徴とするデータ処理方法。 A data processing method according to claim 2, wherein
The stream data processing includes a first operator that extracts a predetermined number of the tuples from the stream data;
The sixth step includes
Classifying columns constituting a tuple to be processed by the selected operator into an array index type column and a normal type column that is a column other than the array index type;
Determining whether the tuple processed by the selected operator includes the normal type column based on the classification result;
If it is determined that the tuple processed by the selected operator does not include the normal type column, the tuple for holding the tuple as a multidimensional array having the same number of dimensions as the number of columns of the array index type Generating configuration information;
When it is determined that the tuple processed by the selected operator includes the normal type column, the normal type column is used as a key, and a multidimensional array having the same number of dimensions as the number of the array index type columns is provided. Generating the setting information for holding the tuple as a hash map as a value;
A data processing method comprising:
前記ストリームデータ処理は、前記複数のオペレータから入力された前記タプルを所定のカラムの条件に基づいて結合する第2のオペレータを含み、
前記第6のステップは、
前記クエリグラフの情報を参照し、前記選択されたオペレータによって処理されるタプルに含まれる前記配列インデクス型のカラムが、前記第2のオペレータにおける前記所定のカラムの条件に関連するか否かを判定するステップと、
前記選択されたオペレータによって処理されるタプルに含まれる前記配列インデクス型のカラムが、前記第2のオペレータにおける前記所定のカラムの条件に関連すると判定された場合、前記配列インデクス型のカラムの数と同数の次元の多次元配列として前記タプルを保持するための前記設定情報を生成するステップと、
を含むことを特徴とするデータ処理方法。 A data processing method according to claim 2, wherein
The stream data processing includes a second operator that combines the tuples input from the plurality of operators based on a predetermined column condition,
The sixth step includes
Referring to the information of the query graph, it is determined whether or not the sequence index type column included in the tuple processed by the selected operator is related to the condition of the predetermined column in the second operator. And steps to
When it is determined that the array index type column included in the tuple processed by the selected operator is related to the condition of the predetermined column in the second operator, the number of the array index type columns Generating the setting information for holding the tuple as a multidimensional array of the same number of dimensions;
A data processing method comprising:
前記ストリームデータ処理は、前記複数のタプルを所定の条件に基づいて複数のグループに分割し、前記複数のグループ毎に前記複数のタプルの値を所定の演算処理に基づいて集約する第3のオペレータを含み、
前記第6のステップは、
前記選択されたオペレータによって処理されるタプルを構成するカラムを、前記配列インデクス型のカラムと、当該配列インデクス型以外のカラムである通常型のカラムとに分類するステップと、
前記分類の結果に基づいて、前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含むか否かを判定するステップと、
前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含まないと判定された場合、前記配列インデクス型のカラムの数と同数の次元の多次元配列として前記タプルを保持するための前記設定情報を生成するステップと、
前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含むと判定された場合、前記通常型のカラムをキーとし、前記配列インデクス型のカラムの数と同数の次元の多次元配列が値となるハッシュマップとして前記タプルを保持するための前記設定情報を生成するステップと、
を含むことを特徴とするデータ処理方法。 A data processing method according to claim 2, wherein
The stream data processing is a third operator that divides the plurality of tuples into a plurality of groups based on a predetermined condition, and aggregates the values of the plurality of tuples for the plurality of groups based on a predetermined arithmetic processing. Including
The sixth step includes
Classifying columns constituting a tuple to be processed by the selected operator into an array index type column and a normal type column that is a column other than the array index type;
Determining whether the tuple processed by the selected operator includes the normal type column based on the classification result;
If it is determined that the tuple processed by the selected operator does not include the normal type column, the tuple for holding the tuple as a multidimensional array having the same number of dimensions as the number of columns of the array index type Generating configuration information;
When it is determined that the tuple processed by the selected operator includes the normal type column, the normal type column is used as a key, and a multidimensional array having the same number of dimensions as the number of the array index type columns is provided. Generating the setting information for holding the tuple as a hash map as a value;
A data processing method comprising:
前記ストリームデータ処理は、処理の最小単位となるオペレータを複数含み、
前記ストリームデータ処理の対象であるストリームデータは、複数のカラムから構成されるタプルを複数含み、
前記計算機は、
前記ストリームデータ処理を実現するための一つ以上のクエリを含む分析シナリオを受け付け、前記分析シナリオを解析することによって、前記ストリームデータ処理における前記オペレータの構成を示すクエリグラフの情報を生成するクエリ解析部と、
前記クエリグラフの情報に基づいて、前記オペレータに対応する処理を実行するオペレータ実行部を生成するクエリ構築部と、
前記クエリ構築部によって生成された前記オペレータ実行部に基づいて、入力されたストリームデータを処理するクエリ実行部と、
を有し、
前記クエリ構築部は、
前記ストリームデータ処理に含まれる前記複数のオペレータの中から処理対象のオペレータを選択し、
前記クエリグラフの情報に基づいて、前記選択されたオペレータの処理内容を解析し、前記解析の結果に基づいて、前記選択されたオペレータに対応する前記オペレータ実行部に割り当てられるデータ格納領域におけるデータ構造を決定し、
前記解析の結果及び前記決定されたデータ構造の情報に基づいて、前記選択されたオペレータに対応するオペレータ実行部を生成し、
前記生成されたオペレータ実行部を前記クエリ実行部に登録することを特徴とする計算機。 A computer having a processor, a memory connected to the processor, a network interface connected to the processor, and executing stream data processing;
The stream data processing includes a plurality of operators as minimum processing units,
The stream data that is the target of the stream data processing includes a plurality of tuples composed of a plurality of columns,
The calculator is
Query analysis that receives an analysis scenario including one or more queries for realizing the stream data processing and generates information of a query graph indicating the configuration of the operator in the stream data processing by analyzing the analysis scenario And
A query construction unit that generates an operator execution unit that executes processing corresponding to the operator based on the information of the query graph;
A query execution unit that processes the input stream data based on the operator execution unit generated by the query construction unit;
Have
The query building unit
Select an operator to be processed from the plurality of operators included in the stream data processing,
Based on the information of the query graph, the processing contents of the selected operator are analyzed, and based on the analysis result, the data structure in the data storage area allocated to the operator execution unit corresponding to the selected operator Decide
Based on the result of the analysis and the information of the determined data structure, an operator execution unit corresponding to the selected operator is generated,
A computer, wherein the generated operator execution unit is registered in the query execution unit.
前記クエリ解析部は、
前記分析シナリオを解析することによって、前記ストリームデータ処理の対象となる前記タプルを構成するカラムのうち、1から連続する整数である配列インデクス型のカラムを特定し、
前記特定された配列インデクス型のカラムの情報を含む、前記クエリグラフの情報を生成し、
前記クエリ構築部は、
前記データ格納領域におけるデータ構造を決定する場合に、前記クエリグラフの情報を参照し、前記選択されたオペレータによって処理されるタプルが前記配列インデクス型のカラムを含むか否かを判定し、
前記選択されたオペレータによって処理されるタプルが前記配列インデクス型のカラムを含むと判定された場合、前記データ格納領域における当該タプルを前記配列インデクス型に基づいて定義される多次元配列として管理するように決定し、
前記タプルを多次元配列として管理するための設定情報を生成することを特徴とする計算機。 The computer according to claim 6, wherein
The query analysis unit
By analyzing the analysis scenario, an array index type column that is an integer continuous from 1 among the columns constituting the tuple that is the target of the stream data processing is specified,
Generating information of the query graph including information of the column of the identified sequence index type;
The query building unit
When determining the data structure in the data storage area, refer to the information of the query graph, determine whether the tuple processed by the selected operator includes the array index type column,
When it is determined that the tuple to be processed by the selected operator includes the array index type column, the tuple in the data storage area is managed as a multidimensional array defined based on the array index type. Decided on
A computer that generates setting information for managing the tuple as a multidimensional array.
前記ストリームデータ処理は、前記ストリームデータから所定数の前記タプルを抽出する第1のオペレータを含み、
前記クエリ構築部は、
前記データ格納領域におけるデータ構造を決定する場合に、前記選択されたオペレータによって処理されるタプルを構成するカラムを、前記配列インデクス型のカラムと、当該配列インデクス型以外のカラムである通常型のカラムとに分類し、
前記分類の結果に基づいて、前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含むか否かを判定し、
前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含まないと判定された場合、前記配列インデクス型のカラムの数と同数の次元の多次元配列として前記タプルを保持するための前記設定情報を生成し、
前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含むと判定された場合、前記通常型のカラムをキーとし、前記配列インデクス型のカラムの数と同数の次元の多次元配列が値となるハッシュマップとして前記タプルを保持するための前記設定情報を生成することを特徴とする計算機。 The computer according to claim 7,
The stream data processing includes a first operator that extracts a predetermined number of the tuples from the stream data;
The query building unit
When determining the data structure in the data storage area, the columns constituting the tuple processed by the selected operator are the column of the array index type and the normal type column which is a column other than the array index type And categorized as
Based on the result of the classification, determine whether the tuple processed by the selected operator includes the normal type column;
If it is determined that the tuple processed by the selected operator does not include the normal type column, the tuple for holding the tuple as a multidimensional array having the same number of dimensions as the number of columns of the array index type Generate configuration information,
When it is determined that the tuple processed by the selected operator includes the normal type column, the normal type column is used as a key, and a multidimensional array having the same number of dimensions as the number of the array index type columns is provided. A computer that generates the setting information for holding the tuple as a hash map to be a value.
前記ストリームデータ処理は、前記複数のオペレータから入力された前記タプルを所定のカラムの条件に基づいて結合する第2のオペレータを含み、
前記クエリ構築部は、
前記データ格納領域におけるデータ構造を決定する場合に、前記クエリグラフの情報を参照し、前記選択されたオペレータによって処理されるタプルに含まれる前記配列インデクス型のカラムが、前記第2のオペレータにおける前記所定のカラムの条件に関連するか否かを判定し、
前記選択されたオペレータによって処理されるタプルに含まれる前記配列インデクス型のカラムが、前記第2のオペレータにおける前記所定のカラムの条件に関連すると判定された場合、前記配列インデクス型のカラムの数と同数の次元の多次元配列として前記タプルを保持するための前記設定情報を生成することを特徴とする計算機。 The computer according to claim 7,
The stream data processing includes a second operator that combines the tuples input from the plurality of operators based on a predetermined column condition,
The query building unit
When determining the data structure in the data storage area, the array index type column included in the tuple processed by the selected operator is referred to the information in the query graph, and the second operator has the array index type column. Determine if it is relevant to the given column condition,
When it is determined that the array index type column included in the tuple processed by the selected operator is related to the condition of the predetermined column in the second operator, the number of the array index type columns A computer that generates the setting information for holding the tuple as a multidimensional array having the same number of dimensions.
前記ストリームデータ処理は、前記複数のタプルを所定の条件に基づいて複数のグループに分割し、前記複数のグループ毎に前記複数のタプルの値を所定の演算処理に基づいて集約する第3のオペレータを含み、
前記クエリ構築部は、
前記データ格納領域におけるデータ構造を決定する場合に、前記選択されたオペレータによって処理されるタプルを構成するカラムを、前記配列インデクス型のカラムと、当該配列インデクス型以外のカラムである通常型のカラムとに分類し、
前記分類の結果に基づいて、前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含むか否かを判定し、
前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含まないと判定された場合、前記配列インデクス型のカラムの数と同数の次元の多次元配列として前記タプルを保持するための前記設定情報を生成し、
前記選択されたオペレータによって処理されるタプルが前記通常型のカラムを含むと判定された場合、前記通常型のカラムをキーとし、前記配列インデクス型のカラムの数と同数の次元の多次元配列が値となるハッシュマップとして前記タプルを保持するための前記設定情報を生成することを特徴とする計算機。 The computer according to claim 7,
The stream data processing is a third operator that divides the plurality of tuples into a plurality of groups based on a predetermined condition, and aggregates the values of the plurality of tuples for the plurality of groups based on a predetermined arithmetic processing. Including
The query building unit
When determining the data structure in the data storage area, the columns constituting the tuple processed by the selected operator are the column of the array index type and the normal type column which is a column other than the array index type And categorized as
Based on the result of the classification, determine whether the tuple processed by the selected operator includes the normal type column;
If it is determined that the tuple processed by the selected operator does not include the normal type column, the tuple for holding the tuple as a multidimensional array having the same number of dimensions as the number of columns of the array index type Generate configuration information,
When it is determined that the tuple processed by the selected operator includes the normal type column, the normal type column is used as a key, and a multidimensional array having the same number of dimensions as the number of the array index type columns is provided. A computer that generates the setting information for holding the tuple as a hash map to be a value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013135734A JP2015011484A (en) | 2013-06-28 | 2013-06-28 | Data processing method and computer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013135734A JP2015011484A (en) | 2013-06-28 | 2013-06-28 | Data processing method and computer |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2015011484A true JP2015011484A (en) | 2015-01-19 |
Family
ID=52304605
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013135734A Pending JP2015011484A (en) | 2013-06-28 | 2013-06-28 | Data processing method and computer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2015011484A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113377360A (en) * | 2021-06-28 | 2021-09-10 | 北京百度网讯科技有限公司 | Task execution method, device, electronic equipment, storage medium and program product |
-
2013
- 2013-06-28 JP JP2013135734A patent/JP2015011484A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113377360A (en) * | 2021-06-28 | 2021-09-10 | 北京百度网讯科技有限公司 | Task execution method, device, electronic equipment, storage medium and program product |
CN113377360B (en) * | 2021-06-28 | 2023-09-26 | 北京百度网讯科技有限公司 | Task execution method, device, electronic equipment, storage medium and program product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11392604B2 (en) | Designating fields in machine data using templates | |
US9607331B2 (en) | Near-duplicate filtering in search engine result page of an online shopping system | |
US11423082B2 (en) | Methods and apparatus for subgraph matching in big data analysis | |
US20220292333A1 (en) | Prediction-model-based mapping and/or search using a multi-data-type vector space | |
US9998333B2 (en) | Auto discovery of configuration items | |
US8219581B2 (en) | Method and system for analyzing ordered data using pattern matching in a relational database | |
US9864776B2 (en) | Intelligently utilizing non-matching weighted indexes | |
US10353966B2 (en) | Dynamic attributes for searching | |
US20200342031A1 (en) | Search systems and methods utilizing search based user clustering | |
US20170116268A1 (en) | Extending relational algebra for data management | |
US20160342646A1 (en) | Database query cursor management | |
JP7483320B2 (en) | Automated Search Dictionary and User Interface | |
JP5844895B2 (en) | Distributed data search system, distributed data search method, and management computer | |
CN105760418B (en) | Method and system for performing cross-column search on relational database table | |
Cijvat et al. | Genome sequence analysis with MonetDB: a case study on Ebola virus diversity | |
US20180329873A1 (en) | Automated data extraction system based on historical or related data | |
US9229969B2 (en) | Management of searches in a database system | |
JP6642435B2 (en) | Data processing device, data processing method, and program | |
KR101772333B1 (en) | INTELLIGENT JOIN TECHNIQUE PROVIDING METHOD AND SYSTEM BETWEEN HETEROGENEOUS NoSQL DATABASES | |
US20170169159A1 (en) | Repetition identification | |
US11720563B1 (en) | Data storage and retrieval system for a cloud-based, multi-tenant application | |
JP2015011484A (en) | Data processing method and computer | |
US11216457B1 (en) | Selectively assigning join operations for remote data processing | |
CN113297226A (en) | Data storage method, data reading method, data storage device, electronic device and medium | |
Kille et al. | Parsnp 2.0: Scalable Core-Genome Alignment for Massive Microbial Datasets |