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
[CARBONDATA-3630] update should support limit 1 sub query and empty result subquery #3528
Conversation
Build Failed with Spark 2.1.0, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.1/1255/ |
Build Failed with Spark 2.2.1, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.2/1265/ |
Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1276/ |
Build Success with Spark 2.1.0, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.1/1256/ |
Build Failed with Spark 2.2.1, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.2/1266/ |
Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1277/ |
Build Success with Spark 2.1.0, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.1/1265/ |
Build Success with Spark 2.2.1, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.2/1275/ |
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1286/ |
Build Success with Spark 2.1.0, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.1/1269/ |
Build Success with Spark 2.2.1, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.2/1279/ |
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1290/ |
@@ -247,8 +248,61 @@ class CarbonSpark2SqlParser extends CarbonDDLSqlParser { | |||
case tab ~ columns ~ rest => | |||
val (sel, where) = splitQuery(rest) | |||
val selectPattern = """^\s*select\s+""".r | |||
// comma separated string |
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.
explain in more detail what the logic it is
@@ -262,12 +316,16 @@ class CarbonSpark2SqlParser extends CarbonDDLSqlParser { | |||
} | |||
case _ => tab._1 | |||
} | |||
|
|||
val newSel = if (!StringUtils.isEmpty(constants)) { |
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.
explain the logic
Build Success with Spark 2.2.1, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.2/1329/ |
Build Success with Spark 2.1.0, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.1/1321/ |
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1344/ |
LGTM |
Why is this PR needed? PR#3528 was an old build, test was not ran on the latest master. Hence one test case failed. What changes were proposed in this PR? updated the test case, as now update by value flow is introduced in 3528 for subquires. Exception callstack will be different. Does this PR introduce any user interface change? No Is any new testcase added? No This closes #3563
[CARBONDATA-3630] update should support limit 1 sub query and empty result subquery
currently update has two flows, update by value and update by join.
a. update by join should be used only if subquery join present with maintable, now in non-join maintable sceneario also join is used. Fixed this.
b. currently subquery with limit 1 cannot support as it goes to join with main table, supported this
c. If subquery with limit 1 with join with main table is present, current design cannot handle it. so throwing exception
d. Supporting sub query with 0 results to update as null (behavior is same as mysql)
Be sure to do all of the following checklist to help us incorporate
your contribution quickly and easily:
Any interfaces changed?
Any backward compatibility impacted?
Document update required?
Testing done
Please provide details on
- Whether new unit test cases have been added or why no new tests are required?
- How it is tested? Please attach test report.
- Is it a performance related change? Please attach the performance test report.
- Any additional information to help reviewers in testing this change.
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.