Github user sjbrunst commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1717#discussion_r17217079
  
    --- Diff: 
external/twitter/src/main/scala/org/apache/spark/streaming/twitter/TwitterInputDStream.scala
 ---
    @@ -42,6 +44,7 @@ class TwitterInputDStream(
         @transient ssc_ : StreamingContext,
         twitterAuth: Option[Authorization],
         filters: Seq[String],
    +    locations: Seq[Seq[Double]],
    --- End diff --
    
    Good question. It definitely is confusing. I went with ``Seq[Seq[Double]]`` 
because the ``FilterQuery`` created in TwitterInputDStream.scala requires a 
``double[][]`` 
(http://twitter4j.org/javadoc/twitter4j/FilterQuery.html#locations-double:A:A-).
 This way the only change I have to make to the input is to change between 
Scala sequences and Java arrays.
    
    The ``Location`` case class you described still does not remove all 
ambiguity, because the ``FilterQuery`` requires the south-west corner then the 
north-east corner for the boundary, and that would not prevent someone from 
giving them in the wrong order and getting unexpected results. If we're going 
to define a ``case class`` anyways, I think it would be better to make 
something like ``case class Boundary(west: Double, south: Double, east: Double, 
north: Double)``. Then the locations parameter would be of type 
``Seq[Boundary]``, and I can convert it to a ``double[][]`` just before passing 
it to the ``FilterQuery`` in TwitterInputDStream.scala. Should I go ahead and 
implement that?


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