2017-06-15 17:44:49 +03:00
|
|
|
import ujson as json
|
|
|
|
import os
|
|
|
|
import pkg_resources
|
|
|
|
|
|
|
|
from pyspark.sql.types import StructType
|
|
|
|
|
|
|
|
import mozetl
|
2019-01-11 00:20:00 +03:00
|
|
|
|
|
|
|
SCHEMA_DIR = "json"
|
|
|
|
MAIN_SUMMARY_SCHEMA_BASENAME = "main_summary.v4.schema.json"
|
2017-06-15 17:44:49 +03:00
|
|
|
main_summary_path = os.path.join(SCHEMA_DIR, MAIN_SUMMARY_SCHEMA_BASENAME)
|
|
|
|
|
|
|
|
with pkg_resources.resource_stream(mozetl.__name__, main_summary_path) as f:
|
|
|
|
d = json.load(f)
|
|
|
|
MAIN_SUMMARY_SCHEMA = StructType.fromJson(d)
|