dongjoon-hyun commented on a change in pull request #24046: [MINOR][SQL] Throw 
better exception for Encoder with tuple more than 22 elements
URL: https://github.com/apache/spark/pull/24046#discussion_r264068462
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala
 ##########
 @@ -370,6 +370,15 @@ class ExpressionEncoderSuite extends 
CodegenInterpretedPlanTest with AnalysisTes
     assert(e.getMessage.contains("Cannot use null as map key"))
   }
 
+  test("tuple with more than 22 elements") {
+    val encoders = (0 to 22).map(_ => 
Encoders.scalaInt.asInstanceOf[ExpressionEncoder[_]]).toSeq
+
+    val exc = intercept[UnsupportedOperationException] {
+      ExpressionEncoder.tuple(encoders)
+    }
+    exc.getMessage.contains("tuple with more than 22 elements are not 
supported")
 
 Review comment:
   `assert` is missing.
   ```scala
   assert(exc.getMessage.contains("tuple with more than 22 elements are not 
supported"))
   ```
   
   And, if possible, use `e` instead of `exc`.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to