Github user ted-yu commented on the pull request:

    https://github.com/apache/spark/pull/11082#issuecomment-180498087
  
    I am trying to add an Array to ConcurrentLinkedQueue (collectedData) in 
Scala 2.11:
    ```
    stream.foreachRDD { rdd => Collections.addAll(collectedData, rdd.collect()) 
}
    ```
    I got the following compilation error:
    ```
    [error]  found   : java.util.concurrent.ConcurrentLinkedQueue[(String, 
String)]
    [error]  required: java.util.Collection[_ >: java.io.Serializable]
    [error] Note: (String, String) <: Any, but Java-defined trait Collection is 
invariant in type E.
    [error] You may wish to investigate a wildcard type such as `_ <: Any`. 
(SLS 3.2.10)
    [error]     stream.foreachRDD { rdd => Collections.addAll(allReceived, 
rdd.collect()) }
    ```



---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to