keenlabs / KeenClient-Java

Official Java client for the Keen IO API. Build analytics features directly into your Java apps.
https://keen.io/docs
MIT License
74 stars 43 forks source link

Query client #53

Closed claireyoung closed 9 years ago

claireyoung commented 9 years ago

I made a bunch of code changes, but due to meeting with @Geeber and @manumahajan please only read the query/README.md file! Don't look at the Funnel and Multi-Analysis sections. I may have to do more research and a lot of testing, but I think the unique cases are:

  1. Select Unique, where you get a list of QueryResult's.
  2. Group-By, where you get a list of objects with QueryResult's & Properties to group by
  3. Interval, where you get a list of QueryResult's & Timeframes
  4. Group-By plus Interval, where you get a list of Timeframes, and then QueryResult is actually a Group-By
claireyoung commented 9 years ago

Updated README. Here are the cases, excluding Extraction/Funnel/Multi-Analysis:

  1. For most simple queries, QueryResult will be Integer or Double.
  2. For the Select Unique query as well as queries with group-by and/or interval filters, QueryResult will be an ArrayList at the top level.
  3. GroupBy object contains a HashMap<String, Object> of the properties/value as well as a QueryResult result (which should be an Integer or Double).
  4. Interval object contains a Timeframe timeframe, and a QueryResult value (which should be an Integer, Double, or GroupBy).
  5. For Select Unique query, the values in the ArrayList could be QueryResult objects or just generic Object if it can't be cast to a supported type. (basically if it's a boolean, map, or anything else)
manumahajan commented 9 years ago

Thanks! this is looking pretty good to me overall. I added a few questions / suggestions. None of these are critical but in my opinion they would make it slightly easier to understand. Would love to hear what you think.

claireyoung commented 9 years ago

Last commit. I mean QueryResult.constructQueryResult, not QueryResult.getObject().