/* syntax version 1 */
/*
    Should check is TryParse work correct for proto with required fields
    Can't parse message of type "NNewsStorageProtocol.TRawNewsDoc" because it is missing required fields: Url, Status, FetchTime, FetchHost
*/

$config = @@{
    "skip": 0,
    "meta": "eNqtWFlzG0UQRrc0vpRxjiUER9kcOCbIwVBFkgoB31ZhOWYtAlRRRa20Y3nJale1Rxy9kkfyL/gjVPHIC3+BKn4I3T07q5Us2Q/hTX1P93zT3Sv2Ns+WBqeiveqK02C173uht+pFoWO7L4M6kVw7OABZwz32jkLPN7viENkdz9EdVm49j8J9UOZVlvvOd7RMLbtcMfAnv8qKR17kd4SWJWZM8eusfCTcULggydUyy3NGQktZtwdkoBVqObBKaP2fLKuocAFqbppOp2X3BAUFL4rmNTZzFHU6IghInKUgaRZq7Ji2I6yWb4sgPkaaxR+xAgXS8nCMmTW9Pq0KdXUmQxqg7y0RdHy7H9qeC2lkII00i3/OrqTITc89ti0qRxF0s8ZkIV9iLKVaItUUh99j8zuR46R0yqQzxsXK7fheb0cIS6uARtlIaPbHLXZ3HA6BzJdYP1vtGBWXqR5jtbh+AZb0b9lCqyks22ydRL22C/WeDJw9YXdPwvjmYopfZoXvbSs8ia9LEvoBm5UuDx1zIPx39vdvhs1Jh1AzQGU4wSOUsAkwag36El0AU0WnouUmR8unonGNlTbs0DdDQUDJGorkN1hlxzd7gmQSGEMGnmArgl+IsJJ8RIrmt1mlEWyJYzNyQsJA+Unh2HQCYQz5+l8ZNiPT3PW9qM8fs0IjFL0A0kS8365Put/6SGEMacGfsKKsPdUieSuTbaWmEVvwbcYSKOA7xNh3z7NPtI2Uof4my4pS/i6JPGZFKkYAiaDtrfNsSdOIDf6nPPhTVpKFGes759ZSmeh/ZqBDbr8G/CBI11ieAIq4nV9bmuxoGzRRyyBdBfXsEOpj3Sx3tps9Svo8Int+rTY9ktRLJgE8iUYPdOIeKQn97wzUct01nUFod7AkKg10vjylHol+fXvb7dquSmieZRtW/EbhF77OQxNeURBnElP6T6wUG3LGij+ariVeV9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/RmrtuL5ue915AcGTOJvxIAm8ayBP7E3KXziKM4bitR/zcJtxw622nSsDWhysSvyMbN2b0pGY4GNxI6GhRMFJ8KigNAMYxKb25HddeG+/GSsJ4zUypB/15WhML4ypAZnkWSKXPkBNrR40cbd0BAOcC3gwJY2y8q09yKVQeoFfKd7SGWRWo8sm6gcdMH5lm+6gUMlQF5+5QvGhos1n4PW7XYcL4BUpWscofikpOu9sEcTqJpdabD50STR+MDzezDqvA4YL7KFpulGMF8GW8IRcF7wAcyY2BjIwQ2ufoNPydT2go6S/QUcwb6JcfeiNjgAGRTFsTsoo130CLbPntmH/GDfo7uIGXncuKkYilPgZZZfD71etcivscVdDzYWF/8cGoYr/QdunI1N",
    "name": "TRawNewsDoc",
    "format": "protobin"
}@@;

$udf = Udf(Protobuf::TryParse, $config as TypeConfig);

SELECT $udf(doc) AS parsed
FROM Input;
