-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
HIVE-27995: Fix inconsistent behavior of LOAD DATA command for partitoned and non-partitioned tables #5000
base: master
Are you sure you want to change the base?
Conversation
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.
you need to add a test, there are NegativeCLIDrivers which can be used.
There are bunch of return statements below the current line & the place where it is there right now, So, if that returned was called earlier, this applyConstraintsAndGetFiles(fromURI, ts.tableHandle);
must not have been called, but now you would be calling that, right?. So, that is some additional cost just for error message?
@ayushtkn Thanks for the review, i have added the test case as mentioned above.please review once |
Quality Gate passedIssues Measures |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java
Outdated
Show resolved
Hide resolved
Overall changes looks good to me, But locally when i run newly added test case it falling
|
…oned and non-partitioned tables
Quality Gate passedIssues Measures |
POSTHOOK: type: CREATETABLE | ||
POSTHOOK: Output: database:default | ||
POSTHOOK: Output: default@validate_load_data | ||
#### A masked pattern was here #### |
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.
Here there is no error, I think it is failing before the expected scenario.
What changes were proposed in this pull request?
Earlier, the code flows for partitioned and non-partitioned tables were different. The partitioned tables skipped constraints checks before submitting the job for execution. This Pull request ensures that both, the partitioned and non-partitioned tables go through the constraints validations in
applyConstraintsAndGetFiles
function.Why are the changes needed?
For partitioned tables, while executing LOAD DATA/ LOAD DATA LOCAL commands, the check for file existence is not executed on HiveServer2, and this in turn throws
java.io.FileNotFoundException
during Runtime once the job is launched.This PR prevents such cases at compile time.
Does this PR introduce any user-facing change?
No
Is the change a dependency upgrade?
No
How was this patch tested?
The test cases already exist. The error messages prompted back to the user are now consistent if the file is not found at HiveServer2
Load Data Error (Non Partitioned Tables)
File Not Found Exception (Partitioned Tables)
Fixed: For partitioned tables