Management of object metadata across data sources and storage systems
A system receives, from a client device of a user, a request to create a target data table in a remote data source. The system determines whether the user has a permission to create, in a local database, a local data table corresponding to the target data table. Responsive to determining that the user has the permission, the system creates the local data table associated with a state identifier data structure and sets the state identifier data structure to a provisioning state to indicate that the target data table is being provisioned. The system transmits an instruction to create the target data table in the remote data source. Responsive to determining that the target data table is created in the remoted data source successfully, the system changes the local data table from the provisioning state to an active state.
1 . A method comprising:
receiving, from a client device of a user, a request to create a target data table in a remote data source;
determining whether the user of the client device has a permission to create, in a local database, a local data table corresponding to the target data table;
responsive to determining that the user has the permission, creating, in the local database, the local data table, wherein the local data table is associated with a state identifier data structure;
setting the state identifier data structure for the local data table to a provisioning state to indicate that the target data table is being provisioned in the remote data source;
transmitting, to the remoted data source, an instruction to create the target data table in the remote data source;
responsive to determining that the target data table is created in the remoted data source successfully, changing the local data table from the provisioning state to an active state; and
allowing the user to access the target data table by accessing the local data table in the local database.
2 . The method of claim 1 , wherein determining whether the user of the client device has a permission to create a local data table comprises:
determining whether the user has a permission to access a catalog and a schema under which the local data table is to be created in the local database.
3 . The method of claim 1 , further comprising:
determining a state of a schema associated with target data table in the local database from a second state identifier data structure associated with the schema; and
responsive to a determination that the state of the schema is in an active state, creating the local data table in the local database.
4 . The method of claim 1 , further comprising:
determining whether the local data table exists in the local database; and
responsive to a determination that the local data table does not exist in the local database, creating the local data table in the local database.
5 . The method of claim 1 , wherein determining that the target data table is created in the remoted data source successfully comprises:
determining that the target data table was not previously created in the remote data source before the target data table is created in the remote data source.
6 . The method of claim 1 , further comprising:
receiving, from the client device of the user, a second request to create a second target data table in the remote data source;
determining whether the second target data table exists in the remote data source; and
responsive to determining that the second target data table exists in the remote data source and that the second target data table was created by a different user from the user, deleting, from the local database, a first local data table that corresponds to the second target data table.
7 . The method of claim 1 , further comprising:
receiving, from the client device of the user, a second request to create a second target data table in the remote data source;
determining whether the second target data table exists in the remote data source; and
responsive to determining that the second target data table exists in the remote data source and that the second target data table was created by the user, changing a state associated with the first local data table from a provisioning state to an active state, the first local data table being a data table in the local database that corresponds to the second target data table.
8 . A non-transitory computer readable storage medium comprising stored program code, the program code comprising instructions, the instructions when executed causes a processor system to:
receive, from a client device of a user, a request to create a target data table in a remote data source;
determine whether the user of the client device has a permission to create, in a local database, a local data table corresponding to the target data table;
responsive to determining that the user has the permission, create, in the local database, the local data table, wherein the local data table is associated with a state identifier data structure;
set the state identifier data structure for the local data table to a provisioning state to indicate that the target data table is being provisioned in the remote data source;
transmit, to the remoted data source, an instruction to create the target data table in the remote data source;
responsive to determining that the target data table is created in the remoted data source successfully, change the local data table from the provisioning state to an active state; and
allow the user to access the target data table by accessing the local data table in the local database.
9 . The non-transitory computer readable storage medium of claim 8 , wherein the instructions to determine whether the user of the client device has a permission to create a local data table further comprise stored instructions when executed causes the processor system to:
determine whether the user has a permission to access a catalog and a schema under which the local data table is to be created in the local database.
10 . The non-transitory computer readable storage medium of claim 8 , wherein the instructions when executed causes the processor system to:
determine a state of a schema associated with target data table in the local database from a second state identifier data structure associated with the schema; and
responsive to a determination that the state of the schema is in an active state, creating the local data table in the local database.
11 . The non-transitory computer readable storage medium of claim 8 , wherein the instructions when executed causes the processor system to:
determine whether the local data table exists in the local database; and
responsive to a determination that the local data table does not exist in the local database, creating the local data table in the local database.
12 . The non-transitory computer readable storage medium of claim 8 , wherein the instructions to determine that the target data table is created in the remoted data source successfully further comprise stored instructions when executed causes the processor system to:
determine that the target data table was not previously created in the remote data source before the target data table is created in the remote data source.
13 . The non-transitory computer readable storage medium of claim 8 , wherein the instructions when executed causes the processor system to:
receive, from the client device of the user, a second request to create a second target data table in the remote data source;
determine whether the second target data table exists in the remote data source; and
responsive to determining that the second target data table exists in the remote data source and that the second target data table was created by a different user from the user, delete, from the local database, a first local data table that corresponds to the second target data table.
14 . The non-transitory computer readable storage medium of claim 8 , wherein the instructions when executed causes the processor system to:
receive, from the client device of the user, a second request to create a second target data table in the remote data source;
determine whether the second target data table exists in the remote data source; and
responsive to determining that the second target data table exists in the remote data source and that the second target data table was created by the user, change a state associated with a first local data table from a provisioning state to an active state, the first local data table being a data table in the local database that corresponds to the second target data table.
15 . A system comprising:
one or more computer processors; and
one or more computer-readable mediums storing instructions that, when executed by the one or more computer processors, cause the system to:
receive, from a client device of a user, a request to create a target data table in a remote data source;
determine whether the user of the client device has a permission to create, in a local database, a local data table corresponding to the target data table;
responsive to determining that the user has the permission, create, in the local database, the local data table, wherein the local data table is associated with a state identifier data structure;
set the state identifier data structure for the local data table to a provisioning state to indicate that the target data table is being provisioned in the remote data source;
transmit, to the remoted data source, an instruction to create the target data table in the remote data source;
responsive to determining that the target data table is created in the remoted data source successfully, change the local data table from the provisioning state to an active state; and
allow the user to access the target data table by accessing the local data table in the local database.
16 . The system of claim 15 , wherein the instructions to determine whether the user of the client device has a permission to create a local data table further comprise stored instructions when executed by the one or more computer processors, cause the system to:
determine whether the user has a permission to access a catalog and a schema under which the local data table is to be created in the local database.
17 . The system of claim 15 , wherein the instructions when executed by the one or more computer processors, cause the system to:
determine a state of a schema associated with target data table in the local database from a second state identifier data structure associated with the schema; and
responsive to a determination that the state of the schema is in an active state, create the local data table in the local database.
18 . The system of claim 15 , wherein the instructions when executed by the one or more computer processors, cause the system to:
determine whether the local data table exists in the local database; and
responsive to a determination that the local data table does not exist in the local database, creating the local data table in the local database.
19 . The system of claim 15 , wherein the instructions when executed by the one or more computer processors, cause the system to:
receive, from the client device of the user, a second request to create a second target data table in the remote data source;
determine whether the second target data table exists in the remote data source; and
responsive to determining that the second target data table exists in the remote data source and that the second target data table was created by a different user from the user, delete, from the local database, a first local data table that corresponds to the second target data table.
20 . The system of claim 15 , wherein the instructions when executed by the one or more computer processors, cause the system to:
receive, from the client device of the user, a second request to create a second target data table in the remote data source;
determine whether the second target data table exists in the remote data source; and
responsive to determining that the second target data table exists in the remote data source and that the second target data table was created by the user, change a state associated with a first local data table from a provisioning state to an active state, the first local data table being a data table in the local database that corresponds to the second target data table.