Cloning catalog objects
Example systems and methods for cloning catalog objects are described. In one implementation, a method includes copying first metadata of a first catalog object to create second metadata of a second catalog object such that a second portion of the second metadata and a first portion of the first metadata are associated with same data of a same data file, and generating a response to a data storage or data retrieval request directed to the first catalog object by accessing the data file using the second metadata of the second catalog object.
1. A system comprising:
a memory; and
one or more processors, operatively coupled to the memory, the one or more processors to:
copy first metadata of a first catalog object to create second metadata of a second catalog object such that a second portion of the second metadata and a first portion of the first metadata are both mapped to same data of a same data file; and
generate a response to a data storage or data retrieval request directed to the first catalog object by accessing the data file using the second metadata of the second catalog object.
2. The system of claim 1 , wherein the one or more processors are further to delete the second catalog object after responding to the data storage or data retrieval request directed to the first catalog object.
3. The system of claim 1 , wherein the one or more processors are further to unmap the second portion of the second metadata from the data file while leaving first portion of the first metadata mapped to the data file to delete data associated with the second portion of the second metadata from the second catalog object independently of the first catalog object.
4. The system of claim 1 , wherein the one or more processors are further to modify data associated with the second portion of the second metadata independently of the first catalog object by:
writing modified data to a second data file; and
associating the second portion of the second metadata with the modified data within the second data file.
5. The system of claim 4 , wherein the modified data of the second data file is not visible to the first catalog object.
6. The system of claim 1 , wherein the first catalog object comprises one or more of a schema, a table, a view, a column, a constraint, a sequence, a function, a file format, or a stage.
7. The system of claim 1 , wherein the second catalog object comprises a duplicate hierarchy of one or more generations of children of the first catalog object.
8. A method comprising:
copying first metadata of a first catalog object to create second metadata of a second catalog object such that a second portion of the second metadata and a first portion of the first metadata are both mapped to same data of a same data file; and
generating a response to a data storage or data retrieval request directed to the first catalog object by accessing the data file using the second metadata of the second catalog object.
9. The method of claim 8 , further comprising deleting the second catalog object after responding to the data storage or data retrieval request directed to the first catalog object.
10. The method of claim 8 , further comprising unmapping the second portion of the second metadata from the data file while leaving first portion of the first metadata mapped to the data file to delete data associated with the second portion of the second metadata from the second catalog object independently of the first catalog object.
11. The method of claim 8 , further comprising modifying data associated with the second portion of the second metadata independently of the first catalog object by:
writing modified data to a second data file; and
associating the second portion of the second metadata with the modified data within the second data file.
12. The method of claim 11 , wherein the modified data of the second data file is not visible to the first catalog object.
13. The method of claim 8 , wherein the first catalog object comprises one or more of a schema, a table, a view, a column, a constraint, a sequence, a function, a file format, or a stage.
14. The method of claim 8 , wherein the second catalog object comprises a duplicate hierarchy of one or more generations of children of the first catalog object.
15. A non-transitory computer-readable storage medium comprising instructions which, when executed by one or more processors, cause the one or more processors to:
copy first metadata of a first catalog object to create second metadata of a second catalog object such that a second portion of the second metadata and a first portion of the first metadata are both mapped to same data of a same data file; and
generate a response to a data storage or data retrieval request directed to the first catalog object by accessing the data file using the second metadata of the second catalog object.
16. The non-transitory computer-readable storage medium of claim 15 , wherein the one or more processors are further to delete the second catalog object after responding to the data storage or data retrieval request directed to the first catalog object.
17. The non-transitory computer-readable storage medium of claim 15 , wherein the one or more processors are further to unmap the second portion of the second metadata from the data file while leaving first portion of the first metadata mapped to the data file to delete data associated with the second portion of the second metadata from the second catalog object independently of the first catalog object.
18. The non-transitory computer-readable storage medium of claim 15 , wherein the one or more processors are further to modify data associated with the second portion of the second metadata independently of the first catalog object by:
writing modified data to a second data file; and
associating the second portion of the second metadata with the modified data within the second data file.
19. The non-transitory computer-readable storage medium of claim 18 , wherein the modified data of the second data file is not visible to the first catalog object.
20. The non-transitory computer-readable storage medium of claim 15 , wherein the second catalog object comprises a duplicate hierarchy of one or more generations of children of the first catalog object.