Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
26164: importccl: Support `IMPORT MYSQLDUMP file` r=dt a=dt This adds a new `IMPORT` syntax: ``` IMPORT MYSQLDUMP (s3://path/to/some/file.sql) ``` as well as variant to select a single table: ``` IMPORT TABLE simple FROM MYSQLDUMP (s3://path/to/some/file.sql) ``` This parses the dump file to read the table schema(s), converting their the mysql-dialect `CREATE TABLE` statements to cockroach's corresponding table definitions. When a tables named, only the named table is imported -- if the dump contains other tables, they are ignored. The supported conversions of the various MySQL column types to corresponding Cockroach column types is somewhat documented by Cockroach `CREATE` statement in the `everything` test case of `TestMysqldumpSchemaReader`, which is tested to correspond to the example in the `everything.sql` testdata file, though these mappings remain subject to change as we test the behaviors of the corresponding types. This is a big step towards our mysqldump support, though we will be continuing to actively work on this for the near future, so this is a rough, initial version that we can continue to polish. Future work should allow reading create table definitions _during_ sampling, rather than prior to starting the DistSQL job, to eliminate the duplicate read cost. Co-authored-by: David Taylor <[email protected]>
- Loading branch information