The "lat" field is sometimes an "Int" (and mostly a float), this fails in Apache Drill

65 views
Skip to first unread message

Peter Vandenabeele

unread,
May 7, 2015, 5:31:17 PM5/7/15
to meetu...@googlegroups.com
Hey,

A (simplified) sample of "lat" values (latitude that is) from the members JSON is:


{"lat": 51.18},                                                                     
{"lat": 50.97},                                                                     
{"lat": 51.13999938964844},                                                         
{"lat": 50.83},                                                                     
{"lat": 51.22},                                                                     
{"lat": 50.88},                                                                     
{"lat": 50.8},                                                                      
{"lat": 51.22},                                                                     
{"lat": 51},               # <==== this is the problem value
{"lat": 50.83},                                                                     
{"lat": 50.88},  

When reading this data e.g. with "Apache Drill", I get an exception:

"Query failed: DATA_READ ERROR: Error parsing JSON - You tried to write a BigInt type when you are using a ValueWriter of type NullableFloat8WriterImpl."

Would it be possible to make the lat (and long probably as well) to always
have a "float" representation (that is "lat" 51 => 51.0). In that case, the
"type" of the lat value is always a float/double or a decimal, depending
on the implementation.

Or is there another solution or is the problem on my side?

Thanks,

Peter

Doug Tangren

unread,
May 7, 2015, 5:32:39 PM5/7/15
to meetup-api
Hi Peter ,

We should be able to handle the problem on our side. I'll open a ticket.
 

Thanks,

Peter

--
--
You received this message because you are subscribed to the Google
Groups "Meetup API" group.
To unsubscribe from this group, send email to
meetup-api+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/meetup-api?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "Meetup API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetup-api+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Vandenabeele

unread,
May 7, 2015, 5:58:02 PM5/7/15
to meetu...@googlegroups.com
On Thu, May 7, 2015 at 11:32 PM, Doug Tangren <do...@meetup.com> wrote:


On Thu, May 7, 2015 at 4:21 PM, Peter Vandenabeele <pe...@vandenabeele.com> wrote:
Hey,

A (simplified) sample of "lat" values (latitude that is) from the members JSON is:


{"lat": 51.18},                                                                     
{"lat": 50.97},                                                                     
{"lat": 51.13999938964844},                                                         
{"lat": 50.83},                                                                     
{"lat": 51.22},                                                                     
{"lat": 50.88},                                                                     
{"lat": 50.8},                                                                      
{"lat": 51.22},                                                                     
{"lat": 51},               # <==== this is the problem value
{"lat": 50.83},                                                                     
{"lat": 50.88},  

When reading this data e.g. with "Apache Drill", I get an exception:

"Query failed: DATA_READ ERROR: Error parsing JSON - You tried to write a BigInt type when you are using a ValueWriter of type NullableFloat8WriterImpl."

Would it be possible to make the lat (and long probably as well) to always
have a "float" representation (that is "lat" 51 => 51.0). In that case, the
"type" of the lat value is always a float/double or a decimal, depending
on the implementation.

Or is there another solution or is the problem on my side?

Hi Peter ,

We should be able to handle the problem on our side. I'll open a ticket.


Thanks, that would be a clean solution!

I presume the same problem is present for the "lon" field (but I did
not immediately find an example for it).

For reference, the (ugly) workaround below "fixes" the problem (it was
quickly written in Ruby, but should be easily portable to other languages
that support regular expressions):

gsub(/"((lat)|(lon))": (-?\d+)([,}])/) {                                    
  '"' + $1 + '": ' + $4 + ".0" + $5                                         
}

Peter

neelimas...@gmail.com

unread,
Jul 5, 2016, 6:37:36 PM7/5/16
to Meetup API

I am working on integrating meetup api to show events in my project in cakephp, but i first need them to be stored in my database from cron job for all regions and radius, but the call request is not working without latitude and longitude and radius greater the 100 miles. Can i have any any option to not use these and get all upcoming event list.

Url which i am using is as : https://api.meetup.com/2/open_events?key=my_api_key&text=&radius=50&page=20&status=upcoming&and_text=False&offset=0&limited_events=False&photo-host=public

i got response for this request as : {"details":"Perhaps you're missing a required parameter. You can find full documentation of the api here: http://www.meetup.com/meetup_api/docs/","code":"bad_request","problem":"The API request is malformed"}

The actual url with lat long is : https://api.meetup.com/2/open_events?key=my_api_key&text=&lat=41.445927&lon=-74.422934&country=us&radius=50&page=20&status=upcoming&and_text=False&offset=0&limited_events=False&photo-host=public

Please help. Thanks in advance

 
Reply all
Reply to author
Forward
0 new messages