Я создал функцию, которая выводит json ниже из API Google Video Intelligence. Я пытаюсь перевести json в формат с разделителями новой строки, чтобы я мог загрузить файл json в Big Query.
Я пробовал следующий код JQ, однако он не преобразует его в принятый формат by BiG Query.
Любая помощь с благодарностью.
$ cat a. json | jq - c '. []'
Полный json вывод из видео интеллекта
{
"annotation_results": [ {
"input_uri": "/mastersproject-252719.appspot.com/AEnB2UoTKtyPJd1X88yUBKC60dn3kp6qrnnE91Q5PylS9RqotQWrt2TzFPE7kG1UHtxoBYyWX5mo7zoXU1jzwnNe_WRD-t0QeFSoHU4g-WJZTfeQV4cpFNY.4-FicKZIT3vtFBd2",
"segment": {
"start_time_offset": {
},
"end_time_offset": {
"seconds": 126,
"nanos": 160000000
}
},
"shot_annotations": [ {
"start_time_offset": {
},
"end_time_offset": {
"seconds": 3,
"nanos": 960000000
}
}, {
"start_time_offset": {
"seconds": 4
},
"end_time_offset": {
"seconds": 5,
"nanos": 840000000
}
}, {
"start_time_offset": {
"seconds": 5,
"nanos": 880000000
},
"end_time_offset": {
"seconds": 11,
"nanos": 40000000
}
}, {
"start_time_offset": {
"seconds": 11,
"nanos": 80000000
},
"end_time_offset": {
"seconds": 14,
"nanos": 640000000
}
}, {
"start_time_offset": {
"seconds": 14,
"nanos": 680000000
},
"end_time_offset": {
"seconds": 15,
"nanos": 400000000
}
}, {
"start_time_offset": {
"seconds": 15,
"nanos": 440000000
},
"end_time_offset": {
"seconds": 19,
"nanos": 840000000
}
}, {
"start_time_offset": {
"seconds": 19,
"nanos": 880000000
},
"end_time_offset": {
"seconds": 21,
"nanos": 880000000
}
}, {
"start_time_offset": {
"seconds": 21,
"nanos": 920000000
},
"end_time_offset": {
"seconds": 25,
"nanos": 120000000
}
}, {
"start_time_offset": {
"seconds": 25,
"nanos": 160000000
},
"end_time_offset": {
"seconds": 30,
"nanos": 880000000
}
}, {
"start_time_offset": {
"seconds": 30,
"nanos": 920000000
},
"end_time_offset": {
"seconds": 32,
"nanos": 960000000
}
}, {
"start_time_offset": {
"seconds": 33
},
"end_time_offset": {
"seconds": 38,
"nanos": 80000000
}
}, {
"start_time_offset": {
"seconds": 38,
"nanos": 120000000
},
"end_time_offset": {
"seconds": 44,
"nanos": 80000000
}
}, {
"start_time_offset": {
"seconds": 44,
"nanos": 120000000
},
"end_time_offset": {
"seconds": 47,
"nanos": 680000000
}
}, {
"start_time_offset": {
"seconds": 47,
"nanos": 720000000
},
"end_time_offset": {
"seconds": 51,
"nanos": 120000000
}
}, {
"start_time_offset": {
"seconds": 51,
"nanos": 160000000
},
"end_time_offset": {
"seconds": 56,
"nanos": 640000000
}
}, {
"start_time_offset": {
"seconds": 56,
"nanos": 680000000
},
"end_time_offset": {
"seconds": 59,
"nanos": 40000000
}
}, {
"start_time_offset": {
"seconds": 59,
"nanos": 80000000
},
"end_time_offset": {
"seconds": 62,
"nanos": 880000000
}
}, {
"start_time_offset": {
"seconds": 62,
"nanos": 920000000
},
"end_time_offset": {
"seconds": 70,
"nanos": 640000000
}
}, {
"start_time_offset": {
"seconds": 70,
"nanos": 680000000
},
"end_time_offset": {
"seconds": 74,
"nanos": 240000000
}
}, {
"start_time_offset": {
"seconds": 74,
"nanos": 280000000
},
"end_time_offset": {
"seconds": 76,
"nanos": 40000000
}
}, {
"start_time_offset": {
"seconds": 76,
"nanos": 80000000
},
"end_time_offset": {
"seconds": 82,
"nanos": 240000000
}
}, {
"start_time_offset": {
"seconds": 82,
"nanos": 280000000
},
"end_time_offset": {
"seconds": 86
}
}, {
"start_time_offset": {
"seconds": 86,
"nanos": 40000000
},
"end_time_offset": {
"seconds": 89,
"nanos": 720000000
}
}, {
"start_time_offset": {
"seconds": 89,
"nanos": 760000000
},
"end_time_offset": {
"seconds": 99,
"nanos": 680000000
}
}, {
"start_time_offset": {
"seconds": 99,
"nanos": 720000000
},
"end_time_offset": {
"seconds": 104,
"nanos": 360000000
}
}, {
"start_time_offset": {
"seconds": 104,
"nanos": 400000000
},
"end_time_offset": {
"seconds": 107,
"nanos": 440000000
}
}, {
"start_time_offset": {
"seconds": 107,
"nanos": 480000000
},
"end_time_offset": {
"seconds": 108,
"nanos": 640000000
}
}, {
"start_time_offset": {
"seconds": 108,
"nanos": 680000000
},
"end_time_offset": {
"seconds": 112,
"nanos": 160000000
}
}, {
"start_time_offset": {
"seconds": 112,
"nanos": 200000000
},
"end_time_offset": {
"seconds": 114,
"nanos": 640000000
}
}, {
"start_time_offset": {
"seconds": 114,
"nanos": 680000000
},
"end_time_offset": {
"seconds": 117,
"nanos": 520000000
}
}, {
"start_time_offset": {
"seconds": 117,
"nanos": 560000000
},
"end_time_offset": {
"seconds": 118,
"nanos": 760000000
}
}, {
"start_time_offset": {
"seconds": 118,
"nanos": 800000000
},
"end_time_offset": {
"seconds": 121,
"nanos": 80000000
}
}, {
"start_time_offset": {
"seconds": 121,
"nanos": 120000000
},
"end_time_offset": {
"seconds": 122,
"nanos": 320000000
}
}, {
"start_time_offset": {
"seconds": 122,
"nanos": 360000000
},
"end_time_offset": {
"seconds": 124,
"nanos": 200000000
}
}, {
"start_time_offset": {
"seconds": 124,
"nanos": 240000000
},
"end_time_offset": {
"seconds": 126,
"nanos": 160000000
}
} ]
} ]
}