maropu 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_r264070447
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala
 ##########
 @@ -80,7 +80,11 @@ object ExpressionEncoder {
    * name/positional binding is preserved.
    */
   def tuple(encoders: Seq[ExpressionEncoder[_]]): ExpressionEncoder[_] = {
-    // TODO: check if encoders length is more than 22 and throw exception for 
it.
+    if (encoders.length > 22) {
 
 Review comment:
   `ExpressionEncode.tuple` has a chance to receive more than 22 elements in 
`encoders`? It seems the catalyst package is internal only and all the caller 
of this `tuple` passes [at most 5 
elements](https://github.com/apache/spark/blob/29d902124581b2163e49baa6d379025a6cf1fa1a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala#L160).
 If so, `assert` here?

----------------------------------------------------------------
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