Commit 5d75e389 authored by Lubber's avatar Lubber

Updated Schema

parent ba7a3462
...@@ -6,23 +6,26 @@ def add_table(use_case: str, table_name: str): ...@@ -6,23 +6,26 @@ def add_table(use_case: str, table_name: str):
''' '''
columns = [ columns = [
# "docType", 'videoId',
"videoId", 'objType',
"Video_Token", 'eventName',
"replyTo", 'video_token',
"Created", 'replyTo',
"Duration", 'created',
"videoResolution", 'duration',
"Label", 'videoResolution',
"ThreadId", 'label',
"Position", 'threadId',
"ModifiedDate", 'position',
"Views", 'views',
"ModeratedBy", 'moderatedBy',
"CommunityManagerNotes", 'moderationDate',
"Rewards", 'communityManagerNotes',
"Video_State", 'rewards',
"Video_Type" 'video_state',
'video_type',
'AppicationType',
'docType'
] ]
columns = { c : c for c in columns } columns = { c : c for c in columns }
...@@ -43,14 +46,14 @@ def add_layers(use_case:str, table_name: str): ...@@ -43,14 +46,14 @@ def add_layers(use_case:str, table_name: str):
"name": "Manager_Layer", "name": "Manager_Layer",
"properties": [ "properties": [
"UniqueID", "UniqueID",
"ModifiedDate", "moderationDate",
"ModeratedBy", "moderatedBy",
"Video_State", "video_state",
"Video_Type" "video_type"
], ],
"cluster_properties": [ "cluster_properties": [
"ModeratedBy", "moderatedBy",
"Video_State" "video_state"
] ]
}, },
{ {
...@@ -59,16 +62,16 @@ def add_layers(use_case:str, table_name: str): ...@@ -59,16 +62,16 @@ def add_layers(use_case:str, table_name: str):
"name": "Video_Popularity_Layer", "name": "Video_Popularity_Layer",
"properties": [ "properties": [
"UniqueID", "UniqueID",
"Label", "label",
"Created", "created",
"Views", "views",
"Rewards", "rewards",
"Video_State", "video_state",
"Video_Type" "video_type"
], ],
"cluster_properties": [ "cluster_properties": [
"Views", "views",
"Video_Type" "video_type"
] ]
}, },
{ {
...@@ -77,15 +80,15 @@ def add_layers(use_case:str, table_name: str): ...@@ -77,15 +80,15 @@ def add_layers(use_case:str, table_name: str):
"name": "Video_Age_Layer", "name": "Video_Age_Layer",
"properties": [ "properties": [
"UniqueID", "UniqueID",
"Label", "label",
"Created", "created",
"Views", "views",
"Rewards", "rewards",
"Video_State", "video_state",
"Video_Type" "video_type"
], ],
"cluster_properties": [ "cluster_properties": [
"Created" "created"
] ]
}, },
{ {
...@@ -94,15 +97,15 @@ def add_layers(use_case:str, table_name: str): ...@@ -94,15 +97,15 @@ def add_layers(use_case:str, table_name: str):
"name": "Rewards_Layer", "name": "Rewards_Layer",
"properties": [ "properties": [
"UniqueID", "UniqueID",
"Label", "label",
"Created", "created",
"Views", "views",
"Rewards", "rewards",
"Video_State", "video_state",
"Video_Type" "video_type"
], ],
"cluster_properties": [ "cluster_properties": [
"Rewards" "rewards"
] ]
}, },
{ {
...@@ -111,14 +114,14 @@ def add_layers(use_case:str, table_name: str): ...@@ -111,14 +114,14 @@ def add_layers(use_case:str, table_name: str):
"name": "Video_Lenght_Layer", "name": "Video_Lenght_Layer",
"properties": [ "properties": [
"UniqueID", "UniqueID",
"Created", "created",
"Views", "views",
"Duration", "duration",
"Video_State", "video_state",
"Video_Type" "video_type"
], ],
"cluster_properties": [ "cluster_properties": [
"Duration" "duration"
] ]
}, },
{ {
...@@ -127,11 +130,11 @@ def add_layers(use_case:str, table_name: str): ...@@ -127,11 +130,11 @@ def add_layers(use_case:str, table_name: str):
"name": "Video_Resolution_Layer", "name": "Video_Resolution_Layer",
"properties": [ "properties": [
"UniqueID", "UniqueID",
"Created", "created",
"Views", "views",
"videoResolution", "videoResolution",
"Video_State", "video_state",
"Video_Type" "video_type"
], ],
"cluster_properties": [ "cluster_properties": [
"videoResolution" "videoResolution"
......
...@@ -50,7 +50,7 @@ for video in videosRequest.json(): ...@@ -50,7 +50,7 @@ for video in videosRequest.json():
lastState = eventMap lastState = eventMap
lastState["AppicationType"] = "vialog-new" lastState["AppicationType"] = "vialog-new"
lastState["docType"] = "video" lastState["docType"] = "video"
#send_transaction_to_rest_gateway(lastState) send_transaction_to_rest_gateway(lastState)
print(lastState) print(lastState)
if eventMap["eventName"] == 'r1eabcbdc8f5378b2ba71a1b6fe2038b Created' or eventMap["eventName"] == 'Created': if eventMap["eventName"] == 'r1eabcbdc8f5378b2ba71a1b6fe2038b Created' or eventMap["eventName"] == 'Created':
...@@ -82,7 +82,7 @@ for video in videosRequest.json(): ...@@ -82,7 +82,7 @@ for video in videosRequest.json():
change["ApplicationType"] = "vialog-new" change["ApplicationType"] = "vialog-new"
change["docType"] = "change" change["docType"] = "change"
print(change) print(change)
send_transaction_to_rest_gateway(change) #send_transaction_to_rest_gateway(change)
i += 1 i += 1
elif videoRequest.text == "": elif videoRequest.text == "":
empty.add(id) empty.add(id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment