[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #3509: [CARBONDATA-3618] Update query should throw exception if key has more than one value

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #3509: [CARBONDATA-3618] Update query should throw exception if key has more than one value

GitBox
ajantha-bhat commented on a change in pull request #3509: [CARBONDATA-3618] Update query should throw exception if key has more than one value
URL: https://github.com/apache/carbondata/pull/3509#discussion_r358088742
 
 

 ##########
 File path: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForUpdateCommand.scala
 ##########
 @@ -135,7 +136,22 @@ private[sql] case class CarbonProjectForUpdateCommand(
           else {
             Dataset.ofRows(sparkSession, plan)
           }
-
+          // If more than one value present for the update key, should fail the update
+          val ds = dataSet.select(CarbonCommonConstants.CARBON_IMPLICIT_COLUMN_TUPLEID)
 
 Review comment:
   @zzcclp : I just modified like your solution and checked In "UpdateCarbonTableTestCase" itself 40 testcase failed.
   
   I will explain why it fails now,
   
   Here we don't want to throw exception if the `selectStmt` has more than one result, we need to throw exception when the it has more than one duplicate result.
   
   Example:
   src has id = 1, 2. It need to update all the id, But the subquery results that 1,1,2. Now we don't know the 1 matches with the first or second. so only in this case we need to throw exception.
   
   Tell me if you have any other solution for this problem.
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services