WO2017148297A1 - 数据表连接方法及装置 - Google Patents

数据表连接方法及装置 Download PDF

Info

Publication number
WO2017148297A1
WO2017148297A1 PCT/CN2017/074177 CN2017074177W WO2017148297A1 WO 2017148297 A1 WO2017148297 A1 WO 2017148297A1 CN 2017074177 W CN2017074177 W CN 2017074177W WO 2017148297 A1 WO2017148297 A1 WO 2017148297A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data table
target
nodes
data record
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.)
Ceased
Application number
PCT/CN2017/074177
Other languages
English (en)
French (fr)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2017148297A1 publication Critical patent/WO2017148297A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Definitions

  • the present application relates to the field of database technologies, and in particular, to a data table connection method and apparatus.
  • Data warehouses play a huge role in this context. Due to the advent of the big data era, data warehouses have become distributed architectures to meet the explosive growth of computing and storage needs. Distributed data warehouses generally use columnar storage and store data in the form of files. Therefore, using distributed data warehouses can improve the storage and computing performance of big data.
  • the Join data table includes one primary table and n secondary tables, and the primary table contains M data records
  • shuffle The total amount of data to be processed by sorting includes the amount of data that the shuffle master table needs to process, that is, the amount of data that M*n and shuffle n auxiliary tables need to process, which consumes a lot of computing resources.
  • aspects of the present application provide a data table connection method and apparatus for reducing computing resources consumed by a data table connection operation.
  • An aspect of the present application provides a data table connection method, including:
  • the data table connection task indication is first according to a connection condition The data table and the second data table are connected;
  • the data record in the second data table is recorded as a target data
  • a connection operation is performed on the current data record and the target data record.
  • a data table connection apparatus including:
  • a receiving module configured to receive a data table connection task, where the data table connection task indicates that the first data table and the second data table are connected according to the connection condition;
  • a reading module configured to read a data record in the first data table as a current data record, determine a target node from the at least two nodes according to the connection condition of the current data record, and read the Recording, in the second data table stored on the target node, a data record as a target data record;
  • connection module configured to perform a connection operation on the current data record and the target data record.
  • the data records in the second data table are loaded into at least two nodes in the distributed system according to the connection conditions therein, and then the first data can be directly read.
  • the data record in the table, and according to the corresponding connection condition of the data record in the read first data table read the data record in the required second data table from the corresponding node, and then read the two data records.
  • the data records in the data tables are connected. It can be seen that the application only needs to distribute the second data table to different nodes according to the connection condition, and does not need to distribute the first data table to different nodes, thereby reducing the amount of data that needs to be processed by shuffle sorting, which is beneficial to reducing the connection operation.
  • FIG. 1 is a schematic flowchart of a data table connection method according to an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a distributed system according to another embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a data table connection apparatus according to another embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of a data table connection apparatus according to another embodiment of the present disclosure.
  • the present application provides a solution for distributing a second data table to a plurality of nodes to become a distributed cache.
  • the storage on the remote node is obtained through the network.
  • the data record in the second data table thereby performing a distributed hash map join, so that there is no need to perform shuffle sorting on the main table. This can save computational resources consumed by shuffle sorting of the first data table.
  • FIG. 1 is a schematic flowchart diagram of a data table connection method according to an embodiment of the present application. As shown in Figure 1, the method includes:
  • a data record in the first data table as a current data record, determine a target node from at least two nodes according to a connection condition of the current data record, and read a second data table stored in the target node.
  • the data record is recorded as a target data.
  • the embodiment provides a data table connection method, which can be executed by the data table connection device for performing a join operation between data tables while minimizing the consumed computing resources.
  • the method provided by this embodiment is applicable to a distributed system, and different machines in the distributed system herein can be respectively used as one node.
  • This embodiment does not limit the implementation architecture of the distributed system, and may be, but not limited to, a MapReduce architecture.
  • the data table connection task carries information such as a connection condition, an identifier of the first data table, an identifier of the second data table, a storage location of the first data table, and a storage location of the second data table.
  • the data table connection device can parse the data table connection task, obtain the connection condition, the identifier of the first data table, the identifier of the second data table, the storage location of the first data table, and the storage location of the second data table, and the like. And determining, according to the identifier of the first data table and the identifier of the second data table, the data table that needs to perform the Join operation.
  • the first data may be read according to the storage location of the first data table and the storage location of the second data table. Table and second data table.
  • the first data table can be used as the main table, and the second data table can be used as Auxiliary table implementation.
  • the number of the auxiliary tables may be one or more.
  • the data table connection device After receiving the data table connection task, the data table connection device can learn that the first data table and the second data table need to be joined according to the connection condition. Then, before performing the Join operation, firstly, according to the connection condition, the data record in the second data table is loaded into at least two nodes in the distributed system to implement distributed storage.
  • the data record in the second data table located on each of the at least two nodes has a data amount smaller than a memory limit of the single node, that is, distributed to each of the at least two nodes.
  • the data records in the two data tables can all be placed in the storage space (preferably memory) of the corresponding node.
  • the connection condition includes at least one target key required for the connection, where the target key is actually a key in a key-value.
  • the data table connecting device may respectively perform a hash operation on each target key in the at least one target key to obtain a hash value of each target key; according to the hash value of each target key and the foregoing for storing the second
  • the number of at least two nodes of the data record in the data table determines the node corresponding to each target key; and the data records corresponding to the target keys in the second data table are respectively loaded to the nodes corresponding to the target keys.
  • the data table connecting means may use the hash value of each target key to modulo the number of at least two nodes for storing the data record in the second data table, and determine the node corresponding to each target key according to the modulo result.
  • the node represented by the modulo result may be used as a node corresponding to the target key.
  • the data table connecting means may divide each target key into each node according to the number of at least two nodes for storing data records in the second data table and the number of target keys, and in the process of equalization, according to The hash value of each target key, and the target keys with similar hash values are assigned to the same node.
  • the similar hash value here may mean that the difference between the hash values is less than a preset threshold, but is not limited thereto.
  • the data records in the second data table may be specifically loaded into the memory of at least two nodes.
  • the data record in the second data table is stored in the memory of the node, can be read at any time, and the reading speed is fast, which is beneficial to improve the efficiency of the Join operation.
  • the data record in the second data table can be loaded into the above
  • the memory of at least two nodes, but not limited to memory, can also be a node's Solid State Drives (SSD) or other storage medium.
  • SSD Solid State Drives
  • whether the data volume of the second data table is greater than a single node may be determined.
  • Memory limit if the judgment result is yes, that is, the data amount of the second data table is larger than the memory limit of a single node, which means that the data records in the second data table cannot all be placed in the memory of a single node, so Loading the data records in the second data table into at least two nodes, so that the data records in the second data table distributed to each node can all be placed in the memory of the corresponding node to implement distributed storage.
  • the data records in the second data table distributed to each node have a data amount smaller than the memory limit of a single node.
  • the data amount of the second data table is less than or equal to the memory limit of the single node, which means that the data records in the second data table may all be placed in the memory of the single node, and more preferably, The data records of the second data table are all placed in the memory of a single node, thereby saving shuffle sorting of the data records of the second data table, thereby saving computing resources.
  • the data record in the second data table is loaded into at least two nodes in the distributed system, which is equivalent to turning the second data table into multiple small tables, and each small table may be all in the memory of the corresponding node.
  • Putting it down, forming a distributed KV store makes it possible to do distributed Hash map Join without having to do a Sort Merge Join.
  • Doing distributed Hash map Join do not need to sort the data records in the first data, can directly read the data records in the first data table, and record corresponding data according to the data records in the first data table read
  • the connection condition reads the data record in the required second data table from the corresponding node, and then performs a Join operation on the data records in the two read data tables.
  • the difference between the distributed Hash map Join and the existing Hash map Join in this embodiment is that, when processing the first data table, the data record in the second data table is not searched in the local memory, but through the network. Get the data record in the second data table stored on the remote node.
  • the data table connecting device may read the first data table to the storage location of the first data table.
  • the read data record is used as the current data record
  • the target node is determined from the at least two nodes according to the connection condition of the current data record, where the target node refers to the Join operation with the current data record.
  • the node of the required data record in the second data table is located, and then reads the data record in the second data table stored on the target node as the target data record, where the target data record refers to the Join operation with the current data record.
  • the required data record in the second data table is located, and then reads the data record in the second data table stored on the target node as the target data record, where the target data record refers to the Join operation with the current data record.
  • the current data record and the target data record are joined. Since the Join operation of the current data record and the target data record is not the focus of the present application, and will not be described in detail herein, reference may be made to the processing flow related to the Join operation in the prior art.
  • the target data record may be determined in the local cache according to the connection condition of the current data record.
  • connection condition corresponding to the current data record may be a target key
  • an implementation manner of determining the target node from the at least two nodes according to the connection condition corresponding to the current data record includes:
  • the batch operation can be performed, so that the optimal performance of the distributed system can be fully utilized. Potential to improve processing performance.
  • the first embodiment loads the data records in the second data table onto at least two nodes according to the connection conditions therein, which is equivalent to becoming a distributed KV storage (that is, there will be a distributed hash table), so you do not need to do Sort Merge Join, so you can do distributed Hash map Join, that is, you do not need to sort the data records in the first data, but can directly Reading the data record in the first data table, and reading the data record in the required second data table from the corresponding node according to the corresponding connection condition of the data record in the read first data table, and then The data records in the two data tables read are joined.
  • a distributed KV storage that is, there will be a distributed hash table
  • the embodiment only needs to distribute the second data table to different nodes according to the connection condition, and does not need to distribute the first data table to different nodes, thereby reducing the amount of data that needs to be processed by shuffle sorting, which is beneficial to reducing the connection.
  • the computing resources consumed by the operation are not limited to.
  • the primary table is A
  • its data size is 100T.
  • the secondary table has two B and C respectively
  • the secondary table B has a data size of 10G
  • the secondary table C has a data size of 100G.
  • the shuffle sorting stage needs to distribute the auxiliary table B to different nodes, and the auxiliary table C needs to be distributed to different nodes, and each time a certain table is distributed to different nodes, including
  • the data table is read by the network IO and sorted by the CPU, so the resource consumption of distributing a table to different nodes also includes: sorting the CPU occupied by the CPU and the read table.
  • the amount of data processed represents resource consumption, here, Considering that the amount of data processed by the CPU is the amount of data read by the network IO, the resource consumption of each sorting process is represented by a data amount, and the total resource consumption of the shuffle sorting phase is: 10G+100G.
  • the technical solution of the present application only needs to distribute the second data table to different nodes according to the connection condition, the first data table does not need to be distributed to different nodes, which reduces the amount of data that needs to be processed by shuffle sorting, which is beneficial to Reduce the computational resources consumed by the connection operation.
  • FIG. 2 is a schematic structural diagram of a distributed system according to another embodiment of the present application.
  • the distributed system includes a control node 21, a scheduling node 22, and at least two computing nodes 23.
  • the computing node 23 includes at least a cache module and a processing module.
  • the distributed system shown in FIG. 2 is only an example, and is not limited thereto.
  • the scheduling node 22 in FIG. 2 may be omitted to obtain a simpler distributed system.
  • the control node 21 is responsible for receiving the data table connection task, and according to the data table connection task, it is necessary to perform the connection operation on the first data table and the second data table according to the connection condition.
  • Control node 21 may send scheduling instructions to scheduling node 22 in accordance with the data table connection task, and control scheduling node 22 schedules computing nodes 23 available in the distributed system.
  • the scheduling node 22 specifically receives the scheduling instruction of the control node 21, and schedules the computing node 23 in the distributed system according to the scheduling instruction.
  • control node 21 provides the configuration node 23 with the configuration file required for the subsequent loading of the data record in the second data table by the scheduling node 22, the configuration file records the second The identification of the data table, the storage location, and the identification information of the data record to be loaded, and the like.
  • a loading process is deployed on each computing node 23 in the distributed system.
  • the loading process loads the data records in the second data table into the cache module according to the configuration file.
  • the scheduling module 22 activates the loading process on each computing node 23, and the loading process reads the corresponding data record in the second data table according to the configuration file, and loads the data record read by the loading module into the cache module.
  • the second data table can be stored in a distributed system. In the space outside, but not limited to this.
  • the dispatch node 22 When all the loading processes on the compute node 23 perform the load operation, that is, both enter the listening port state, the dispatch node 22 returns a load end instruction to the control node 21. Based on the load end instruction, the control node 21 can know that each computing node 23 has loaded the data record in the second data table into the cache module.
  • the control node 21 sends an activation command to the scheduling node 22 such that the scheduling node 22 activates the processing process on each computing node 23.
  • a processing process is configured on each computing node 23, and the processing process is mainly used to read the data record in the first data table as the current data record, and determine the second corresponding to the key according to the corresponding key of the current data record read.
  • the computing node 23 where the data record in the data table is located reads the data record in the second data table stored on the determined computing node 23 as the target data record, and joins the read current data record and the target data record. operating. It is worth noting that the first data table can be stored in a space outside the distributed system, but is not limited thereto.
  • each of the computing nodes 23 may be implemented by using a server/client.
  • the cache module of each computing node 23 can be implemented as a cache server (CacheService), the cache server further includes a cache manager (CacheManager), and each cache module corresponds to a cache node (CacheNode); correspondingly, each compute node
  • the processing module of 23 is implemented as a cache client (CacheClient).
  • the CacheManager coordinates all CacheNodes.
  • the CacheNode is responsible for loading data into memory and providing services.
  • the second data table can be stored and managed in the form of a shard file.
  • the purpose of using the shard file is because, in the case of a failover, once the CacheNode is restarted, it is only necessary to read the shard file again, so that the processing is relatively simple.
  • the CacheClient accesses the CacheService, performs hash calculation on the key, and reads data from one of the CacheNodes according to the calculation result.
  • the cached algorithm such as Least Recently Used (LRU) is used to save some of the read data in the local cache, so that the CacheClient can preferentially read from the local cache.
  • LRU Least Recently Used
  • the required data if the required data is read in the local cache, can save the operation of reading data from the CacheNode through the network, which is beneficial to improve efficiency and save resources.
  • the first embodiment loads the data records in the second data table onto at least two nodes according to the connection conditions therein, thereby implementing distributed storage, so that the data can be directly read.
  • Data records in the first data table, and reading data records in the required second data table from the corresponding nodes according to the corresponding connection conditions of the data records in the read first data table, and then reading the data records in the second data table The data records in the two data tables are joined to implement distributed Hash map Join.
  • the embodiment only needs to distribute the second data table to different nodes according to the connection condition, and does not need to distribute the first data table to different nodes, thereby reducing the amount of data that needs to be processed by shuffle sorting, which is beneficial to reducing the connection.
  • the computing resources consumed by the operation are not limited to.
  • FIG. 3 is a schematic structural diagram of a data table connection apparatus according to another embodiment of the present disclosure. As shown in FIG. 3, the device includes a receiving module 31, a loading module 32, a reading module 33, and a connecting module 34.
  • the receiving module 31 is configured to receive a data table connection task, where the data table connection task indicates that the first data table and the second data table are connected according to the connection condition.
  • the loading module 32 is configured to load the data records in the second data table into at least two nodes in the distributed system according to the connection condition.
  • the reading module 33 is configured to read the data record in the first data table as the current data record, determine the target node from the at least two nodes according to the connection condition of the current data record, and read the first stored on the target node.
  • the data records in the two data tables are recorded as target data.
  • the connection module 34 is configured to perform a connection operation on the current data record and the target data record.
  • the device further includes: a first determining module 35.
  • the first determining module 35 is configured to determine whether the data amount of the second data table is greater than a memory limit of the single node, and when the determination result is yes, the trigger loading module 32 performs loading the data record in the second data table according to the connection condition. To operations on at least two nodes in a distributed system.
  • the second determining module 36 is configured to determine whether the target data record exists in the local cache according to the connection condition corresponding to the current data record, and trigger the reading module 33 to perform the connection condition according to the current data record when the determination result is negative. Determining a target node from at least two nodes and reading a data record in the second data table stored on the target node as an operation of the target data record.
  • connection condition includes at least one target key required for the connection.
  • the target key here is actually the key in the key-value pair.
  • the loading module 32 is specifically configured to:
  • the data records corresponding to the respective target keys in the second data table are respectively loaded onto the nodes corresponding to the respective target keys.
  • the loading module 32 is specifically configured to:
  • the data record in the second data table is stored in the memory of the node, can be read at any time, and the reading speed is fast, which is beneficial to improve the efficiency of the Join operation.
  • the data record in the second data table can be loaded into the above
  • the memory of at least two nodes, but not limited to memory, can also be in the node's SSD or other storage medium.
  • the data table connection device when processing the data table connection task, first loads the data record in the second data table to at least two nodes in the distributed system according to the connection condition therein, which is equivalent to changing It becomes a distributed KV storage, so there is no need to do Sort Merge Join, so that it can do distributed Hash map Join, that is, it does not need to sort the data records in the first data, but can directly read the first data.
  • the data record in the table, and according to the corresponding connection condition of the data record in the read first data table read the data record in the required second data table from the corresponding node, and then read the two data records.
  • the data records in the data tables are connected.
  • the second data table only needs to be distributed to different nodes according to the connection condition, and the first data table does not need to be distributed to different nodes, thereby reducing the need for shuffle sorting.
  • the amount of data is beneficial to reduce the computing resources consumed by the connection operation.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated in In a unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the software functional unit described above is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods described in various embodiments of the present application. Part of the steps.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种数据表连接方法及装置。方法包括:接收数据表连接任务,数据表连接任务指示按照连接条件对第一数据表和第二数据表进行连接操作(101);根据连接条件,将第二数据表中的数据记录加载到分布式系统中至少两个节点上(102);读取第一数据表中的数据记录作为当前数据记录,根据当前数据记录对应的连接条件,从至少两个节点中确定目标节点,并读取目标节点上存储的第二数据表中的数据记录作为目标数据记录(103);对当前数据记录和目标数据记录进行连接操作(104)。该方法可以降低数据表连接操作消耗的计算资源。

Description

数据表连接方法及装置 【技术领域】
本申请涉及数据库技术领域,尤其涉及一种数据表连接方法及装置。
【背景技术】
随着互联网的发展,数据呈现爆发式增长,数据结构也开始多元化,数据含有的信息量越来越多,数据仓库在这样的背景下发挥着巨大的作用。由于大数据时代的降临,数据仓库转成为分布式架构,以满足爆发式增长的计算及存储的需求。分布式数据仓库一般使用列式存储,并以文件的形式保存数据,因此,采用分布式数据仓库可提高大数据的存储及计算性能。
在分布式数据仓库的查询过程中,经常需要进行数据表之间的连接(Join)计算。现有技术在处理数据表之间的Join计算时,一般都是先将所有待Join的数据表通过MapReduce的方式做洗牌(shuffle)排序,然后在Reducer端对已经排过序的数据表进行归并操作。shuffle排序实际上是指将Map端各个待Join的数据表按照Join条件进行分区并分配到不同Reducer端的过程。
在典型的“星型”Join场景下,假设待Join数据表包括一个主表和n个辅表,主表包含M条数据记录,那么在对主表和n个辅表进行Join计算时,shuffle排序需要处理的总数据量包括shuffle主表需要处理的数据量即M*n和shuffle n个辅表需要处理的数据量,这会消耗很多计算资源。
【发明内容】
本申请的多个方面提供一种数据表连接方法及装置,用以降低数据表连接操作消耗的计算资源。
本申请的一方面,提供一种数据表连接方法,包括:
接收数据表连接任务,所述数据表连接任务指示按照连接条件对第一 数据表和第二数据表进行连接操作;
根据所述连接条件,将所述第二数据表中的数据记录加载到分布式系统中至少两个节点上;
读取所述第一数据表中的数据记录作为当前数据记录,根据所述当前数据记录对应的连接条件,从所述至少两个节点中确定目标节点,并读取所述目标节点上存储的所述第二数据表中的数据记录作为目标数据记录;
对所述当前数据记录和所述目标数据记录进行连接操作。
本申请的另一方面,提供一种数据表连接装置,包括:
接收模块,用于接收数据表连接任务,所述数据表连接任务指示按照连接条件对第一数据表和第二数据表进行连接操作;
加载模块,用于根据所述连接条件,将所述第二数据表中的数据记录加载到分布式系统中至少两个节点上;
读取模块,用于读取所述第一数据表中的数据记录作为当前数据记录,根据所述当前数据记录对应的连接条件,从所述至少两个节点中确定目标节点,并读取所述目标节点上存储的所述第二数据表中的数据记录作为目标数据记录;
连接模块,用于对所述当前数据记录和所述目标数据记录进行连接操作。
在本申请中,在处理数据表连接任务时,首先根据其中的连接条件,将第二数据表中的数据记录加载到分布式系统中至少两个节点上,之后,可以直接读取第一数据表中的数据记录,并根据所读取的第一数据表中的数据记录对应的连接条件,从相应节点上读取所需的第二数据表中的数据记录,之后对读取到的两个数据表中的数据记录进行连接操作。由此可见,本申请只需将第二数据表按照连接条件分布到不同节点上,不需要将第一数据表分布到不同节点上,减少了shuffle排序需要处理的数据量,有利于降低连接操作所消耗的计算资源。
【附图说明】
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请一实施例提供的数据表连接方法的流程示意图;
图2为本申请另一实施例提供的分布式系统的架构示意图;
图3为本申请又一实施例提供的数据表连接装置的结构示意图;
图4为本申请又一实施例提供的数据表连接装置的结构示意图。
【具体实施方式】
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
在分布式数据仓库的查询过程中,经常需要进行数据表之间的连接(Join)计算。现有技术在处理数据表之间的Join操作时,由于待Join的数据表比较大,所以一般都是先将所有待Join的数据表通过MapReduce的方式做shuffle排序,然后在Reducer端对已经排过序的数据表进行归并操作。shuffle排序实际上是指将Map端各个待Join的数据表按照Join条件进行分区并分配到不同Reducer端的过程。由于需要对所有待Join的数据表进行shuffle排序,消耗的计算资源较多。
针对上述技术问题,本申请提供一种解决方案,即通过将第二数据表分布存储到多个节点上,成为一个分布式的缓存,对第一数据表处理时,通过网络获取远程节点上存储的第二数据表中的数据记录,从而进行分布式的哈希映射连接(Hash map Join),使得无需对主表进行shuffle排序, 这样可以节约对第一数据表进行shuffle排序消耗的计算资源。
图1为本申请一实施例提供的数据表连接方法的流程示意图。如图1所示,该方法包括:
101、接收数据表连接任务,该数据表连接任务指示按照连接条件对第一数据表和第二数据表进行连接操作。
102、根据上述连接条件,将第二数据表中的数据记录加载到分布式系统中至少两个节点上。
103、读取第一数据表中的数据记录作为当前数据记录,根据当前数据记录对应的连接条件,从至少两个节点中确定目标节点,并读取目标节点上存储的第二数据表中的数据记录作为目标数据记录。
104、对当前数据记录和目标数据记录进行连接操作。
本实施例提供一种数据表连接方法,可由数据表连接装置来执行,用以进行数据表之间的Join操作,同时尽量降低所消耗的计算资源。本实施例提供的方法适用于分布式系统,这里的分布式系统中的不同机器可以分别作为一个节点。本实施例并不限制分布式系统的实现架构,例如可以是但不限于MapReduce架构。
当需要进行数据表之间的Join操作时,可以向数据表连接装置发送数据表连接任务;数据表连接装置接收数据表连接任务。该数据表连接任务指示按照连接条件对第一数据表和第二数据表进行Join处理。这里的第一数据表和第二数据表实际上是待连接的数据表。
在具体实现上,该数据表连接任务携带有连接条件、第一数据表的标识、第二数据表的标识、第一数据表的存储位置、以及第二数据表的存储位置等信息。其中,数据表连接装置可以对数据表连接任务进行解析,获取连接条件、第一数据表的标识、第二数据表的标识、第一数据表的存储位置、以及第二数据表的存储位置等信息,并根据第一数据表的标识和第二数据表的标识确定需要进行Join操作的数据表,另外,可以根据第一数据表的存储位置和第二数据表的存储位置读取第一数据表和第二数据表。
在一种实际应用中,第一数据表可以作为主表,第二数据表可以作为 辅表实现。其中,辅表的数量可以是一个或多个。
数据表连接装置接收到数据表连接任务之后,可以获知需要按照连接条件对第一数据表和第二数据表进行Join操作。之后,在执行Join操作之前,首先根据连接条件,将第二数据表中的数据记录加载到分布式系统中至少两个节点上,实现分布式存储。
优选的,位于至少两个节点中每个节点上的第二数据表中的数据记录,其数据量小于单个节点的内存限制,也就是说,分布到至少两个节点中每个节点上的第二数据表中的数据记录,均能够全部放到相应节点的存储空间(优选为内存)中。
在一可选实施方式中,上述连接条件包括连接所需的至少一个目标键,这里的目标键实际上就是键值对(key-value)中的键(key)。基于此,数据表连接装置具体可以分别对至少一个目标键中的各目标键进行哈希运算,以获取各目标键的哈希值;根据各目标键的哈希值和上述用于存储第二数据表中的数据记录的至少两个节点的数量,确定各目标键对应的节点;将第二数据表中对应于各目标键的数据记录分别加载到各目标键对应的节点上。
进一步,数据表连接装置可以利用各目标键的哈希值对上述用于存储第二数据表中的数据记录的至少两个节点的数量取模,根据取模结果确定各目标键对应的节点。具体的,可以将取模结果代表的节点作为目标键对应的节点。或者,
数据表连接装置可以根据上述用于存储第二数据表中的数据记录的至少两个节点的数量和目标键的数量,将各目标键均分到各节点上,在均分过程中,可以根据各目标键的哈希值,将哈希值相近的目标键分到相同节点。这里的哈希值相近可以是指哈希值之差小于预设门限,但不限于此。
进一步,在上述加载第二数据表中的数据记录到至少两个节点上的过程中,具体可以将第二数据表中的数据记录加载到至少两个节点的内存中。第二数据表中的数据记录存储在节点的内存中,可以随时读取,读取速度较快,有利于提高Join操作的效率。
值得说明的是,优选的,可以将第二数据表中的数据记录加载到上述 至少两个节点的内存中,但并不限于内存,还可以是节点的固态硬盘(Solid State Drives,SSD)或者其他存储介质中。
在一可选实施方式中,在根据连接条件,将第二数据表中的数据记录加载到分布式系统中的至少两个节点上之前,可以判断第二数据表的数据量是否大于单个节点的内存限制;若判断结果为是,即第二数据表的数据量大于单个节点的内存限制,这意味着第二数据表中的数据记录不能全部放在单个节点的内存中,因此可以根据连接条件,将第二数据表中的数据记录加载到至少两个节点中,使得分布到每个节点上的第二数据表中的数据记录均能全部放到相应节点的内存中,实现分布式存储。简单的说,分布到每个节点上的第二数据表中的数据记录,其数据量小于单个节点的内存限制。
若上述判断结果为否,即第二数据表的数据量小于或等于单个节点的内存限制,这意味着第二数据表中的数据记录可以全部放在单个节点的内存中,较为优选的,可以将第二数据表的数据记录全部放到单个节点的内存中,从而节省对第二数据表的数据记录进行shuffle排序,节约计算资源。
上述将第二数据表中的数据记录加载到分布式系统中至少两个节点上,这相当于将第二数据表变成了多个小表,每个小表可以全部在相应节点的内存中放得下,形成分布式的KV存储,使得可以做分布式的Hash map Join,而不需要做排序合并连接(Sort Merge Join)。做分布式的Hash map Join,不需要对第一数据中的数据记录进行排序,可以直接读取第一数据表中的数据记录,并根据所读取的第一数据表中的数据记录对应的连接条件,从相应节点上读取所需的第二数据表中的数据记录,之后对读取到的两个数据表中的数据记录进行Join操作。
其中,本实施例中分布式的Hash map Join与现有Hash map Join的区别在于:在对第一数据表处理时,不是在本地内存中查找第二数据表中的数据记录,而是通过网络获取远程节点上存储的第二数据表中的数据记录。
具体的,在将第二数据表中的数据记录加载到分布式系统中至少两个节点之后,数据表连接装置可以到第一数据表的存储位置读取第一数据表 中的数据记录,将读取到的数据记录作为当前数据记录,根据当前数据记录对应的连接条件,从上述至少两个节点中确定目标节点,这里的目标节点是指与当前数据记录进行Join操作所需的第二数据表中的数据记录所在的节点,然后读取目标节点上存储的第二数据表中的数据记录作为目标数据记录,这里的目标数据记录是指与当前数据记录进行Join操作所需的第二数据表中的数据记录。
在读取到当前数据记录以及与当前数据记录进行Join操作所需的目标数据记录之后,对当前数据记录与目标数据记录进行Join操作。由于如何对当前数据记录与目标数据记录进行Join操作不是本申请的重点,在此不再详述,可参考现有技术中有关Join操作的处理流程。
在一可选实施方式中,考虑到数据表连接装置的本地缓存中可能会存在与当前数据记录进行Join操作所需的目标数据记录,基于此,在根据当前数据记录对应的连接条件,从至少两个节点中确定目标节点,并读取目标节点上存储的第二数据表中的数据记录作为目标数据记录之前,可以根据当前数据记录对应的连接条件,判断本地缓存中是否存在目标数据记录,若判断结果为否,则执行根据当前数据记录对应的连接条件,从至少两个节点中确定目标节点,并读取目标节点上存储的第二数据表中的数据记录作为目标数据记录的操作;若判断结果为是,则可以从本地缓存中获取目标数据记录,这样可以更加快速的获取目标数据记录,节约获取目标数据记录所消耗的网络资源,提高Join操作的效率。
进一步,上述当前数据记录对应的连接条件可以是目标键,则一种根据当前数据记录对应的连接条件,从至少两个节点中确定目标节点的实施方式包括:
对当前数据记录对应的目标键进行哈希运算,以获得当前数据记录对应的目标键的哈希值;根据当前数据记录对应的目标键的哈希值和上述至少两个节点的数量,确定当前数据记录对应的目标键对应的节点作为目标节点。
更进一步,在通过目标键确定从某个节点上取目标数据的过程中,若目标键有多个,则可以进行批量操作,这样可以充分发挥分布式系统的优 势,提高处理性能。
由上述分析可见,本实施例在处理数据表连接任务时,首先根据其中的连接条件,将第二数据表中的数据记录加载到至少两个节点上,这相当于变成了一个分布式的KV存储(即会有分布式的哈希表),这样不需要做Sort Merge Join,使得可以做分布式的Hash map Join,即不需要对第一数据中的数据记录进行排序,而是可以直接读取第一数据表中的数据记录,并根据所读取的第一数据表中的数据记录对应的连接条件,从相应节点上读取所需的第二数据表中的数据记录,之后对读取到的两个数据表中的数据记录进行Join操作。由此可见,本实施例只需将第二数据表按照连接条件分布到不同节点上,不需要将第一数据表分布到不同节点上,减少了shuffle排序需要处理的数据量,有利于降低连接操作所消耗的计算资源。
下面通过对比Sort Merge Join与分布式的Hash map Join消耗的计算资源,以说明本申请技术方案带来的优势。
假设主表是A,其数据大小是100T,假设辅表有2个分别是B和C,辅表B的数据大小为10G,辅表C的数据大小为100G。
若采用现有Sort Merge Join,其shuffle排序阶段需要将主表A和辅表B进行一次排序处理,还需要将主表A和辅表C进行一次排序处理,每次排序处理包括通过网络IO读数据表以及通过CPU进行排序,所以每次排序处理的资源消耗包括:排序所占CPU和读表所占的网络IO。为便于描述,通过处理的数据量表示资源消耗,在这里,考虑到CPU排序处理的数据量也就是通过网络IO读取的数据量,故以一份数据量来表示每次排序处理的资源消耗,则shuffle排序阶段需要总资源消耗为:(100T+10G)+(100T+100G)=2*100T+10G+100G。
若采用本申请分布式的Hash map Join,其shuffle排序阶段需要将辅表B分布到不同节点上,还需要将辅表C分布到不同节点上,每次将某个表分布到不同节点上包括通过网络IO读数据表以及通过CPU进行排序,所以将某个表分布到不同节点上的资源消耗同样包括:排序所占CPU和读表所占的网络IO。为便于描述,通过处理的数据量表示资源消耗,在这里, 考虑到CPU排序处理的数据量也就是通过网络IO读取的数据量,故以一份数据量来表示每次排序处理的资源消耗,则shuffle排序阶段需要总资源消耗为:10G+100G。
由上述可见,由于本申请技术方案只需将第二数据表按照连接条件分布到不同节点上,不需要将第一数据表分布到不同节点上,减少了shuffle排序需要处理的数据量,有利于降低连接操作所消耗的计算资源。
图2为本申请另一实施例提供的分布式系统的架构示意图。如图2所示,该分布式系统包括:控制节点21、调度节点22、以及至少两个计算节点23。进一步,如图2所示,计算节点23至少包括缓存模块和处理模块。
值得说明的是,图2所示分布式系统仅为一种示例,并不限于此,例如可以将图2中的调度节点22省略从而获得一种更为简单的分布式系统。
下面将基于图2所示分布式系统,对本申请技术方案进行详细说明。
控制节点21负责接收数据表连接任务,根据数据表连接任务获知需要按照连接条件对第一数据表和第二数据表进行连接操作。
控制节点21可以根据数据表连接任务向调度节点22发送调度指令,控制调度节点22调度分布式系统中可用的计算节点23。调度节点22具体接收控制节点21的调度指令,根据调度指令调度分布式系统中的计算节点23。
在上述调度分布式系统中的计算节点23的过程中,控制节点21通过调度节点22向计算节点23提供后续加载第二数据表中的数据记录所需的配置文件,该配置文件记载有第二数据表的标识、存储位置、以及需要加载的数据记录的标识信息等。
在分布式系统中各计算节点23上部署有加载进程,该加载进程主要根据配置文件,将第二数据表中的数据记录加载到缓存模块中。具体的,调度模块22激活各计算节点23上的加载进程,加载进程根据配置文件,到相应存储位置读取第二数据表中的相应数据记录,将其所读取的数据记录加载到缓存模块中。值得说明的是,第二数据表可以存储在分布式系统 之外的空间中,但并不限于此。
当所有计算节点23上的加载进程执行完加载操作,即均进入监听端口状态时,通过调度节点22向控制节点21返回一个加载结束指令。控制节点21根据该加载结束指令,可以获知各计算节点23已经将第二数据表中的数据记录加载到缓存模块中。
控制节点21向调度节点22发送激活指令,使得调度节点22激活各计算节点23上的处理进程。在各计算节点23上部署有处理进程,处理进程主要用于读取第一数据表中的数据记录作为当前数据记录,根据所读取的当前数据记录对应的key,确定该key对应的第二数据表中的数据记录所在的计算节点23,读取所确定的计算节点23上存储的第二数据表中的数据记录作为目标数据记录,对所读取的当前数据记录和目标数据记录进行Join操作。值得说明的是,第一数据表可以存储在分布式系统之外的空间中,但并不限于此。
可选的,在一种具体实现方式中,上述各计算节点23可以采用服务端/客户端的方式实现。例如,各计算节点23的缓存模块可以作为缓存服务端(CacheService)实现,该缓存服务端还包括一个缓存管理者(CacheManager),各缓存模块对应一个缓存节点(CacheNode);相应的,各计算节点23的处理模块作为缓存客户端(CacheClient)实现。
具体的,CacheManager协调管理所有CacheNode。CacheNode负责加载数据到内存,并提供服务。可选的,第二数据表可以用shard文件的形式进行存储管理,采用shard文件的目的是因为在故障(failover)时,一但CacheNode重启,只需再次读入shard文件,使得处理相对简单。
CacheClient访问CacheService,通过对key进行hash计算,并根据计算结果从其中某个CacheNode读取数据。此外,CacheClient中应该有一部分本地缓存,通常会使用近期最少使用算法(Least Recently Used,LRU)等缓存算法将部分已经读取的数据保存在本地缓存中,这样CacheClient可以优先从本地缓存中读取所需的数据,如果在本地缓存中读取到所需的数据,可以节约通过网络从CacheNode读取数据的操作,有利于提高效率、节约资源。
由上述分析可见,本实施例在处理数据表连接任务时,首先根据其中的连接条件,将第二数据表中的数据记录加载到至少两个节点上,实现分布式存储,使得可以直接读取第一数据表中的数据记录,并根据所读取的第一数据表中的数据记录对应的连接条件,从相应节点上读取所需的第二数据表中的数据记录,之后对读取到的两个数据表中的数据记录进行Join操作,实现分布式的Hash map Join。由此可见,本实施例只需将第二数据表按照连接条件分布到不同节点上,不需要将第一数据表分布到不同节点上,减少了shuffle排序需要处理的数据量,有利于降低连接操作所消耗的计算资源。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
图3为本申请又一实施例提供的数据表连接装置的结构示意图。如图3所示,该装置包括:接收模块31、加载模块32、读取模块33和连接模块34。
接收模块31,用于接收数据表连接任务,该数据表连接任务指示按照连接条件对第一数据表和第二数据表进行连接操作。
加载模块32,用于根据连接条件,将第二数据表中的数据记录加载到分布式系统中至少两个节点上。
读取模块33,用于读取第一数据表中的数据记录作为当前数据记录,根据当前数据记录对应的连接条件,从至少两个节点中确定目标节点,并读取目标节点上存储的第二数据表中的数据记录作为目标数据记录。
连接模块34,用于对当前数据记录和目标数据记录进行连接操作。
优选的,位于至少两个节点中每个节点上的第二数据表中的数据记录,其数据量小于单个节点的内存限制,也就是说,分布到至少两个节点中每个节点上的第二数据表中的数据记录,均能够全部放到相应节点的存储空间(优选为内存)中。
进一步,如图4所示,该装置还包括:第一判断模块35。
第一判断模块35,用于判断第二数据表的数据量是否大于单个节点的内存限制,以及在判断结果为是时触发加载模块32执行根据连接条件,将第二数据表中的数据记录加载到分布式系统中至少两个节点上的操作。
更进一步,如图4所示,该装置还包括:第二判断模块36。
第二判断模块36,用于根据当前数据记录对应的连接条件,判断本地缓存中是否存在所述目标数据记录,以及在判断结果为否时触发读取模块33执行根据当前数据记录对应的连接条件,从至少两个节点中确定目标节点,并读取目标节点上存储的第二数据表中的数据记录作为目标数据记录的操作。
在一可选实施方式中,上述连接条件包括连接所需的至少一个目标键。这里的目标键实际上是键值对中的键。
基于上述,加载模块32具体用于:
分别对所述至少一个目标键中的各目标键进行哈希运算,以获取各目标键的哈希值;
根据各目标键的哈希值和所述至少两个节点的数量,确定各目标键对应的节点;
将所述第二数据表中对应于各目标键的数据记录分别加载到各目标键对应的节点上。
在一可选实施方式中,加载模块32具体用于:
根据所述连接条件,将所述第二数据表中的数据记录加载到所述至少两个节点的内存中。第二数据表中的数据记录存储在节点的内存中,可以随时读取,读取速度较快,有利于提高Join操作的效率。
值得说明的是,优选的,可以将第二数据表中的数据记录加载到上述 至少两个节点的内存中,但并不限于内存,还可以是节点的SSD或者其他存储介质中。
本实施例提供的数据表连接装置,在处理数据表连接任务时,首先根据其中的连接条件,将第二数据表中的数据记录加载到分布式系统中至少两个节点上,这相当于变成了一个分布式的KV存储,这样不需要做Sort Merge Join,使得可以做分布式的Hash map Join,即不需要对第一数据中的数据记录进行排序,而是可以直接读取第一数据表中的数据记录,并根据所读取的第一数据表中的数据记录对应的连接条件,从相应节点上读取所需的第二数据表中的数据记录,之后对读取到的两个数据表中的数据记录进行连接操作。由此可见,采用本实施例提供的数据表连接装置,只需将第二数据表按照连接条件分布到不同节点上,不需要将第一数据表分布到不同节点上,减少了shuffle排序需要处理的数据量,有利于降低连接操作所消耗的计算资源。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在 一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (10)

  1. 一种数据表连接方法,其特征在于,包括:
    接收数据表连接任务,所述数据表连接任务指示按照连接条件对第一数据表和第二数据表进行连接操作;
    根据所述连接条件,将所述第二数据表中的数据记录加载到分布式系统中至少两个节点上;
    读取所述第一数据表中的数据记录作为当前数据记录,根据所述当前数据记录对应的连接条件,从所述至少两个节点中确定目标节点,并读取所述目标节点上存储的所述第二数据表中的数据记录作为目标数据记录;
    对所述当前数据记录和所述目标数据记录进行连接操作。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述连接条件,将所述第二数据表中的数据记录加载到分布式系统中至少两个节点上之前,包括:
    判断所述第二数据表的数据量是否大于单个节点的内存限制;
    若判断结果为是,则执行根据所述连接条件,将所述第二数据表中的数据记录加载到分布式系统中至少两个节点上的操作。
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述当前数据记录对应的连接条件,从所述至少两个节点中确定目标节点,并读取所述目标节点上存储的所述第二数据表中的数据记录作为目标数据记录之前,包括:
    根据所述当前数据记录对应的连接条件,判断本地缓存中是否存在所述目标数据记录;
    若判断结果为否,则执行根据所述当前数据记录对应的连接条件,从所述至少两个节点中确定目标节点,并读取所述目标节点上存储的所述第二数据表中的数据记录作为目标数据记录的操作。
  4. 根据权利要求1所述的方法,其特征在于,所述连接条件包括连 接所需的至少一个目标键;
    所述根据所述连接条件,将所述第二数据表中的数据记录加载到分布式系统中至少两个节点上,包括:
    分别对所述至少一个目标键中的各目标键进行哈希运算,以获取各目标键的哈希值;
    根据各目标键的哈希值和所述至少两个节点的数量,确定各目标键对应的节点;
    将所述第二数据表中对应于各目标键的数据记录分别加载到各目标键对应的节点上。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述根据所述连接条件,将所述第二数据表中的数据记录加载到分布式系统中至少两个节点上,包括:
    根据所述连接条件,将所述第二数据表中的数据记录加载到所述至少两个节点的内存中。
  6. 一种数据表连接装置,其特征在于,包括:
    接收模块,用于接收数据表连接任务,所述数据表连接任务指示按照连接条件对第一数据表和第二数据表进行连接操作;
    加载模块,用于根据所述连接条件,将所述第二数据表中的数据记录加载到分布式系统中至少两个节点上;
    读取模块,用于读取所述第一数据表中的数据记录作为当前数据记录,根据所述当前数据记录对应的连接条件,从所述至少两个节点中确定目标节点,并读取所述目标节点上存储的所述第二数据表中的数据记录作为目标数据记录;
    连接模块,用于对所述当前数据记录和所述目标数据记录进行连接操作。
  7. 根据权利要求6所述的装置,其特征在于,还包括:
    第一判断模块,用于判断所述第二数据表的数据量是否大于单个节点 的内存限制,以及在判断结果为是时触发所述加载模块执行根据所述连接条件,将所述第二数据表中的数据记录加载到分布式系统中至少两个节点上的操作。
  8. 根据权利要求6所述的装置,其特征在于,还包括:
    第二判断模块,用于根据所述当前数据记录对应的连接条件,判断本地缓存中是否存在所述目标数据记录,以及在判断结果为否时触发所述读取模块执行根据所述当前数据记录对应的连接条件,从所述至少两个节点中确定目标节点,并读取所述目标节点上存储的所述第二数据表中的数据记录作为目标数据记录的操作。
  9. 根据权利要求6所述的装置,其特征在于,所述连接条件包括连接所需的至少一个目标键;
    所述加载模块具体用于:
    分别对所述至少一个目标键中的各目标键进行哈希运算,以获取各目标键的哈希值;
    根据各目标键的哈希值和所述至少两个节点的数量,确定各目标键对应的节点;
    将所述第二数据表中对应于各目标键的数据记录分别加载到各目标键对应的节点上。
  10. 根据权利要求6-9任一项所述的装置,其特征在于,所述加载模块具体用于:
    根据所述连接条件,将所述第二数据表中的数据记录加载到所述至少两个节点的内存中。
PCT/CN2017/074177 2016-03-02 2017-02-20 数据表连接方法及装置 Ceased WO2017148297A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610118167.7 2016-03-02
CN201610118167.7A CN107153643B (zh) 2016-03-02 2016-03-02 数据表连接方法及装置

Publications (1)

Publication Number Publication Date
WO2017148297A1 true WO2017148297A1 (zh) 2017-09-08

Family

ID=59742547

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/074177 Ceased WO2017148297A1 (zh) 2016-03-02 2017-02-20 数据表连接方法及装置

Country Status (3)

Country Link
CN (1) CN107153643B (zh)
TW (1) TWI746511B (zh)
WO (1) WO2017148297A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111506670A (zh) * 2019-01-31 2020-08-07 阿里巴巴集团控股有限公司 一种数据处理方法、装置及设备
CN111752972A (zh) * 2020-07-01 2020-10-09 浪潮云信息技术股份公司 基于RocksDB的key-value存储模式下的数据关联查询方法及系统
CN112732715A (zh) * 2020-12-31 2021-04-30 星环信息科技(上海)股份有限公司 一种数据表关联方法、设备以及存储介质
CN113672641A (zh) * 2021-08-18 2021-11-19 北京金山云网络技术有限公司 数据库集群数据处理方法、装置、系统、介质和电子设备

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710643B (zh) * 2018-12-20 2020-11-13 上海达梦数据库有限公司 外连接管理方法、装置、服务器及存储介质
CN110413670B (zh) * 2019-06-28 2023-07-14 创新先进技术有限公司 基于MapReduce的数据导出方法、装置及设备
US11520738B2 (en) * 2019-09-20 2022-12-06 Samsung Electronics Co., Ltd. Internal key hash directory in table
CN112835888A (zh) * 2019-11-25 2021-05-25 华为技术有限公司 联结方法以及相关设备
CN112597148A (zh) * 2020-11-25 2021-04-02 联想(北京)有限公司 一种数据表的连接方法和装置
CN116610718A (zh) * 2023-05-22 2023-08-18 平安壹钱包电子商务有限公司 数据库查询方法及装置、存储介质、计算机设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7085769B1 (en) * 2001-04-26 2006-08-01 Ncr Corporation Method and apparatus for performing hash join
CN102214176A (zh) * 2010-04-02 2011-10-12 中国人民解放军国防科学技术大学 超大维表的切分与表连接方法
CN104391957A (zh) * 2014-12-01 2015-03-04 浪潮电子信息产业股份有限公司 一种针对混合型大数据处理系统的数据交互分析方法
CN104504114A (zh) * 2014-12-30 2015-04-08 杭州华为数字技术有限公司 基于多哈希表的关系操作优化方法、装置和系统
CN105183880A (zh) * 2015-09-22 2015-12-23 浪潮集团有限公司 一种哈希连接的方法及装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7177874B2 (en) * 2003-01-16 2007-02-13 Jardin Cary A System and method for generating and processing results data in a distributed system
CN102467570B (zh) * 2010-11-17 2014-03-12 日电(中国)有限公司 用于分布式数据仓库的连接查询系统和方法
CN102323947B (zh) * 2011-09-05 2013-07-10 东北大学 环形架构数据库上预连接表的生成方法
CN104424240B (zh) * 2013-08-27 2019-06-14 腾讯科技(深圳)有限公司 多表关联方法、主服务节点、计算节点及系统
US20160055212A1 (en) * 2014-08-22 2016-02-25 Attivio, Inc. Automatic joining of data sets based on statistics of field values in the data sets
TWI522827B (zh) * 2015-01-09 2016-02-21 Chunghwa Telecom Co Ltd Real-time storage and real-time reading of huge amounts of data for non-related databases
CN105045871B (zh) * 2015-07-15 2018-09-28 国家超级计算深圳中心(深圳云计算中心) 数据聚合查询方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7085769B1 (en) * 2001-04-26 2006-08-01 Ncr Corporation Method and apparatus for performing hash join
CN102214176A (zh) * 2010-04-02 2011-10-12 中国人民解放军国防科学技术大学 超大维表的切分与表连接方法
CN104391957A (zh) * 2014-12-01 2015-03-04 浪潮电子信息产业股份有限公司 一种针对混合型大数据处理系统的数据交互分析方法
CN104504114A (zh) * 2014-12-30 2015-04-08 杭州华为数字技术有限公司 基于多哈希表的关系操作优化方法、装置和系统
CN105183880A (zh) * 2015-09-22 2015-12-23 浪潮集团有限公司 一种哈希连接的方法及装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111506670A (zh) * 2019-01-31 2020-08-07 阿里巴巴集团控股有限公司 一种数据处理方法、装置及设备
CN111506670B (zh) * 2019-01-31 2023-07-18 阿里巴巴集团控股有限公司 一种数据处理方法、装置及设备
CN111752972A (zh) * 2020-07-01 2020-10-09 浪潮云信息技术股份公司 基于RocksDB的key-value存储模式下的数据关联查询方法及系统
CN112732715A (zh) * 2020-12-31 2021-04-30 星环信息科技(上海)股份有限公司 一种数据表关联方法、设备以及存储介质
CN112732715B (zh) * 2020-12-31 2023-08-25 星环信息科技(上海)股份有限公司 一种数据表关联方法、设备以及存储介质
CN113672641A (zh) * 2021-08-18 2021-11-19 北京金山云网络技术有限公司 数据库集群数据处理方法、装置、系统、介质和电子设备

Also Published As

Publication number Publication date
CN107153643B (zh) 2021-02-19
TW201738781A (zh) 2017-11-01
CN107153643A (zh) 2017-09-12
TWI746511B (zh) 2021-11-21

Similar Documents

Publication Publication Date Title
WO2017148297A1 (zh) 数据表连接方法及装置
US10719260B2 (en) Techniques for storing and retrieving data from a computing device
US10996993B2 (en) Adaptive work distribution in distributed systems
US20190250852A1 (en) Distributed compute array in a storage system
CN104504147B (zh) 一种数据库集群的资源协调方法、装置及系统
WO2017157160A1 (zh) 数据表连接方式处理方法及装置
CN103218455A (zh) Key-Value数据库用户请求的高速并发处理方法
US8635682B2 (en) Propagating security identity information to components of a composite application
WO2016177130A1 (zh) 通讯节点的选择方法及装置
CN107181636B (zh) 一种负载均衡系统中的健康检查方法及装置
US10789087B2 (en) Insight usage across computing nodes running containerized analytics
US20140059312A1 (en) Recording medium, computer, and information processing system
US20220091940A1 (en) Backup task processing in a data storage system
US20230019037A1 (en) Reactive non-blocking input and output for target device communication
US20140089260A1 (en) Workload transitioning in an in-memory data grid
CN120407543A (zh) 一种内存数据库的启用方法、系统、设备及介质
CN112988874A (zh) 一种数据处理方法、系统、计算设备及可读存储介质
CN114130035B (zh) 一种用户匹配方法、装置、设备及存储介质
CN115238006A (zh) 检索数据同步方法、装置、设备及计算机存储介质
US11307780B2 (en) Cluster group change preparation techniques
US11960510B2 (en) Data movement from data storage clusters
CN113626263B (zh) Scst存储系统中保持数据一致性的方法及应用
CN118069354A (zh) 一种负载均衡方法、装置、设备及介质
US11271992B2 (en) Lazy lock queue reduction for cluster group changes
CN108958967A (zh) 一种数据处理的方法以及服务器

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17759148

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17759148

Country of ref document: EP

Kind code of ref document: A1