ADDING A PARTITION TO AN EXISTING TABLE STORED ON A DISTRIBUTED FILE SYSTEM
First Claim
1. A method comprising:
- receiving, by a database system, a request to add a new column to a first table stored within a distributed file system, the first table having an associated name;
creating, by the database system, in response to the request, a second table that includes all fields of the first table, the new column, and a new partition including data from the new column, the second table having an associated name;
causing, by the database system, any new data sent for the first table to be included in the second table;
causing, by the database system, in response to the request, the first table to be renamed, the renaming comprising changing a pointer of the distributed file system to refer to the renamed first table, the renaming being performed using an atomic operation;
creating, by the database system, a view pointing to data in each of the second table and the renamed first table, the view being a virtual table created on the distributed file system;
causing, by the database system, all data from the renamed first table to be transferred to the second table by adding pointers to the data to the second table; and
causing, by the database system, the second table to be renamed to the name of the first table when the transfer of the data from the renamed first table to the second table is complete, the renaming comprising changing the pointer of the distributed file system to refer to the renamed second table, being performed using an atomic operation, and causing any data received after renaming the second table to be included in the renamed second table.
3 Assignments
0 Petitions
Accused Products
Abstract
Systems and methods are described for registering a new column in an existing table on a distributed file system as a partition. In response to receiving a request to add a new column to a selected table, a new table may be created that includes all fields of the selected table, the new column, and a new partition, and the selected table may be renamed within the distributed file system. A view may then be created that points to data in the new table and the renamed selected table, the created view being a virtual table that receives and processes queries. All data from the renamed selected table may be transferred the new table. When the transfer is complete, the new table may be renamed to an original name of the selected table, and any data received after the renaming may be included in the renamed new table.
-
Citations
23 Claims
-
1. A method comprising:
-
receiving, by a database system, a request to add a new column to a first table stored within a distributed file system, the first table having an associated name; creating, by the database system, in response to the request, a second table that includes all fields of the first table, the new column, and a new partition including data from the new column, the second table having an associated name; causing, by the database system, any new data sent for the first table to be included in the second table; causing, by the database system, in response to the request, the first table to be renamed, the renaming comprising changing a pointer of the distributed file system to refer to the renamed first table, the renaming being performed using an atomic operation; creating, by the database system, a view pointing to data in each of the second table and the renamed first table, the view being a virtual table created on the distributed file system; causing, by the database system, all data from the renamed first table to be transferred to the second table by adding pointers to the data to the second table; and causing, by the database system, the second table to be renamed to the name of the first table when the transfer of the data from the renamed first table to the second table is complete, the renaming comprising changing the pointer of the distributed file system to refer to the renamed second table, being performed using an atomic operation, and causing any data received after renaming the second table to be included in the renamed second table. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A system comprising:
-
one or more processors; and a non-transitory computer readable medium storing a plurality of instructions, which when executed, cause the one or more processors to; receive a request to add a new column to a first table stored within a distributed file system, the first table having an associated name; create in response to the request, a second table that includes all fields of the first table, the new column, and a new partition including data from the new column, the second table having an associated name; cause any new data sent for the first table to be included in the second table; cause in response to the request, the first table to be renamed, the renaming comprising changing a pointer of the distributed file system to refer to the renamed first table, the renaming being performed using an atomic operation; create a view pointing to data in each of the second table and the renamed first table, the view being a virtual table created on the distributed file system; cause all data from the renamed first table to be transferred to the second table by adding pointers to the data to the second table; and cause the second table to be renamed to the name of the first table when the transfer of the data from the renamed first table to the second table is complete, the renaming comprising changing the pointer of the distributed file system to refer to the renamed second table, being performed using an atomic operation, and causing any data received after renaming the second table to be included in the renamed second table. - View Dependent Claims (10, 11, 12, 13, 14, 15)
-
-
16. A computer program product comprising computer-readable program code to be executed by one or more processors when retrieved from a non-transitory computer-readable medium, the program code including instructions to:
-
receive a request to add a new column to a first table stored within a distributed file system, the first table having an associated name; create in response to the request, a second table that includes all fields of the first table, the new column, and a new partition including data from the new column, the second table having an associated name; cause any new data sent for the first table to be included in the second table; cause in response to the request, the first table to be renamed, the renaming comprising changing a pointer of the distributed file system to refer to the renamed first table, the renaming being performed using an atomic operation; create a view pointing to data in each of the second table and the renamed first table, the view being a virtual table created on the distributed file system; cause all data from the renamed first table to be transferred to the second table by adding pointers to the data to the second table; and cause the second table to be renamed to the name of the first table when the transfer of the data from the renamed first table to the second table is complete, the renaming comprising changing the pointer of the distributed file system to refer to the renamed second table, being performed using an atomic operation, and causing any data received after renaming the second table to be included in the renamed second table. - View Dependent Claims (17, 18, 19, 20, 21, 22, 23)
-
Specification