-
Notifications
You must be signed in to change notification settings - Fork 85
support both filesize and rows arguments #177
Conversation
|
v4/export/writer.go
Outdated
DB: ir.DatabaseName(), | ||
Table: ir.TableName(), | ||
} | ||
if bothEnabled { | ||
o.id = 0 | ||
o.idFormat = fmt.Sprintf("%09d", ir.ChunkIndex()) + "%04d" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
13 digits will overflow an int32. Do tools that read these files parse out the number, or just rely on it for filesystem ordering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so far all of myloader, Lightning and DM only rely on filesystem order, and won't parse the number. Lightning is the only one requiring that part to be [0-9]+
because the regex was written too tightly.
@@ -117,7 +117,7 @@ func (s *testDumpSuite) TestWriteTableData(c *C) { | |||
err = writer.WriteTableData(ctx, tableIR) | |||
c.Assert(err, IsNil) | |||
|
|||
p := path.Join(dir, "test.employee.0.sql") | |||
p := path.Join(dir, "test.employee.000000000.sql") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a test that uses the 13 digit number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in ffcea13. The integration test in rows
will also help check this.
5c4ed1d
to
7361034
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Though those Index1 and Index2 could probably use more descriptive names 😉
Yes. I have revised |
(trigger CI) |
* support both filesize and rows arguments * fix bash * add unit test for the situation that both filesize and rows are enabled * address comment * address comment
* support both filesize and rows arguments * fix bash * add unit test for the situation that both filesize and rows are enabled * address comment * address comment
* support both filesize and rows arguments * fix bash * add unit test for the situation that both filesize and rows are enabled * address comment * address comment
* support both filesize and rows arguments * fix bash * add unit test for the situation that both filesize and rows are enabled * address comment * address comment
* support both filesize and rows arguments * fix bash * add unit test for the situation that both filesize and rows are enabled * address comment * address comment
What problem does this PR solve?
Fix #164
What is changed and how it works?
Support configuring both
-F
and-r
arguments.When specifying
-F
or-r
argument, the dumped SQL format is${db}.${table}.%09d.sql
.When specifying both
-F
and-r
arguments, the dumped SQL format is${db}.${table}.%09d%04d.sql
.Check List
Tests
Related changes
Release note
-F
and-r
arguments at the same time.