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:40 UTC

[16/50] [abbrv] incubator-spot git commit: Added day partition to the ingest summary

Added day partition to the 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/8841ffd8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spot/tree/8841ffd8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spot/diff/8841ffd8

Branch: refs/heads/SPOT-35_graphql_api
Commit: 8841ffd853318cd2de0eecb7695df56097b34bf4
Parents: 50fbe61
Author: LedaLima <le...@apache.org>
Authored: Tue Mar 7 17:20:10 2017 -0600
Committer: Diego Ortiz Huerta <di...@intel.com>
Committed: Wed Mar 15 11:49:48 2017 -0700

----------------------------------------------------------------------
 spot-oa/oa/dns/dns_oa.py     | 4 ++--
 spot-oa/oa/flow/flow_oa.py   | 4 ++--
 spot-oa/oa/proxy/proxy_oa.py | 7 +++----
 3 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/8841ffd8/spot-oa/oa/dns/dns_oa.py
----------------------------------------------------------------------
diff --git a/spot-oa/oa/dns/dns_oa.py b/spot-oa/oa/dns/dns_oa.py
index a154c35..06da51d 100644
--- a/spot-oa/oa/dns/dns_oa.py
+++ b/spot-oa/oa/dns/dns_oa.py
@@ -410,6 +410,6 @@ class OA(object):
 
         if len(df_final) > 0:
             query_to_insert=("""
-                INSERT INTO {0}.dns_ingest_summary PARTITION (y={1}, m={2}) VALUES {3};
-            """).format(self._db, yr, mn, tuple(df_final))            
+                INSERT INTO {0}.dns_ingest_summary PARTITION (y={1}, m={2}, d={3}) VALUES {4};
+            """).format(self._db, yr, mn, dy, tuple(df_final))            
             impala.execute_query(query_to_insert)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/8841ffd8/spot-oa/oa/flow/flow_oa.py
----------------------------------------------------------------------
diff --git a/spot-oa/oa/flow/flow_oa.py b/spot-oa/oa/flow/flow_oa.py
index bf2d301..4f8bcb2 100644
--- a/spot-oa/oa/flow/flow_oa.py
+++ b/spot-oa/oa/flow/flow_oa.py
@@ -454,8 +454,8 @@ class OA(object):
             df_final = df_filtered.append(df_per_min, ignore_index=True).to_records(False,False) 
             if len(df_final) > 0:
                 query_to_insert=("""
-                    INSERT INTO {0}.flow_ingest_summary PARTITION (y={1}, m={2}) VALUES {3};
-                """).format(self._db, yr, mn, tuple(df_final))
+                    INSERT INTO {0}.flow_ingest_summary PARTITION (y={1}, m={2}, d={3}) VALUES {4};
+                """).format(self._db, yr, mn, dy, tuple(df_final))
 
                 impala.execute_query(query_to_insert)
                 

http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/8841ffd8/spot-oa/oa/proxy/proxy_oa.py
----------------------------------------------------------------------
diff --git a/spot-oa/oa/proxy/proxy_oa.py b/spot-oa/oa/proxy/proxy_oa.py
index 07313eb..f01d8ff 100644
--- a/spot-oa/oa/proxy/proxy_oa.py
+++ b/spot-oa/oa/proxy/proxy_oa.py
@@ -307,8 +307,7 @@ class OA(object):
             """).format(self._db,year, month, day, value_string[:-1])
 
             impala.execute_query(query_to_insert) 
-
-   
+ 
 
     def _ingest_summary(self): 
         # get date parameters.
@@ -347,8 +346,8 @@ class OA(object):
             df_final = df_filtered.append(df_per_min, ignore_index=True).to_records(False,False) 
             if len(df_final) > 0:
                 query_to_insert=("""
-                    INSERT INTO {0}.proxy_ingest_summary PARTITION (y={1}, m={2}) VALUES {3};
-                """).format(self._db, yr, mn, tuple(df_final))
+                    INSERT INTO {0}.proxy_ingest_summary PARTITION (y={1}, m={2}, d={3}) VALUES {4};
+                """).format(self._db, yr, mn, dy, tuple(df_final))
 
                 impala.execute_query(query_to_insert)