Method and system for performing vectorized deletion in distributed database system
By clustering and parallel processing multiple files in a distributed database system to generate a differential array, the problem of inefficient data deletion operations in the existing technology is solved, and efficient data compliance maintenance and GDPR requirements are met.
Patent Information
- Application Number
- CN202380025566.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-03-30
- Filing Date
- 2023-01-20
- Publication Date
- 2024-10-22
AI Technical Summary
Existing distributed database systems are inefficient in maintaining data compliance, especially when performing large-scale data deletion operations, which results in increased computing time and cannot effectively meet the requirements of data regulations such as GDPR.
By clustering multiple files in a distributed database system, generating delta arrays based on the similarity of storage solutions, using parallel processing technology to read and connect shards in parallel, generate and separate delta arrays, thereby achieving vectorized deletion operation, reducing waiting time and processing resource consumption.
Significantly improves the performance of data deletion operations, reduces the computing time required to maintain data compliance, and improves system efficiency and resource utilization.
Smart Images

Figure CN118829979A_ABST
Abstract
Description
Background Art
[0001] There are distributed database systems that store data for various entities, clients, business units, etc. across various computing nodes in a network (such as in a cloud computing environment). Data from a distributed database system can be accessed using a massively parallel query engine, which can have an execution runtime consisting of an operator chain. In addition, data compliance can be enforced for data in a distributed database system. The data compliance to be enforced can meet requirements set by a government entity, such as the General Data Protection Regulation (GDPR) in the European Union (EU). For example, complying with GDPR requirements can include deleting data from a distributed database system that does not comply (or no longer complies) with GDPR requirements. Some metrics indicate that approximately 20% of computing time is spent on maintaining data compliance. Summary of the invention
[0002] A simplified summary of one or more implementations of the present disclosure is presented below in order to provide a basic understanding of such implementations. The summary is not an extensive overview of all contemplated implementations, and is neither intended to identify key or critical elements of all implementations, nor to delineate the scope of any or all implementations. Its sole purpose is to present some concepts of one or more implementations of the present disclosure in a simplified form as a preface to the specific embodiments presented later.
[0003] In one aspect, a computer-implemented method for performing vectorized deletions in a distributed database system is provided, the method comprising clustering a plurality of files stored in the distributed database system, wherein the clustering is based at least in part on similarities of storage schemes used to store data in the plurality of files, and generating, for each of the plurality of files and based on a deletion signal, a delta array comprising a plurality of bits representing data items in the file and indicating, based on bit values, target data items to be deleted from the file. Generating a differential array for each file in a plurality of files may include reading a plurality of first file slices from a first file in the plurality of files, each of the plurality of first file slices including a portion of a first data item in the first file, including, for each of the plurality of first file slices, performing a first join operation using a delete signal to generate a portion of a first differential array corresponding to a given first file slice, including reading a plurality of second file slices from a second file in the plurality of files, each of the plurality of second file slices including a portion of a second data item in the second file, and including, for each of the plurality of second file slices, performing a second join operation using a delete signal to generate a portion of a second differential array corresponding to a given second file slice. Reading at least one of the plurality of second file slices is performed before the first join operation on at least one of the plurality of first file slices is completed.
[0004] In another aspect, a device for performing vectorized deletion in a distributed database system is provided, the device comprising a memory storing instructions, and at least one processor coupled to the memory. The at least one processor is configured to execute the instructions to cluster a plurality of files stored on the distributed database system, wherein the clustering is based at least in part on similarities of storage schemes for storing data in the plurality of files, and to generate a delta array for each file in the plurality of files and based on a deletion signal, the delta array comprising a plurality of bits representing data items in the file and indicating target data items to be deleted from the file based on bit values. Generating a differential array for each file in a plurality of files includes reading a plurality of first file slices from a first file in the plurality of files, each of the plurality of first file slices including a portion of a first data item in the first file, including, for each of the plurality of first file slices, performing a first join operation using a delete signal to generate a portion of a first differential array corresponding to a given first file slice, including reading a plurality of second file slices from a second file in the plurality of files, each of the plurality of second file slices including a portion of a second data item in the second file, and including, for each of the plurality of second file slices, performing a second join operation using a delete signal to generate a portion of a second differential array corresponding to a given second file slice. Reading at least one of the plurality of second file slices is performed before the first join operation on at least one of the plurality of first file slices is completed.
[0005] In another aspect, a non-transitory computer-readable device is provided having instructions stored thereon that, when executed by at least one computing device, cause the at least one computing device to perform operations including clustering a plurality of files stored in a distributed database system, wherein the clustering is based at least in part on similarities of storage schemes used to store data in the plurality of files, and generating, for each of the plurality of files and based on a deletion signal, a delta array, the delta array including a plurality of bits representing data items in the file and indicating, based on bit values, target data items to be deleted from the file. Generating a differential array for each file in a plurality of files includes reading a plurality of first file slices from a first file in the plurality of files, each of the plurality of first file slices including a portion of a first data item in the first file, including, for each of the plurality of first file slices, performing a first join operation using a delete signal to generate a portion of a first differential array corresponding to a given first file slice, including reading a plurality of second file slices from a second file in the plurality of files, each of the plurality of second file slices including a portion of a second data item in the second file, and including, for each of the plurality of second file slices, performing a second join operation using a delete signal to generate a portion of a second differential array corresponding to a given second file slice. Reading at least one of the plurality of second file slices is performed before the first join operation on at least one of the plurality of first file slices is completed.
[0006] In another aspect, example computer-readable media storing instructions for performing the methods described herein and example apparatus including means for performing the operations of the methods described herein are also disclosed.
[0007] Additional advantages and novel features associated with the implementation of the present disclosure will be set forth in part in the following description and in part will become more apparent to those skilled in the art upon examination of the following or through practice. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The detailed description is described with reference to the drawings, in which the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. The same reference numbers in the same or different drawings indicate similar or identical items or features.
[0009] Figure 1 is a diagram illustrating an example of a computing system according to some aspects of the present disclosure.
[0010] Figure 2 is a diagram illustrating examples of input / output (I / O) operations and corresponding conceptual performance graphs according to some aspects of the present disclosure.
[0011] Figure 3 is a flow chart illustrating an example of a method for performing vectorized delete operations in a distributed database system according to some aspects of the present disclosure.
[0012] Figure 4 is a flow chart illustrating an example of a method for clustering target data sources for vectorized delete operations according to some aspects of the present disclosure.
[0013] Figure 5 is a conceptual diagram of data flow for performing a vectorized delete operation according to some aspects of the present disclosure.
[0014] Figure 6 is a block diagram illustrating an example of a hardware implementation for a computing device according to some aspects of the present disclosure. DETAILED DESCRIPTION
[0015] The specific embodiments described below in conjunction with the accompanying drawings are intended to be descriptions of various configurations, rather than being intended to represent the only configurations in which the concepts described herein can be practiced. The specific embodiments include specific details for the purpose of providing a thorough understanding of the various concepts. However, it is obvious to those skilled in the art that the concept can be practiced without the specific details. In some cases, well-known components are shown in block diagram form to avoid blurring such concepts.
[0016] The present disclosure describes a technique for performing vectorized deletion in a distributed database system. A distributed database system may include a database system that can store data across various computing nodes in a network or environment (such as a cloud computing environment). For example, a distributed database system may store data in various files that may exist on various computing nodes (e.g., servers). For example, a distributed database system may be a file system or may include a file system that indicates where certain data is stored (e.g., the file location of data in a distributed database system). A distributed database system may include a parallel query engine, or may operate with a parallel query engine that can interact with data in a distributed database system to return query results. For example, a parallel query engine may support queries defined in a structured query language (SQL-like) format, including "SELECT", "JOIN", "DELETE", or similar statements to be executed on data.
[0017] For example, a distributed database system can store data in a file as append-only, which can be optimized for input / output (I / O) operations. In order to store new data, each append can be a data block (trunk) / segment (extent) of a fixed size (e.g., number of megabytes), and once the append is completed, the file can be immutable. I / O can be performed in parallel, where row boundaries can be aligned with segment boundaries. In addition, in some examples, a distributed database system can use an optimized file format to improve query performance, such as structured streaming. For example, a structured stream can be defined on a file system using indexes and shards to divide files into shards based on indexes. Shards can also be files that store parts of data in the original file. In addition, in some examples, shards can be stored on various distributed computing nodes.
[0018] In a distributed database system, data deletion can be performed by maintaining a delta array. For example, the distributed database system can perform a connection (or other conditions) of the target data and a delete signal including a delete key to output a bit array (delta array) of deleted rows, wherein one bit value (e.g., "1") can indicate that the row is deleted, and another bit value (e.g., "0") can indicate that the row is not deleted. When data is scanned or otherwise read from a file (e.g., for a SELECT query), the distributed database system can read the target data together with the delta array to output rows that have not been deleted (e.g., skipping rows marked as deleted).
[0019] Data can be deleted from a distributed database system to comply with data regulations, such as the General Data Protection Regulation (GDPR) in the European Union (EU). GDPR may have a grace period for deleting data, and therefore delta array deletion may be used. In a distributed database system, the same user may typically use similar schemes to store the same series of data, and the user may perform batch deletions of multiple streams. The result after the join operation in the delete may be negligible in size (e.g., a number of kilobytes or a number of megabytes), and most of the processing or delay of the delete operation may be spent on waiting for I / O on the target data (e.g., retrieving data across multiple shards of one or more files) and on the join operation to connect the target data with the delete signal.
[0020] Since users can often use similar schemes to store the same series of data, target data for possible deletion can be clustered. For example, there may be some homogeneity in the data scheme used to store certain data (such as in indexing, sharding, sorting schemes, etc.). In one example, some data can share a sharding storage scheme, such as sharding based on the same key using a hash function, range sharding based on the same key, etc.
[0021] Here, aspects described herein relate to clustering data targets for possible deletion by utilizing similarities of data storage schemes. For example, target data that is sharded using a hash function on the same key or a range on the same key can be clustered for performing a delete operation. Here, clustering the target data can allow a worker thread to scan two different homogeneous shards in parallel to obtain data for connection with a delete signal and / or to perform a connection operation in parallel for two different homogeneous shards. A delta array can be output in parallel with each entry having source data to allow subsequent separation of entries into corresponding delta arrays for the delete target.
[0022] Performing this operation in parallel can alleviate the wait time that would otherwise be associated with performing I / O intensive steps sequentially: for example, retrieving the first shard, connecting the first shard with the delete signal, then retrieving the second shard and connecting the second shard with the delete signal. This can significantly improve the performance of the delete operation and reduce the number or proportion of compute hours used to maintain data compliance.
[0023] Illustrative Environment
[0024] Figure 1 A diagram illustrating an example of a computing system 100 in accordance with some aspects of the present disclosure is shown.
[0025] like Figure 1As illustrated, computing system 100 may include or be part of a cloud computing platform in which various computing nodes may be accessed via one or more networks 106. In one example, computing system 100 may include a distributed database system 102 that may be distributed across multiple computing nodes in computing system 100 and may be accessed to each other and / or to one or more of multiple client devices 104(1)-(j) via one or more networks. Computing system 100 may provide distributed storage and access to software, services, files, and / or data to client devices 104(1)-(j) via one or more networks 106, and / or access to distributed database system 102 or one or more components thereof to store data, manage stored data, etc. The network(s) 106 may include any one or any combination of a plurality of different types of networks, such as a cellular network, a wireless network, a local area network (LAN), a wide area network (WAN), a personal area network (PAN), the Internet, or any other type of network configured to communicate information between computing devices (e.g., the distributed database system 102 or one or more components thereof, client devices 104(1)-(j), etc.). Some examples of client devices 104(1)-(j) include computing devices, smart phone devices, Internet of Things (IoT) devices, drones, robots, process automation equipment, sensors, control devices, vehicles, transportation equipment, tactile interaction equipment, virtual reality and augmented reality (VR and AR) devices, industrial machines, virtual machines, etc. In addition, in some aspects, the client devices 104 may include one or more applications configured to interface with the distributed database system 102 to execute queries (e.g., using a query language that can be interpreted and processed by a parallel query engine on the distributed database system 102). Client devices 104 ( 1 )-( j ) may be associated with a customer (ie, tenant), business unit, etc., and may store data on distributed database system 102 , respectively.
[0026] Distributed database system 102 may store data in files such as files 112(1)-(n). As described, files 112(1)-(n) may store data by appending data as segments to the end of a given file, which optimizes data insertion for sequential I / O. Each append may be a fixed-size block or segment of data, and once the append is completed, the file may be immutable. The file may correspond to a given batch of data for a given client, such as a table of rows / columns. Row boundaries may be aligned with segment boundaries so that each segment may be or include one or more rows of a table. In an example, client devices 104(1)-(j) may store data in distributed database system 102, which may include inserting data using a query language (e.g., an INSERT command). Distributed database system 102 may manage the insertion of data into the database by appending data to the appropriate file or files in files 112(1)-(n).
[0027] In addition, for example, distributed database system 102 may store files as multiple shards (e.g., shards 114(1)-(m) for file 112(1), shards 116(1)-(o) for file 112(n), etc.). For example, the shards may correspond to structured streams that may be generated by indexing and sharding each file based on an index. For example, each shard may include an index and metadata that may indicate one or more of the statistics of the shard, the sharding scheme, the location of the shard, searchability within the shard, etc. In one example, the shards may be created by a user (e.g., by client devices 114(1)-(j)) who manages the data stored in distributed database system 102. In one example, a hash function may be used on a key value in the data to generate the shards and / or the shards may be sorted based on the same key value or another key value in the data. In another example, a range function may be used on a key value in the data to generate the shards and / or the shards may be sorted based on the same key value or another key value in the data. In some examples, some of files 112(1)-(n) may have similarities in the storage scheme, such as similar sharding (e.g., sharding using the same key or similar keys), similar indexing, similar ordering, etc. As described in further detail herein, files having similarities in the storage scheme may be clustered for vectorized delete operations.
[0028] In one aspect, the distributed database system 102 may include a vectorized delete module 120 that can perform vectorized delete operations on data stored in files (e.g., files 112(1)-(n)). The vectorized delete module 120 may include a data clustering module 122 for clustering target data sources (e.g., files or shards) to perform vectorized delete operations on the target data, a data retrieval module 124 for retrieving the target data from the target data source, a join module 126 for performing a join operation (or other conditions) between the target data and a delete signal to generate a delta array, and / or an array separation module 128 for separating the delta array data from the join module 126 into separate delta arrays (e.g., separate delta arrays 130(1)-(p)) for a given file or target data source. The distributed database system 102 may also include a data compliance module 132 that can generate a delete signal to the vectorized delete module 120 to cause the data to be deleted from the distributed database system 102 (or at least to cause the delta arrays to be generated or updated for certain target data sources). In other examples, vectorized delete module 120 may also receive delete signals from other sources, such as from one or more other components of distributed database system 102, client devices 104(1)-(j), etc.
[0029] Figure 2 is a diagram illustrating examples of I / O operations 200 , 240 and corresponding conceptual performance graphs 220 , 260 .
[0030] The I / O operation 200 may represent a conventional delete performed on file 1 202 and file 2 204 based on a delete signal 206. For example, the delete signal 206 may indicate parameters for deleting data from target data sources (file 1 202 and file 2 204), which may include generating a delta array for each target data source. For example, the delete signal 206 may include a text file indicating the data to be deleted, which may be specified based on a key value. In an example, the delete signal 206 may be the result of a delete operation, such as DELETE A FROM A JOIN B ON A.Key == B.Key, where A = file 1 202 (or file 2 204), and B = EXTRACT FROM signal 206. In conventional I / O operation 200, join operation 208 may be performed by worker thread 210 to determine data to be deleted from file 1 202 based on signal 206 and generate corresponding delta array 216, and join operation 212 may be performed by worker thread 214 to determine data to be deleted from file 1 204 based on signal 206 and generate corresponding delta array 218. Worker threads 210, 214 operate one at a time, such that worker thread 210 reads data from file 1 202, performs join 208, and generates delta array 216 before worker thread 214 begins reading data from file 2 204. This is reflected in conceptual performance chart 220, which shows worker thread 210 performing read 207 followed by join 208, and worker thread 214 then performing read 211 followed by join 212.
[0031] Aspects described herein relate to more efficient I / O operations 240. In I / O operations 240, a single worker thread 242 may read data from file 1 202 and file 2 204 simultaneously and / or may perform join operations 208, 212 simultaneously. In one example, as part of or before performing the I / O operations 240, target data to be deleted may be clustered based on having similar storage schemes, so that the delete operations performed on the target data may be similar and may therefore be performed by a multi-threaded vectorized driver 244. In an example, the vectorized delete module 120 may employ the vectorized driver 244 to perform stages of the delete operation in parallel for different target data sources. In I / O operations 240, the vectorized driver 244 may read data from file 1 202 and file 2 204 in parallel, and / or may perform join operations 208, 212 in parallel based on data having similar storage schemes, as described above. This may allow for time savings and / or processing resource savings, as reflected in conceptual performance chart 260, which shows worker thread 242 performing read 207 and read 211 concurrently and then concurrently performing join 208 and join 212. In addition, join operation 208 may be performed for file 1 202 concurrently with read 211 being performed for file 2 204, or using similar resources (e.g., the same processor) as those used for read 211, which may provide additional time (latency) savings and / or processing resource (PnHrs) savings.
[0032] Example Process
[0033] The following Figure 3 The process described in is illustrated as a batch of boxes in a logical flow chart, which represents a sequence of operations that can be implemented in hardware, software, or a combination thereof. In the context of software, the box represents a computer-executable instruction stored on one or more computer-readable storage media, which performs the operation when the instruction is executed by one or more processors. In general, computer-executable instructions include routines, programs, objects, components, data structures, and the like that perform specific functions or implement specific abstract data types. The order in which the operations are described is not intended to be construed as a limitation, and any number of the described boxes may be combined in any order and / or in parallel to implement the process. The operations described herein may, but need not, be implemented using a distributed database system 102, a vectorized deletion module 120, their components or modules, and the like. By way of example and not limitation, in Figure 1 and / or Figure 2 The method 300 is described in the context of . For example, the operation can be performed by one or more of the distributed database system 102, the vectorized delete module 120, their components or modules, etc.
[0034] Figure 3 is a flow chart illustrating an example of a method 300 for performing vectorized delete operations in a distributed database system according to some aspects of the present disclosure.
[0035] At box 302, the method 300 may include clustering multiple files stored in a distributed database system. For example, the data clustering module 122 (e.g., in conjunction with the processor 602, the memory 604, the computing device 600, the distributed database system 102, the vectorized deletion module 120, etc.) may cluster multiple files or at least portions of multiple files (e.g., shards of multiple files) stored in the distributed database system. For example, the data clustering module 122 may cluster multiple files based on multiple files having similar storage schemes (e.g., similar indexes, shards, or sorting schemes). In one example, the data clustering module 122 may cluster multiple files based on the files using a hash function or a range function based on the same key or similar keys to generate corresponding shards. For example, the data clustering module 122 may cluster multiple files for vectorized deletion. For example, the data clustering module 122 can cluster multiple files by associating data for reading and joining in parallel (as described above and further herein), so that a single worker thread can perform the reading and joining, and can read from one file or shard while performing a join on another file or shard, etc. In one example, the data clustering module 122 can cluster multiple files based on determining that the multiple files correspond to the same or similar data in the distributed database system 102, determining that the multiple files correspond to the same client or user, determining that the multiple files have similar storage schemes, etc. In addition, for example, the data clustering module 122 can cluster multiple files as part of receiving a delete signal, which can identify the files as a target data source, or can cluster multiple files as part of another process unrelated to receiving a delete signal, etc. The following is combined with Figure 4 A specific, non-limiting example of clustering files for vectorized deletion is shown and described.
[0036] At block 304, method 300 may include generating a delta array for each file in the plurality of files based on the delete signal. For example, vectorized delete module 120 (e.g., in conjunction with processor 602, memory 604, computing device 600, distributed database system 102, etc.) may generate a delta array for each file in the plurality of files based on the delete signal (e.g., a signal received from data compliance module 132, signal 206, etc.). As described, for example, vectorized delete module 120 may use vectorized driver 244 to perform vectorized delete when generating the delta array, so that reading and / or concatenation of different files or corresponding shards may be performed in parallel.
[0037] When generating the difference array, at box 306, multiple first file shards can be read from a first file in the plurality of files, each first file shard including a portion of the first data item in the first file. For example, the data retrieval module 124 (e.g., in conjunction with the processor 602, the memory 604, the computing device 600, the distributed database system 102, the vectorized deletion module 120, etc.) can read multiple first file shards (e.g., shards 114(1)-(m)) from a first file in the plurality of files (e.g., file 112(1), file 1202, etc.), each first file shard including a portion of the first data item in the first file. As described, the multiple first file shards can be generated from the first file using a hash function or a range function based on a key value, and / or the multiple first file shards can be sorted according to the key value (or another key value of the data in the file). In one example, the data retrieval module 124 may retrieve a fixed-size buffer portion of data from a given first file split for performing a join operation, and may continue to read subsequent fixed-size buffer portions until all of the data is retrieved from the given first file split (e.g., before reading the next first file split of the first file).
[0038] When generating the delta array, at block 308, a first join operation utilizing a delete signal may be performed for each of the plurality of first file shards to generate a portion of the first delta array corresponding to the given first file shard. For example, the join module 126 (e.g., in conjunction with the processor 602, the memory 604, the computing device 600, the distributed database system 102, the vectorized delete module 120, etc.) may perform a first join operation utilizing a delete signal for each of the plurality of first file shards to generate a portion of the first delta array corresponding to the given first file shard. For example, the join module 126 may perform a join for each of the plurality of fixed-size buffer portions of the first file shard after reading (e.g., at block 306), and / or may preserve an order of the buffer portions in the shards, and may preserve an order of the shards in the file when generating the delta array bits. Thus, for example, for a given shard of the first file or a buffer of the shard, the connection module 126 may connect the shards or buffers in order using a delete signal, and may complete one connection of the given shard or buffer (or file) before performing the next connection of the next buffer of the given shard or the next shard of the given file, etc. However, in some examples, the data retrieval module 124 may start reading the next buffer of the given shard or the next shard of the given file while the connection module 126 is performing a connection operation on the current buffer or shard of the first file.
[0039] When generating the delta array, at block 310, a plurality of second file shards may be read from a second file of the plurality of files, each second file shard comprising a portion of a second data item in the second file. For example, data retrieval module 124 (e.g., in conjunction with processor 602, memory 604, computing device 600, distributed database system 102, vectorized deletion module 120, etc.) may read a plurality of second file shards (e.g., shards 116(1)-(o)) from a second file of the plurality of files (e.g., file 112(n), file 2 204, etc.), each second file shard comprising a portion of a second data item in the second file. As described, the plurality of second file shards may be generated from the second file using and / or based on a key value that is the same or similar to that of the first file, and / or the plurality of second file shards may be sorted according to the key value (or another key value of the data in the file). In one example, the data retrieval module 124 may retrieve a fixed-size buffer portion of data from a given second file split for performing a join operation, and may continue to read subsequent fixed-size buffer portions until all of the data is retrieved from the given second file split (e.g., before reading the next second file split of the second file).
[0040] When generating the delta array, at block 312, a second join operation utilizing the delete signal may be performed for each of the plurality of second file shards to generate a portion of the second delta array corresponding to the given second file shard. For example, the join module 126 (e.g., in conjunction with the processor 602, the memory 604, the computing device 600, the distributed database system 102, the vectorized delete module 120, etc.) may perform a second join operation utilizing the delete signal for each of the plurality of second file shards to generate a portion of the second delta array corresponding to the given second file shard. For example, the join module 126 may perform a join for each of the plurality of fixed-size buffer portions of the second file shard after reading (e.g., at block 310), and / or may preserve the order of the buffer portions in the shards, and may preserve the order of the shards in the file when generating the delta array bits. Thus, for example, for a given shard of the second file or a buffer of the shard, the connection module 126 may connect the shards or buffers in order using a delete signal, and may complete one connection of the given shard or buffer (or file) before performing the next connection of the next buffer of the given shard or the next shard of the given file, etc. However, in some examples, the data retrieval module 124 may start reading the next buffer of the given shard or the next shard of the given file while the connection module 126 performs the connection operation on the current buffer or shard of the second file.
[0041] In the aspects described herein, one or more of the above boxes can be executed in parallel to save latency and / or save processing resources. For example, the data retrieval module 124 can retrieve data (e.g., a fixed-size buffer) from a first file and a second file at the same time. In another example, the connection module 126 can perform a connection of a first file and a second file, or associated shards or associated fixed-size buffers in parallel. In yet another example, the data retrieval module 124 can retrieve data from a file (or a shard in an associated shard) while the connection module 126 performs a connection for different files or shards (or for shards of the same file). In addition, for example, the vectorized deletion module 120 can also perform read operations and connection operations for one or more other files at the same time similar to the first file and the second file, wherein the one or more other files can also be clustered based on using similar storage schemes, as described above.
[0042] When generating the delta array, optionally at box 314, the results of the first join operation and the results of the second join operation can be grouped in a parallel join. For example, the join module 126 (e.g., in conjunction with the processor 602, the memory 604, the computing device 600, the distributed database system 102, the vectorized deletion module 120, etc.) can output the delta array results of the join operation to the parallel join along with source data indicating which file the output delta array bits belong to. The delta array bits can be output to the parallel join as they are generated. Thus, for example, the parallel join can include a mix of delta array bits for the first file and the second file (and / or additional files), but the delta array bits for a given file are in the order of the data read from the file.
[0043] When generating the differential array, optionally at box 316, the result of the parallel join can be separated into a first differential array and a second differential array based on the source data. For example, the array separation module 128 (e.g., in combination with the processor 602, the memory 604, the computing device 600, the distributed database system 102, the vectorized deletion module 120, etc.) can separate the result of the parallel join into a first differential array and a second differential array based on the source data. In an example, the array separation module 128 can obtain the source data indicated by the connection module 126 for each bit value, and can output the bit in sequence to the first differential array and the second differential array (and / or an additional differential array for an additional file) respectively. As described, the source data may include an identifier indicating the file to which the differential array bit belongs, and the array separation module 128 can separate the bit based on the identifier. For example, the array separation module 128 can separate the differential array bits into the following: Figure 1 The difference array 130(1)-(p) described in Figure 2 Difference arrays 216, 218, etc. described in .
[0044] Figure 4 is a flow chart illustrating an example of a method 400 for clustering target data sources for vectorized delete operations, according to some aspects of the present disclosure.
[0045] At block 402, method 400 may include retrieving files and metadata from identified deletion targets. For example, data clustering module 122 (e.g., in conjunction with processor 602, memory 604, computing device 600, distributed database system 102, vectorized deletion module 120, etc.) may retrieve files and metadata from identified deletion targets. For example, each file may include metadata that stores information about the file, such as a sharding scheme for shards used to store the file, a key value or type of value used to perform sharding (e.g., a column), a type of function used (e.g., a hash function, a range function, etc.), a location of the shards in the distributed file system, a split point of the shards (if range partitioning is used), etc. Given a set of target data sources for deletion, the set of target data sources (e.g., deletion targets, which may include files as described herein) may be identified in a deletion signal, and data clustering module 122 may read metadata associated with each target to perform clustering, as described above and in various examples further herein. In one example, the metadata may also store a delta array for the file, which may be generated as part of the deletion process described herein.
[0046] At block 404, method 400 may include scanning existing clusters for associating a file with a given existing cluster. For example, data clustering module 122 (e.g., in conjunction with processor 602, memory 604, computing device 600, distributed database system 102, vectorized deletion module 120, etc.) may scan existing clusters for associating a file with a given existing cluster. This may be performed at block 402 for each file retrieved as a target data source (deletion target). For each target data source, existing clusters may be scanned to attempt to additionally cluster the file if or until an acceptable cluster is found.
[0047] While scanning for existing clusters, a cluster (e.g., a first cluster) may be retrieved at block 406. For example, data clustering module 122 (e.g., in conjunction with processor 602, memory 604, computing device 600, distributed database system 102, vectorized deletion module 120, etc.) may retrieve the cluster. As further described herein, data clustering module 122 may have created a cluster based on a previous file, and the cluster may have included one or more files.
[0048] While scanning existing clusters, at box 408, constraints of the clusters or parameters of the clusters may be identified. For example, the data clustering module 122 (e.g., in conjunction with the processor 602, the memory 604, the computing device 600, the distributed database system 102, the vectorized deletion module 120, etc.) may identify the constraints of the clusters or the parameters of the clusters. In an example, the constraints may include a join algorithm for the clusters. For example, based on its input, a join algorithm may be more suitable than other types to be a delete connector. For example, a merge sort join may be more efficient when the input is sorted by the join key; a hash join may be more efficient when the input is not sorted by the join key; and a hash join may be better performing when the delete signal fits in the memory. In an example, the data clustering module 122 may select a join algorithm during script compilation time, and the selection of the join algorithm may correspond to constraints for clustering deletion targets—for example, when a merge sort join is selected, unsorted shards may not be merged with sorted shards; when a merge sort join is selected for a shard, another shard consumed by a hash join may not be clustered together, and vice versa, etc.
[0049] Additional clustering constraints or clustering parameters may correspond to data characteristics—e.g., shards that are too large in size may not be regrouped with their subordinate shards; shards that are skewed in join keys may not be grouped with non-skewed shards, etc., e.g., to ensure load balancing, not create a single point of bottleneck, etc. Other constraints may correspond to shards in range partitions may not be clustered with hash partitions and vice versa; delete targets with different types of join key(s) may not be clustered together, etc. For example, in any case, the data clustering module 122 may identify the constraints associated with the clustering and may determine whether the file complies with the constraints.
[0050] While scanning existing clusters, at block 410, a determination may be made as to whether a constraint or parameter is acceptable to a file. For example, the data clustering module 122 (e.g., in conjunction with the processor 602, the memory 604, the computing device 600, the distributed database system 102, the vectorized deletion module 120, etc.) may determine whether a constraint or parameter of a cluster is acceptable to a file. For example, the data clustering module 122 may determine whether a file complies with a constraint, whether a file is consistent with or complies with a parameter of a clustering parameter, etc. In one example, for hash partitioning of files and file clusters, the data clustering module 122 may check whether files in a cluster have the same hash function as files being considered for inclusion in the cluster, or whether a lowest common denominator of key values may be established for files in the cluster and the files being considered. In one example, for range partitioning of files and file clusters, the data clustering module 122 can check whether the split points of the file clusters (e.g., the split points used to generate the key values of the shards) can be redefined to include the split points used in the files under consideration (and / or whether redefining the split points can ensure the desired load balancing).
[0051] If the constraints or parameters are acceptable for the file at block 410, the file may be added to the cluster at block 412. For example, data clustering module 122 (e.g., in conjunction with processor 602, memory 604, computing device 600, distributed database system 102, vectorized deletion module 120, etc.) may add the file to the cluster. If not, the next cluster may be retrieved at 406, and the process of scanning existing clusters may continue until no clusters remain.
[0052] At block 414, method 400 may include determining whether the file is added to the cluster. For example, data clustering module 122 (e.g., in conjunction with processor 602, memory 604, computing device 600, distributed database system 102, vectorized deletion module 120, etc.) may determine whether the file is added to the cluster. If the file is added to the cluster, the next file of the identified deletion target may be retrieved for possible associations with existing clusters, as described above. If the file is not added to the cluster, a new cluster including the file may be created at block 416. For example, data clustering module 122 (e.g., in conjunction with processor 602, memory 604, computing device 600, distributed database system 102, vectorized deletion module 120, etc.) may create a new cluster including the file. In one example, data clustering module 122 may maintain a cluster with the identified file, which may include maintaining metadata for the cluster (e.g., a common sharding scheme, key value, split point, etc.) for later identifying constraints or parameters for files in the cluster. In another example, when the data clustering module 122 identifies constraints and / or parameters for files in a cluster by evaluating each file in the cluster during a scan (at block 408 ).
[0053] Figure 5 is a conceptual diagram of a data stream 500 for performing a vectorized delete operation according to aspects of the present disclosure. In data stream 500, shard 1 of file 1 and shard N of file 2 may be clustered (e.g., by data clustering module 122) for performing a vectorized delete operation (e.g., based on determining that the shards have similar storage schemes or related properties). For example, shard 1 may store multiple segments 502, each with input data records 504, and shard N may store multiple segments 506, each with data records 508. A delete signal 510 may be received for deleting records from file 1 and file 2. The vectorized driver (e.g., as included in vectorized delete module 120) may include a thread that may read shard 1 (e.g., buffer by buffer) and may have a connector 512 (e.g., connection module 126) that connects data read from shard 1 with a delete signal 510, and another thread that may read shard N (e.g., buffer by buffer) and may have a connector 514 (e.g., connection module 126) that connects data read from shard N with a delete signal 510.
[0054] As described, for example, connectors 512 and connectors 514 may output delta array bits to parallel union 516 as the bits are generated, along with source data indicating which file the bit belongs to, which row the bit indicates is to be deleted, etc. Based on the source data, a distributor 518 (e.g., array separation module 128) may dispatch the bits to corresponding delta arrays 520, 522 (e.g., delta arrays for file identifiers in the source data for the bits, and / or delta arrays for row positions within a tile as indicated in the source data for the bits).
[0055] In this example, the vectorized driver can read multiple homogeneous shards from different streams clustered together, where each shard can be a partition of a larger stream (e.g., a stream can be on the order of 10s or 100s of terabytes, while a shard can be on the order of 10s of gigabytes, can include many segments, where the segments are consumed buffer by buffer by the reader / scanner, etc.). As described, the vectorized driver can simultaneously connect a shared delete signal with multiple shards. Since the shards may be too large to be consumed by a single disk I / O, the connection programs 512, 514 can read the shards from the disk (e.g., hard drive) buffer by buffer, where the buffers can be filled by the I / O to the disk to obtain data. Between each acquisition, the CPU can wait for the I / O and the buffer to be returned by the disk controller. Since the CPU operates at a much faster frequency than the disk, the CPU wait time for the buffer can be proportionally long when compared to the I / O time. In vectorized deletion, the CPU can use the wait time to obtain the next buffer from different inputs, and perform scanning and connection for different shards in substantially parallel. In a cluster of compute nodes, segments can be stored on different nodes for load balancing with redundancy. Therefore, the parallel I / O mentioned above is less likely to put pressure on the disk of a single node. Since I / O and connection can be performed in parallel, CPU utilization can be much better and I / O throughput can be greatly improved. Each connector 512, 514 can be assigned its own thread, and the connection results can be differential bits; as described, results from different deletion targets can be cached in a parallel union together with the source data. Moreover, for example, performing vectorized deletions using first-in, first-out (FIFO) order can allow the order of input data to be preserved when generating output.
[0056] Exemplary Computing Device
[0057] Reference now Figure 6, examples of computing devices 600 such as distributed database systems 102 or parts thereof such as one or more servers storing data or managing operations on distributed database systems 102, processing queries to distributed database systems 102, etc. In one example, (multiple) computing devices 600 include processors 602 for performing processing functions associated with one or more components and functions described herein. Processor 602 may include a single or multiple processor sets or multi-core processor sets. Moreover, processor 602 may be implemented as an integrated processing system and / or a distributed processing system. In an example, processor 602 includes, but is not limited to, any processors specially programmed as described herein, including controllers, microcontrollers, central processing units (CPUs), graphics processing units (GPUs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), systems on chips (SoCs), or other programmable logic or state machines. Further, processor 602 may include other processing components, such as one or more arithmetic logic units (ALUs), registers, or control units.
[0058] In an example, computing device 600 also includes memory 604 for storing instructions executable by processor 602 for performing the functions described herein. Memory 604 may be configured to store data and / or computer executable instructions that define and / or are associated with operating system 606, files 112(1)-(n), vectorized deletion module 120, data compliance module 132, etc. Examples of memory 604 may include, but are not limited to, types of computer-usable memory such as random access memory (RAM), read-only memory (ROM), tape, disk, optical disk, volatile memory, non-volatile memory, and any combination thereof. In an example, memory 604 may store a local version of an application executed by processor 602.
[0059] The example computing device 600 also includes a communication component 610 that provides for utilizing the hardware, software, and services described herein for establishing and maintaining communications with one or more parties. The communication component 610 can carry communications between components on the computing device 600 and between the computing device 600 and external devices (such as devices located across a communication network and / or devices serially or locally connected to the computing device 600). For example, the communication component 610 may include one or more buses and may also include a transmit chain component and a receive chain component associated with a transmitter and a receiver, respectively, which may be operable to interface with the external device. In an implementation, for example, the communication component 610 may include a connection that communicatively couples the client device 104(1)-(n) to the processor 602.
[0060] The example computing device 600 also includes a data repository 612, which can be any suitable combination of hardware and / or software that provides mass storage for information, databases, and programs used in conjunction with the implementations described herein. For example, the data repository 612 can be a data repository for the operating system 606 and / or the application 608.
[0061] The example computing device 600 also includes a user interface component 614 that can be operated to receive input from a user of the computing device 600 and further can be operated to generate output for presentation to the user. The user interface component 614 can include one or more input devices, including but not limited to a keyboard, a numeric keypad, a mouse, a touch-sensitive display (e.g., display 616), a digitizer, navigation keys, function keys, a microphone, a voice recognition component, any other mechanism capable of receiving input from a user, or any combination thereof. In addition, the user interface component 614 can include one or more output devices, including but not limited to a display (e.g., display 616), a speaker, a tactile feedback mechanism, a printer, any other mechanism capable of presenting output to a user, or any combination thereof.
[0062] In implementations, user interface component 614 can send and / or receive messages corresponding to operations of operating system 606 and / or applications 608. Among other things, processor 602 executes operating system 606 and / or applications 608, and memory 604 or data storage 612 can store the system and the applications.
[0063] In addition, one or more subcomponents of files 112 (1)-(n), vectorized deletion module 120, and data compliance module 132 can be implemented in one or more of processor 602, application 608, operating system 606, memory 604, and / or user interface component 614, so that subcomponents of files 112 (1)-(n), vectorized deletion module 120, and data compliance module 132 can be deployed between components / subcomponents of computing device 600.
[0064] Finally, although various embodiments have been described using language specific to structural features and / or methodological acts, it should be understood that the subject matter defined in the accompanying representations is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as example forms of implementing the claimed subject matter.
Claims
1. A computer-implemented method for performing vectorized delete in a distributed database system, comprising: clustering a plurality of files stored in the distributed database system, wherein the clustering is based at least in part on similarities of storage schemes used to store data in the plurality of files; as well as Based on the deletion signal, generating a delta array for each file in the plurality of files, the delta array including a plurality of bits representing data items in the file and indicating a target data item to be deleted from the file based on a bit value, wherein generating the delta array for each file in the plurality of files includes: Reading a plurality of first file fragments from a first file of the plurality of files, each first file fragment comprising a portion of a first data item in the first file; For each first file segment of the plurality of first file segments, performing a first concatenation operation using the deletion signal to generate a portion of a first delta array corresponding to the given first file segment; reading a plurality of second file slices from a second file of the plurality of files, each second file slice comprising a portion of a second data item in the second file; and for each second file fragment of the plurality of second file fragments, performing a second join operation using the delete signal to generate a portion of a second difference array corresponding to the given second file fragment, Wherein, before the first connection operation on at least one first file segment among the plurality of first file segments is completed, reading at least one second file segment among the plurality of second file segments is performed.
2. The computer-implemented method of claim 1, wherein reading at least one first file split of the plurality of first file splits and reading at least one second file split of the plurality of second file splits are performed in parallel.
3. The computer-implemented method of claim 2, wherein reading at least one first file split of the plurality of first file splits and reading at least one second file split of the plurality of second file splits are performed using a single worker thread.
4. A computer-implemented method according to claim 2, wherein reading at least one first file shard of the plurality of first file shards comprises pulling a plurality of first buffer portions of the at least one first file shard, respectively, wherein performing the first connection operation comprises performing the first connection operation on each of the plurality of first buffer portions, wherein reading at least one second file shard of the plurality of second file shards comprises pulling a plurality of second buffer portions of the at least one second file shard, respectively, wherein performing the second connection operation comprises performing the second connection operation on each of the plurality of second buffer portions, and wherein pulling at least one buffer portion of the plurality of first buffer portions is performed in parallel with pulling at least one buffer portion of the plurality of second buffer portions. 5 . The computer-implemented method of claim 1 , wherein performing the first join operation is performed in parallel with performing the second join operation. 6 . The computer-implemented method of claim 5 , wherein the first join operation and the second join operation are performed using a single worker thread.
7. The computer-implemented method of claim 1 , wherein generating the delta array for each file in the plurality of files further comprises: grouping results of the first join operation and the second join operation in a parallel union along with provenance data indicating which file the results are associated with; as well as The result of the parallel join is separated into the first difference array and the second difference array based on the source data.
8. The computer-implemented method of claim 1, wherein the similarity of the storage schemes used to store data in the plurality of files corresponds to a shard similarity of the plurality of first file shards and the plurality of second file shards.
9. The computer-implemented method of claim 8, wherein the shard similarity comprises a same hash key or range key used to generate the plurality of first file shards and the plurality of second file shards.
10. The computer-implemented method of claim 1, wherein the similarity of the storage schemes used to store data in the plurality of files corresponds to an index similarity used to index the data stored in each of the plurality of files.
11. The computer-implemented method of claim 1 , wherein the similarity of the storage schemes used to store data in the plurality of files corresponds to a sorting similarity used to sort the data stored in each of the plurality of files.
12. A device for performing vectorized deletion in a distributed database system, comprising: Memory, which stores instructions; as well as at least one processor coupled to the memory and configured to execute the instructions to: clustering a plurality of files stored in the distributed database system, wherein the clustering is based at least in part on similarities of storage schemes used to store data in the plurality of files; as well as Based on the deletion signal, generating a delta array for each file in the plurality of files, the delta array including a plurality of bits representing data items in the file and indicating a target data item to be deleted from the file based on a bit value, wherein generating the delta array for each file in the plurality of files includes: Reading a plurality of first file fragments from a first file of the plurality of files, each first file fragment comprising a portion of a first data item in the first file; For each first file segment of the plurality of first file segments, performing a first concatenation operation using the deletion signal to generate a portion of a first delta array corresponding to the given first file segment; reading a plurality of second file slices from a second file of the plurality of files, each second file slice comprising a portion of a second data item in the second file; and for each second file fragment of the plurality of second file fragments, performing a second join operation using the delete signal to generate a portion of a second difference array corresponding to the given second file fragment, Wherein, before the first connection operation on at least one first file segment among the plurality of first file segments is completed, reading at least one second file segment among the plurality of second file segments is performed.
13. The device of claim 12, wherein the at least one processor is configured to execute the instructions to read at least one first file split of the plurality of first file splits in parallel with reading at least one second file split of the plurality of second file splits.
14. The device of claim 13, wherein the at least one processor is configured to execute the instructions to use a single worker thread to read at least one first file split of the plurality of first file splits and to read at least one second file split of the plurality of second file splits.
15. A computer-readable device storing instructions, which, when executed by a computing device operating in a cloud computing platform, cause the computing device to perform operations of one or more of methods 1-11.
