-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executor: LOAD DATA INFILE support asterisk matching #42050
Conversation
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
/cc @gozssky |
executor/load_data.go
Outdated
loggedError = true | ||
logutil.Logger(ctx).Warn("failed to build pattern for file matching", |
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.
we can move this in param checking part
|
||
filesize := int64(-1) | ||
reader, err2 := opener(ctx) | ||
if err2 == nil { |
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.
odd to continue load when open failed, we don't have retry for this now, maybe just return err
executor/load_data.go
Outdated
return | ||
} | ||
|
||
TrySendTask: | ||
pos, err2 := seeker.Seek(0, io.SeekCurrent) | ||
if err2 != nil && !loggedError { | ||
pos, err = seeker.Seek(0, io.SeekCurrent) |
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.
pos, err = seeker.Seek(0, io.SeekCurrent) | |
currScannedSize, err = seeker.Seek(0, io.SeekCurrent) |
executor/load_data.go
Outdated
@@ -997,7 +1093,8 @@ func (e *LoadDataWorker) ReadRows(ctx context.Context, parser mydump.Parser) err | |||
} | |||
} | |||
|
|||
for e.IgnoreLines > 0 { | |||
ignoreLineCnt := e.IgnoreLines |
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 save this ignored line count
, else we skip N lines for every read-row
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 be saved for each file
|
||
s.tk.MustExec("TRUNCATE TABLE multi_load.t;") | ||
sql = fmt.Sprintf(`LOAD DATA INFILE 'gs://test-multi-load/db.tbl.*.tsv?endpoint=%s' | ||
INTO TABLE multi_load.t IGNORE 1 LINES;`, gcsEndpoint) |
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.
please add a case which calls readRows twice to make sure ignoreNLines works
Signed-off-by: lance6716 <[email protected]>
/hold |
Signed-off-by: lance6716 <[email protected]>
/unhold |
Signed-off-by: lance6716 <[email protected]>
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.
Do we have any document to describe the asterisk matching?
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 9c0a541
|
What problem does this PR solve?
Issue Number: ref #40499
Problem Summary:
as title
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.