-
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
lightning: let ignore columns be compatible with tidb backend #27850
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
cf67771
let ignore columns be compatible with tidb backend
glorv 7241543
Merge branch 'master' into fix-ignore-cols
glorv c8e1f7f
fix ut
glorv 7ded42f
Merge branch 'fix-ignore-cols' of ssh://github.com/glorv/tidb into fi…
glorv c677ba0
Merge branch 'master' into fix-ignore-cols
glorv ddec21a
fix
glorv 263d7ed
Merge branch 'fix-ignore-cols' of ssh://github.com/glorv/tidb into fi…
glorv 466bd14
Merge branch 'master' into fix-ignore-cols
glorv c66cdf5
fmt code
glorv 62ab23e
Merge branch 'master' into fix-ignore-cols
glorv 6fc3880
Merge branch 'master' into fix-ignore-cols
glorv 5ecb9c6
Merge branch 'master' of ssh://github.com/pingcap/tidb into fix-ignor…
glorv 59dd643
Merge branch 'master' into fix-ignore-cols
3pointer 9d22c6c
fix generated columns
glorv e594e8d
Merge branch 'master' into fix-ignore-cols
glorv 5f241ed
fix test
glorv bd4cbb5
fix generated columns
glorv 0c35b75
Merge branch 'master' into fix-ignore-cols
glorv 1cd4967
fix build
glorv 4af3a35
fix
glorv b024206
Merge branch 'master' into fix-ignore-cols
glorv 9fe66e2
do not check tableHasAutoID fro tidb backend
glorv 110ef36
Merge branch 'master' into fix-ignore-cols
glorv 50addca
Merge branch 'master' into fix-ignore-cols
glorv afb8cf7
slow down write speed for lightning_distributed_import
glorv 88ba4bc
Merge branch 'master' of ssh://github.com/pingcap/tidb into fix-ignor…
glorv 5459b6a
fix unit test
glorv 80d22a0
fix test
glorv a149d7f
Merge branch 'master' into fix-ignore-cols
glorv 8935105
Merge branch 'master' of ssh://github.com/pingcap/tidb into fix-ignor…
glorv 7c10715
Merge branch 'fix-ignore-cols' of ssh://github.com/glorv/tidb into fi…
glorv 58f035d
rollback change
glorv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you please explain why
len(row)
should be greater than or equal tocolumnCnt
(which is actualcolumenMaxIdx + 1
)?Suppose a table has 5 columns, namely
a
,b
,c
,d
,e
. We have a SQL statement in a source file likeinsert into t(a, d, c) values(xxx, xxx, xxx)
. Then thecolumnPermutation
should be(0, -1, 2, 1, -1, -1)
,columnCnt = columnMaxIdx + 1 = 4
.len(row)
is 3 which is smaller thancolumnCnt
, so in this scenario, data cannot be imported correctly.Is my understanding correct?
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.
@gozssky In this case, the columnMaxIdx should be 2, so columnCnt = 3.
This check is used to handle there are ignored columns. Giving a source file
insert into t(a, d, c, f) values(xxx, xxx, xxx, xx)
, and ignore fieldf
in lightning's config, this is still a valid source file. Then len(row) (4) will bigger than columnCnt (3).BTW, there may be case that row count is smaller than column count if user manually create table schema has extra column with default value, e.g.
updated timestamp default current_timestamp
, then current lightning will result in an error.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.
Oh, I mistook
i
foridx
😂.