You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spot.apache.org by ev...@apache.org on 2017/03/29 16:51:41 UTC

[17/50] [abbrv] incubator-spot git commit: Updated api queries for ingest summary

Updated api queries for ingest summary


Project: http://git-wip-us.apache.org/repos/asf/incubator-spot/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spot/commit/c35a4e9f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spot/tree/c35a4e9f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spot/diff/c35a4e9f

Branch: refs/heads/SPOT-35_graphql_api
Commit: c35a4e9ffb7748ac5efa1c8c160f601d7633751a
Parents: 92cdcca
Author: LedaLima <le...@apache.org>
Authored: Tue Mar 7 17:37:25 2017 -0600
Committer: Diego Ortiz Huerta <di...@intel.com>
Committed: Wed Mar 15 11:49:48 2017 -0700

----------------------------------------------------------------------
 spot-oa/api/resources/dns.py   | 5 +++--
 spot-oa/api/resources/flow.py  | 9 +++++----
 spot-oa/api/resources/proxy.py | 5 +++--
 3 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/c35a4e9f/spot-oa/api/resources/dns.py
----------------------------------------------------------------------
diff --git a/spot-oa/api/resources/dns.py b/spot-oa/api/resources/dns.py
index ae2076b..6000fa6 100644
--- a/spot-oa/api/resources/dns.py
+++ b/spot-oa/api/resources/dns.py
@@ -337,8 +337,9 @@ def ingest_summary(start_date,end_date):
                 FROM {0}.dns_ingest_summary
                 WHERE
                     ( y >= {1} and y <= {2}) AND
-                    ( m >= {3} and m <= {4})
+                    ( m >= {3} and m <= {4}) AND
+                    ( d >= {5} and d <= {6})
                 """)\
-                .format(db,start_date.year,end_date.year,start_date.month,end_date.month)
+                .format(db,start_date.year,end_date.year,start_date.month,end_date.month, start_date.day, end_date.day)
 
     return ImpalaEngine.execute_query_as_list(is_query)

http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/c35a4e9f/spot-oa/api/resources/flow.py
----------------------------------------------------------------------
diff --git a/spot-oa/api/resources/flow.py b/spot-oa/api/resources/flow.py
index d904b61..211932c 100755
--- a/spot-oa/api/resources/flow.py
+++ b/spot-oa/api/resources/flow.py
@@ -90,12 +90,13 @@ def ingest_summary(start_date,end_date):
                 tdate,total
             FROM {0}.flow_ingest_summary
             WHERE
-                ( y >= {1} AND y <= {2})
-                AND
-                ( m >= {3} AND m <= {4})
+                ( y >= {1} AND y <= {2}) AND
+                ( m >= {3} AND m <= {4}) AND
+                ( d >= {5} AND d <= {6})
             ORDER BY tdate
             """).format(db,start_date.year,end_date.year, \
-                        start_date.month,end_date.month)
+                        start_date.month,end_date.month, \
+                        start_date.day, end_date.day)
 
     return ImpalaEngine.execute_query_as_list(is_query)
 

http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/c35a4e9f/spot-oa/api/resources/proxy.py
----------------------------------------------------------------------
diff --git a/spot-oa/api/resources/proxy.py b/spot-oa/api/resources/proxy.py
index 6f86aae..cbfb368 100644
--- a/spot-oa/api/resources/proxy.py
+++ b/spot-oa/api/resources/proxy.py
@@ -394,8 +394,9 @@ def ingest_summary(start_date,end_date):
                 FROM {0}.proxy_ingest_summary
                 WHERE
                     ( y >= {1} and y <= {2}) AND
-                    ( m >= {3} and m <= {4})
+                    ( m >= {3} and m <= {4}) AND
+                    ( d >= {5} and d <= {6})
                 """)\
-                .format(db,start_date.year,end_date.year,start_date.month,end_date.month)
+                .format(db,start_date.year,end_date.year,start_date.month,end_date.month, start_date.day, end_date.day)
 
     return ImpalaEngine.execute_query_as_list(is_query)