dillitz commented on code in PR #54016:
URL: https://github.com/apache/spark/pull/54016#discussion_r2735880351
##########
sql/connect/common/src/main/scala/org/apache/spark/sql/connect/client/SparkConnectClient.scala:
##########
@@ -1103,7 +1104,13 @@ object SparkConnectClient {
responseListener: ClientCall.Listener[RespT],
headers: Metadata): Unit = {
metadata.foreach { case (key, value) =>
- headers.put(Metadata.Key.of(key,
Metadata.ASCII_STRING_MARSHALLER), value)
+ if (key != null && key.endsWith("-bin")) {
Review Comment:
Now using the constant, thanks!
This was meant to be defensive programming since this is user input, so
nothing prevents the user from setting the key or value to `null`. Currently,
in the ASCII case, we fail in the gRPC Metadata check, which, at least for the
version we are using, does not allow null values. In the new case, this would
fail when calling `null.endsWith`. Added a null check for `value` as well now,
but happy to remove both checks if you think we should just fail during
`null.getBytes(UTF_8)` or `null.endsWith` instead.
Thank you!
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]