-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c16d84
commit 73ef80b
Showing
5 changed files
with
338 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.snowplow.badrows/loader_recovery_error/jsonschema/1-0-0", | ||
"data": { | ||
"processor": { | ||
"artifact": "snowplow-bigquery-repeater", | ||
"version": "0.6.0-rc7" | ||
}, | ||
"failure": { | ||
"error": { | ||
"message": "no such field.", | ||
"location": "unstruct_event_com_snplow_eng_gcp_luke_test_percentage_1_0_0", | ||
"reason": "invalid" | ||
} | ||
}, | ||
"payload": "{\"eventId\":\"90aebb1b-1d49-455b-9049-15ec72dfe5a9\",\"etlTstamp\":\"2020-11-10T16:56:39.283Z\",\"payload\":{\"geo_country\":\"DE\",\"event\":\"unstruct\",\"user_ipaddress\":\"18.194.133.57\",\"event_version\":\"1-0-0\",\"geo_city\":\"Frankfurt am Main\",\"platform\":\"srv\",\"event_id\":\"90aebb1b-1d49-455b-9049-15ec72dfe5a9\",\"etl_tstamp\":\"2020-11-10T16:56:39.283Z\",\"geo_latitude\":50.1188,\"v_collector\":\"ssc-2.0.0-googlepubsub\",\"collector_tstamp\":\"2020-11-10T16:56:37.401Z\",\"event_vendor\":\"com.snplow.eng.gcp\",\"network_userid\":\"70ec6f9e-cfe9-46c7-8b9c-fab280ea120e\",\"geo_region\":\"HE\",\"geo_timezone\":\"Europe/Berlin\",\"event_format\":\"jsonschema\",\"geo_zipcode\":\"60313\",\"useragent\":\"Go-http-client/2.0\",\"event_name\":\"luke_test_percentage\",\"dvce_created_tstamp\":\"2020-11-10T16:56:37.115Z\",\"dvce_sent_tstamp\":\"2020-11-10T16:56:37.117Z\",\"geo_longitude\":8.6843,\"v_tracker\":\"golang-2.3.0\",\"derived_tstamp\":\"2020-11-10T16:56:37.399Z\",\"app_id\":\"test_percentage_luke\",\"geo_region_name\":\"Hesse\",\"event_fingerprint\":\"b9f667befa875fcae1bedd55e463330e\",\"v_etl\":\"beam-enrich-1.4.1-common-1.4.1\",\"contexts_com_snowplowanalytics_snowplow_ua_parser_context_1_0_0\":[{\"device_family\":\"Other\",\"os_family\":\"Other\",\"useragent_family\":\"Go-http-client\",\"os_major\":null,\"os_minor\":null,\"os_patch\":null,\"os_patch_minor\":null,\"os_version\":\"Other\",\"useragent_major\":\"2\",\"useragent_minor\":\"0\",\"useragent_patch\":null,\"useragent_version\":\"Go-http-client 2.0\"}],\"contexts_com_iab_snowplow_spiders_and_robots_1_0_0\":[{\"category\":\"SPIDER_OR_ROBOT\",\"primary_impact\":\"UNKNOWN\",\"reason\":\"FAILED_UA_INCLUDE\",\"spider_or_robot\":true}],\"contexts_nl_basjes_yauaa_context_1_0_1\":[{\"device_class\":\"Unknown\",\"agent_build\":null,\"agent_class\":\"Special\",\"agent_information_email\":null,\"agent_information_url\":null,\"agent_language\":null,\"agent_language_code\":null,\"agent_name\":\"Go-http-client\",\"agent_name_version\":\"Go-http-client 2.0\",\"agent_name_version_major\":\"Go-http-client 2\",\"agent_security\":null,\"agent_uuid\":null,\"agent_version\":\"2.0\",\"agent_version_major\":\"2\",\"anonymized\":null,\"carrier\":null,\"device_brand\":\"Unknown\",\"device_cpu\":null,\"device_cpu_bits\":null,\"device_firmware_version\":null,\"device_name\":\"Unknown\",\"device_version\":null,\"facebook_carrier\":null,\"facebook_device_class\":null,\"facebook_device_name\":null,\"facebook_device_version\":null,\"facebook_fbop\":null,\"facebook_fbss\":null,\"facebook_operating_system_name\":null,\"facebook_operating_system_version\":null,\"g_sa_installation_id\":null,\"hacker_attack_vector\":null,\"hacker_toolkit\":null,\"i_e_compatibility_name_version\":null,\"i_e_compatibility_name_version_major\":null,\"i_e_compatibility_version\":null,\"i_e_compatibility_version_major\":null,\"kobo_affiliate\":null,\"kobo_platform_id\":null,\"layout_engine_build\":null,\"layout_engine_class\":\"Unknown\",\"layout_engine_name\":\"Unknown\",\"layout_engine_name_version\":\"Unknown ??\",\"layout_engine_name_version_major\":\"Unknown ??\",\"layout_engine_version\":\"??\",\"layout_engine_version_major\":\"??\",\"network_type\":null,\"operating_system_class\":\"Unknown\",\"operating_system_name\":\"Unknown\",\"operating_system_name_version\":\"Unknown ??\",\"operating_system_name_version_major\":\"Unknown ??\",\"operating_system_version\":\"??\",\"operating_system_version_build\":null,\"operating_system_version_major\":\"??\",\"webview_app_name\":null,\"webview_app_name_version_major\":null,\"webview_app_version\":null,\"webview_app_version_major\":null}],\"unstruct_event_com_snplow_eng_gcp_luke_test_percentage_1_0_0\":{\"availability_%\":\"10\",\"name\":\"test01\"}}}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"eventId": "90aebb1b-1d49-455b-9049-15ec72dfe5a9", | ||
"etlTstamp": "2020-11-10T16:56:39.283Z", | ||
"payload": { | ||
"geo_country": "DE", | ||
"event": "unstruct", | ||
"user_ipaddress": "18.194.133.57", | ||
"event_version": "1-0-0", | ||
"geo_city": "Frankfurt am Main", | ||
"platform": "srv", | ||
"event_id": "90aebb1b-1d49-455b-9049-15ec72dfe5a9", | ||
"etl_tstamp": "2020-11-10T16:56:39.283Z", | ||
"geo_latitude": 50.1188, | ||
"v_collector": "ssc-2.0.0-googlepubsub", | ||
"collector_tstamp": "2020-11-10T16:56:37.401Z", | ||
"event_vendor": "com.snplow.eng.gcp", | ||
"network_userid": "70ec6f9e-cfe9-46c7-8b9c-fab280ea120e", | ||
"geo_region": "HE", | ||
"geo_timezone": "Europe/Berlin", | ||
"event_format": "jsonschema", | ||
"geo_zipcode": "60313", | ||
"useragent": "Go-http-client/2.0", | ||
"event_name": "luke_test_percentage", | ||
"dvce_created_tstamp": "2020-11-10T16:56:37.115Z", | ||
"dvce_sent_tstamp": "2020-11-10T16:56:37.117Z", | ||
"geo_longitude": 8.6843, | ||
"v_tracker": "golang-2.3.0", | ||
"derived_tstamp": "2020-11-10T16:56:37.399Z", | ||
"app_id": "test_percentage_luke", | ||
"geo_region_name": "Hesse", | ||
"event_fingerprint": "b9f667befa875fcae1bedd55e463330e", | ||
"v_etl": "beam-enrich-1.4.1-common-1.4.1", | ||
"contexts_com_snowplowanalytics_snowplow_ua_parser_context_1_0_0": [ | ||
{ | ||
"device_family": "Other", | ||
"os_family": "Other", | ||
"useragent_family": "Go-http-client", | ||
"os_major": null, | ||
"os_minor": null, | ||
"os_patch": null, | ||
"os_patch_minor": null, | ||
"os_version": "Other", | ||
"useragent_major": "2", | ||
"useragent_minor": "0", | ||
"useragent_patch": null, | ||
"useragent_version": "Go-http-client 2.0" | ||
} | ||
], | ||
"contexts_com_iab_snowplow_spiders_and_robots_1_0_0": [ | ||
{ | ||
"category": "SPIDER_OR_ROBOT", | ||
"primary_impact": "UNKNOWN", | ||
"reason": "FAILED_UA_INCLUDE", | ||
"spider_or_robot": true | ||
} | ||
], | ||
"contexts_nl_basjes_yauaa_context_1_0_1": [ | ||
{ | ||
"device_class": "Unknown", | ||
"agent_build": null, | ||
"agent_class": "Special", | ||
"agent_information_email": null, | ||
"agent_information_url": null, | ||
"agent_language": null, | ||
"agent_language_code": null, | ||
"agent_name": "Go-http-client", | ||
"agent_name_version": "Go-http-client 2.0", | ||
"agent_name_version_major": "Go-http-client 2", | ||
"agent_security": null, | ||
"agent_uuid": null, | ||
"agent_version": "2.0", | ||
"agent_version_major": "2", | ||
"anonymized": null, | ||
"carrier": null, | ||
"device_brand": "Unknown", | ||
"device_cpu": null, | ||
"device_cpu_bits": null, | ||
"device_firmware_version": null, | ||
"device_name": "Unknown", | ||
"device_version": null, | ||
"facebook_carrier": null, | ||
"facebook_device_class": null, | ||
"facebook_device_name": null, | ||
"facebook_device_version": null, | ||
"facebook_fbop": null, | ||
"facebook_fbss": null, | ||
"facebook_operating_system_name": null, | ||
"facebook_operating_system_version": null, | ||
"g_sa_installation_id": null, | ||
"hacker_attack_vector": null, | ||
"hacker_toolkit": null, | ||
"i_e_compatibility_name_version": null, | ||
"i_e_compatibility_name_version_major": null, | ||
"i_e_compatibility_version": null, | ||
"i_e_compatibility_version_major": null, | ||
"kobo_affiliate": null, | ||
"kobo_platform_id": null, | ||
"layout_engine_build": null, | ||
"layout_engine_class": "Unknown", | ||
"layout_engine_name": "Unknown", | ||
"layout_engine_name_version": "Unknown ??", | ||
"layout_engine_name_version_major": "Unknown ??", | ||
"layout_engine_version": "??", | ||
"layout_engine_version_major": "??", | ||
"network_type": null, | ||
"operating_system_class": "Unknown", | ||
"operating_system_name": "Unknown", | ||
"operating_system_name_version": "Unknown ??", | ||
"operating_system_name_version_major": "Unknown ??", | ||
"operating_system_version": "??", | ||
"operating_system_version_build": null, | ||
"operating_system_version_major": "??", | ||
"webview_app_name": null, | ||
"webview_app_name_version_major": null, | ||
"webview_app_version": null, | ||
"webview_app_version_major": null | ||
} | ||
], | ||
"unstruct_event_com_snplow_eng_gcp_luke_test_percentage_1_0_0": { | ||
"availability_%": "10", | ||
"name": "test01" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"eventId": "90aebb1b-1d49-455b-9049-15ec72dfe5a9", | ||
"etlTstamp": "2020-11-10T16:56:39.283Z", | ||
"payload": { | ||
"geo_country": "DE", | ||
"event": "unstruct", | ||
"user_ipaddress": "18.194.133.57", | ||
"event_version": "1-0-0", | ||
"geo_city": "Frankfurt am Main", | ||
"platform": "srv", | ||
"event_id": "90aebb1b-1d49-455b-9049-15ec72dfe5a9", | ||
"etl_tstamp": "2020-11-10T16:56:39.283Z", | ||
"geo_latitude": 50.1188, | ||
"v_collector": "ssc-2.0.0-googlepubsub", | ||
"collector_tstamp": "2020-11-10T16:56:37.401Z", | ||
"event_vendor": "com.snplow.eng.gcp", | ||
"network_userid": "70ec6f9e-cfe9-46c7-8b9c-fab280ea120e", | ||
"geo_region": "HE", | ||
"geo_timezone": "Europe/Berlin", | ||
"event_format": "jsonschema", | ||
"geo_zipcode": "60313", | ||
"useragent": "Go-http-client/2.0", | ||
"event_name": "luke_test_percentage", | ||
"dvce_created_tstamp": "2020-11-10T16:56:37.115Z", | ||
"dvce_sent_tstamp": "2020-11-10T16:56:37.117Z", | ||
"geo_longitude": 8.6843, | ||
"v_tracker": "golang-2.3.0", | ||
"derived_tstamp": "2020-11-10T16:56:37.399Z", | ||
"app_id": "test_percentage_luke", | ||
"geo_region_name": "Hesse", | ||
"event_fingerprint": "b9f667befa875fcae1bedd55e463330e", | ||
"v_etl": "beam-enrich-1.4.1-common-1.4.1", | ||
"contexts_com_snowplowanalytics_snowplow_ua_parser_context_1_0_0": [ | ||
{ | ||
"device_family": "Other", | ||
"os_family": "Other", | ||
"useragent_family": "Go-http-client", | ||
"os_major": null, | ||
"os_minor": null, | ||
"os_patch": null, | ||
"os_patch_minor": null, | ||
"os_version": "Other", | ||
"useragent_major": "2", | ||
"useragent_minor": "0", | ||
"useragent_patch": null, | ||
"useragent_version": "Go-http-client 2.0" | ||
} | ||
], | ||
"contexts_com_iab_snowplow_spiders_and_robots_1_0_0": [ | ||
{ | ||
"category": "SPIDER_OR_ROBOT", | ||
"primary_impact": "UNKNOWN", | ||
"reason": "FAILED_UA_INCLUDE", | ||
"spider_or_robot": true | ||
} | ||
], | ||
"contexts_nl_basjes_yauaa_context_1_0_1": [ | ||
{ | ||
"device_class": "Unknown", | ||
"agent_build": null, | ||
"agent_class": "Special", | ||
"agent_information_email": null, | ||
"agent_information_url": null, | ||
"agent_language": null, | ||
"agent_language_code": null, | ||
"agent_name": "Go-http-client", | ||
"agent_name_version": "Go-http-client 2.0", | ||
"agent_name_version_major": "Go-http-client 2", | ||
"agent_security": null, | ||
"agent_uuid": null, | ||
"agent_version": "2.0", | ||
"agent_version_major": "2", | ||
"anonymized": null, | ||
"carrier": null, | ||
"device_brand": "Unknown", | ||
"device_cpu": null, | ||
"device_cpu_bits": null, | ||
"device_firmware_version": null, | ||
"device_name": "Unknown", | ||
"device_version": null, | ||
"facebook_carrier": null, | ||
"facebook_device_class": null, | ||
"facebook_device_name": null, | ||
"facebook_device_version": null, | ||
"facebook_fbop": null, | ||
"facebook_fbss": null, | ||
"facebook_operating_system_name": null, | ||
"facebook_operating_system_version": null, | ||
"g_sa_installation_id": null, | ||
"hacker_attack_vector": null, | ||
"hacker_toolkit": null, | ||
"i_e_compatibility_name_version": null, | ||
"i_e_compatibility_name_version_major": null, | ||
"i_e_compatibility_version": null, | ||
"i_e_compatibility_version_major": null, | ||
"kobo_affiliate": null, | ||
"kobo_platform_id": null, | ||
"layout_engine_build": null, | ||
"layout_engine_class": "Unknown", | ||
"layout_engine_name": "Unknown", | ||
"layout_engine_name_version": "Unknown ??", | ||
"layout_engine_name_version_major": "Unknown ??", | ||
"layout_engine_version": "??", | ||
"layout_engine_version_major": "??", | ||
"network_type": null, | ||
"operating_system_class": "Unknown", | ||
"operating_system_name": "Unknown", | ||
"operating_system_name_version": "Unknown ??", | ||
"operating_system_name_version_major": "Unknown ??", | ||
"operating_system_version": "??", | ||
"operating_system_version_build": null, | ||
"operating_system_version_major": "??", | ||
"webview_app_name": null, | ||
"webview_app_name_version_major": null, | ||
"webview_app_version": null, | ||
"webview_app_version_major": null | ||
} | ||
], | ||
"unstruct_event_com_snplow_eng_gcp_luke_test_percentage_1_0_0": { | ||
"availability_percentage": "10", | ||
"name": "test01" | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...src/test/scala/com/snowplowanalytics/snowplow/storage/bigquery/repeater/RecoverSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.snowplowanalytics.snowplow.storage.bigquery.repeater | ||
|
||
import org.specs2.Specification | ||
import scala.io.Source | ||
|
||
class RecoverSpec extends Specification { | ||
|
||
def is = | ||
s2""" | ||
fix wrong column name $e1 | ||
""" | ||
|
||
def e1 = { | ||
val in = Source.fromResource("payload.json").mkString | ||
val recovered = Recover.fix(in) | ||
val out = Source.fromResource("payload_fixed.json").mkString | ||
|
||
recovered ==== out | ||
} | ||
|
||
} |