Github user srowen commented on the pull request:

    https://github.com/apache/spark/pull/10554#issuecomment-168821601
  
    @rxin so I tried unpacking this code in IntelliJ:
    ```
    val m = new java.util.HashMap[String, java.lang.Long]()
    val l = 1L
    m.put("foo", l)
    ```
    ... and it tells me that the implicit conversion that is applied here is 
`Predef.long2Long`:
    
    ```
    implicit def long2Long(x: Long)           = java.lang.Long.valueOf(x)
    ```
    
    It looks like this is the same underlying transformation that happens in 
`SerializableMapWrapper` and `mapAsSerializableJavaMap` already. So it looks to 
me like this is already the implicit transformation being applied anyway.
    
    Right now the returned type of these methods in Java is `Map<K, Object>` 
and the wrapper does the conversion on the fly in `get()`. I believe. I think 
to make it a real `Map<K, Long>` requires making the transformation upfront -- 
well, short of making some other new special purpose wrapper.
    
    WDYT?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to