-
Notifications
You must be signed in to change notification settings - Fork 370
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
[Importer] Adding an option to copy and not just move files #3520
Conversation
@@ -2633,6 +2640,7 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode } | |||
self.isTransactionalVisible = ko.observable((vm.sourceType == 'impala' && isTransactionalVisibleImpala) || (vm.sourceType == 'hive' && isTransactionalVisibleHive)); | |||
self.isTransactional = ko.observable(self.isTransactionalVisible()); | |||
self.isTransactional.subscribe(function(val) { | |||
self.copyFile(false); |
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.
This sets self.copyFile to false regardless of what the isTransactional value is changed to, is that correct? I would assume you only want to set the self.copyFile to false if isTransactional is true, given the visibility logic of the input.
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.
Option of transactional comes first then copy file option will come, hence I thought user must choose the option of copy file after he/she decided that table should be transactional or not. So if he/she wanted to create transactional table then we are hiding the option of copy file (as this condition is not possible) and setting it to 'False' and if user disabled the transactional option then we are providing the option of copy file, and user can choose whether he/she wants to copy the file or not.
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.
Ok, so in practice it doesn't really matter that we set self.copyFile to false even when the isTransactional is set to false.
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.
Thinking more about this, this UI flow is a bit strange and could lead to mistakes, e.g:
- User checks Copy file
- User checks Transactional table
- User unchecks Transactional table (perhaps it was a misstake to select it in the first place)
- Now the Copy file selection has been undone and the user might miss that when moving forward.
Do we really need to change the state of the "Copy file" checkbox if it is not going to be used? Can't we just set a default value of false in the data we are submitting.
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.
I agree Bjorm's thinking the logic in the UI flow of when to use copy option.
When there is a logic in UI, always put a validation in the backend code also to enforce the consistency. Also, do we expose importer in pubic API?
82b7024
to
461bd02
Compare
115f487
to
f50c676
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.
Nice, the actual values of isTransactional and useCopy are now separated and we only use hide and disable on the UI elements to handle their relationship. This seems consistent with the iceberg additions.
f50c676
to
a21bf47
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!
(cherry picked from commit 82fd88d)
What changes were proposed in this pull request?
How was this patch tested?