# US 2021/0342316 A1 · Systems and methods for extracting data in column-based not only structured query language (nosql) databases

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0342316 A1
- Document ID: US20210342316A1
- Status: Published application
- Kind: A1
- Application number: 16/865,581
- Filed: 2020-05-04
- Published: 2021-11-04
- Earliest claimed: 2020-05-04
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Jacob McPherson; David Leo Rocker; Chintan Rajyaguru; Willie Robert Patten, JR.
- Web page: https://patentgrep.com/patent/US20210342316A1

## CPC

- G06F 16/214: {Database migration support}
- G06F 16/182: Distributed file systems
- G06F 16/211: {Schema design and management}
- G06F 16/219: {Managing data history or versioning (querying versioned data G06F16/2474; querying temporal data G06F16/2477)}
- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/2322: {using timestamps}
- G06F 16/258: {Data format conversion from or to a database}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and/or system of extracting a table having data in a plurality of rows from a Not Only Structured Query Language (NoSQL) database to a different type of database that includes: scanning all the rows in a desired table in the NoSQL database and producing a list of column families and associated column names; creating a schema for a new table having a table catalog of new column names using a Java Script Object Notation (JSON) structure to extract the columns names from the list of column families; reading and extracting at least a portion of the data from the desired table in the NoSQL database into the new table having the table catalog of new columns names; associating a creation timestamp with the new table; and saving the new table having the table catalog of new column names to the different database.

## Claims

### Claim 1

A method of extracting a table having data in a plurality of rows from a column-oriented Not Only Structured Query Language (NoSQL) database to a different type of database, the method comprising:
scanning all the rows in a desired table in the NoSQL database and producing a list of column families and associated column names;
creating a schema for a new table having a table catalog of new column names using a Java Script Object Notation (JSON) structure to extract the columns names from the list of column families;
reading and extracting at least a portion of the data from the desired table in the NoSQL database into the new table having the table catalog of new columns names;
associating a creation timestamp with the new table; and
saving the new table having the table catalog of new column names to the different database.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising providing the desired table name and a path to the different database.

### Claim 3 (depends on 1)

The method according to claim 1, wherein scanning all the rows in a desired table and producing a list of family names and associated column names comprises:
scanning a first subset of the rows in the desired table in the NoSQL database;
producing a list of column families and associated column names from the scanned subset of rows;
checking if all the rows in the desired table have been scanned; and
in response to all the rows in the desired table not being scanned, scanning a second subset of the rows in the desired table in the NoSQL database.

### Claim 4 (depends on 3)

The method according to claim 3, further comprising, in response to all the rows in a desired table not being scanned, applying a filter during scanning of the second subset of the rows in the desired table to avoid scanning any column names already scanned.

### Claim 5 (depends on 1)

The method according to claim 1, further comprising:
checking if a previous extract of the desired table is present in the different database, and
in response to a previous extract of the desired table not being present in the different database, reading and extracting all the data from the desired table in the NoSQL database into the new table having the table catalog of new columns names.

### Claim 6 (depends on 5)

The method according to claim 5, wherein checking if a previous extract of the desired table is present in the different database comprises:
determining, from the path to the different database provided by a user, the different database to write the new table; and
in response to determining the different database, search the different database for a previous extract of the desired table.

### Claim 7 (depends on 5)

The method according to claim 5, further comprising:
in response to a previous extract of the desired table being present in the different database, determining whether the timestamp associated with the precious extract of the desired table is available; and
in response to the timestamp associated with the previous extract of the desired table not being available, reading and extracting all the data from the desired table in the NoSQL database into the new table having the table catalog of new columns names.

### Claim 8 (depends on 7)

The method according to claim 7, further comprising in response to the timestamp associated with the previous extract of the desired table being available, reading and extracting all the data after the timestamp from the desired table in the NoSQL database into the new table having the table catalog of new columns names.

### Claim 9 (depends on 8)

The method according to claim 8, further comprising merging the data extracted from the NoSQL database after the timestamp with the previous extract of the desired table to add new rows and update existing rows from the previous extract.

### Claim 10 (depends on 9)

The method according to claim 9, further comprising updating the timestamp associated with the new table having the merged data and saving the new table with the merged data to the different database.

### Claim 11 (depends on 1)

The method according to claim 1, wherein the column-oriented NoSQL database is HBase, and the new table is a flat file written to alternative storage.

### Claim 12

A computer program product comprising a machine readable medium storing instructions that, when executed by at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
scanning all the rows in a desired table in the NoSQL database and producing a list of column families and associated column names;
creating a schema for a new table having a table catalog of new column names using a Java Script Object Notation (JSON) structure to extract the columns names from the list of column families;
reading and extracting at least a portion of the data from the desired table in the NoSQL database into the new table having the table catalog of new columns names;
associating a creation timestamp with the new table; and
saving the new table having the table catalog of new column names to the different database.

### Claim 13 (depends on 12)

The computer program product according to claim 12, further comprising instructions that, when executed by the at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
scanning a first subset of the rows in the desired table in the NoSQL database;
producing a list of column families and associated column names from the scanned subset of rows;
checking if all the rows in the desired table have been scanned; and
in response to all the rows in the desired table not being scanned, scanning a second subset of the rows in the desired table in the NoSQL database.

### Claim 14 (depends on 13)

The computer program product according to claim 13, further comprising instructions that, when executed by the at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
in response to all the rows in a desired table not being scanned, applying a filter during scanning of the second subset of the rows in the desired table to avoid scanning any column names already scanned.

### Claim 15 (depends on 12)

The computer program product according to claim 12, further comprising instructions that, when executed by the at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
checking if a previous extract of the desired table is present in the different database, and
in response to a previous extract of the desired table not being present in the different database, reading and extracting all the data from the desired table in the NoSQL database into the new table having the table catalog of new columns names.

### Claim 16 (depends on 15)

The computer program product according to claim 15, further comprising instructions that, when executed by the at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
in response to a previous extract of the desired table being present in the different database determining, whether the timestamp associated with the precious extract of the desired table is available; and
in response to the timestamp associated with the previous extract of the desired table not being available, reading and extracting all the data from the desired table in the NoSQL database into the new table having the table catalog of new columns names.

### Claim 17 (depends on 16)

The computer program product according to claim 16, further comprising instructions that, when executed by the at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
in response to the timestamp associated with the previous extract of the desired table being available, reading and extracting all the data after the timestamp from the desired table in the NoSQL database into the new table having the table catalog of new columns names.

### Claim 18 (depends on 17)

The computer program product according to claim 17, further comprising instructions that, when executed by the at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
merging the data extracted from the NoSQL database after the timestamp with the previous extract of the desired table to add new rows and update existing rows from the previous extract.

### Claim 19 (depends on 18)

The computer program product according to claim 18, further comprising instructions that, when executed by the at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
updating the timestamp associated with the new table having the merged data and saving the new table with the merged data to the different database.

### Claim 20

A system comprising:
at least one programmable processor;
a column-oriented Not Only Structured Query Language (NoSQL) database comprising a plurality of tables storing data, each table having one or more rows, wherein each row has a row key, and one or more column families, each column family having one or more column names wherein each column name is associated with stored data where the stored data in each column name has a timestamp associated with the stored data;
at least one alternative storage database comprising flat files;
a machine-readable medium storing instructions that, when executed by the at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
scanning all the rows in a desired table in the NoSQL database and producing a list of the one or more column families and associated column names;
creating a schema for a new table having a table catalog of new column names using a Java Script Object Notation (JSON) structure to extract the columns names from the list of column families;
reading and extracting at least a portion of the data from the desired table in the NoSQL database into the new table having the table catalog of new columns names;
associating a creation timestamp with the data in the new table; and
saving the new table having the table catalog of new column names to the alternative storage database.
