Thank you DE. I  did not write any code DE.

I am trying to create schema. Am I missing any [ ] ?
My pubsub message is correct. I am  trying  to match my schema with pubsub 
message. 

{
   "costs":[
      {
         "calculatedDateTime":"2022-11-29T15:38:47Z",
         "sku":122222222,
         "vendor":111111,
         "location":1234,
         "locationType":"",
         "cost":200.1200,
         "effectiveBeginDateTime":"2019-12-25T07:00:00Z",
         "effectiveEndDateTime":"2022-11-17T06:59:59Z",
         "transactionType":"INSERT",
         "details":[
            {
               "type":"PERMANENT",
               "cost":200.1200,
               "effective":true
            }
         ]
      },
      {
         "calculatedDateTime":"2022-11-29T15:38:47Z",
         "sku":222222222,
         "vendor":222222,
         "location":2222,
         "locationType":"",
         "cost":45,
         "effectiveBeginDateTime":"2022-11-17T07:00:00Z",
         "effectiveEndDateTime":"2023-11-24T06:59:59Z",
         "transactionType":"INSERT",
         "details":[
            {
               "type":"PERMANENT",
               "cost":45,
               "effective":true
            }
         ]
      },
      {
         "calculatedDateTime":"2022-11-29T15:38:47Z",
         "sku":3333333333,
         "vendor":44444444,
         "location":2222,
         "locationType":"",
         "cost":200.1200,
         "effectiveBeginDateTime":"2019-12-25T07:00:00Z",
         "effectiveEndDateTime":"9999-12-30T23:59:59Z",
         "transactionType":"DELETE",
         "details":[
            {
               "type":"PERMANENT",
               "cost":200.1200,
               "effective":true
            }
         ]
      }
   ]
}

On Tuesday, November 29, 2022 at 10:56:09 PM UTC-5 [email protected] wrote:

> Hard to say without seeing more details/code. Sorry :(
>
> On Tue, Nov 29, 2022 at 7:54 PM 'SUDHAVANI SUNKARA' via Protocol Buffers <
> [email protected]> wrote:
>
>> I have this
>> syntax = "proto2";
>>
>> message SkuCostAudit {
>>     message costs{
>>         required string calculatedDateTime = 1;
>>         required int64 sku = 2;
>>     required int64 vendor = 3;
>>     required int64 location = 4;
>>     required string locationType = 5;
>>     required float cost = 6;
>>     required string effectiveBeginDateTime = 7;
>>     required string effectiveEndDateTime = 8;
>>     required string transactionType = 9;
>>     repeated details details = 10;
>>     }
>>     message details{
>>     required string type = 12;
>>     required float cost = 13;
>>     required string effective = 14;
>>   }
>>     repeated costs xyz = 11;
>> }
>>
>>
>>
>> Still getting error
>>
>> Invalid JSON-encoded message against Protocol Buffer schema. Syntax 
>> error: value, object or array expected.
>>
>> On Tuesday, November 29, 2022 at 10:51:27 PM UTC-5 [email protected] 
>> wrote:
>>
>>> Say “repeated” instead of “required” for details/10 line. 
>>>
>>> On Tue, Nov 29, 2022 at 7:39 PM 'SUDHAVANI SUNKARA' via Protocol Buffers 
>>> <[email protected]> wrote:
>>>
>>>> Thank you  DE.
>>>>
>>>> I tried this still same isuue
>>>>
>>>> syntax = "proto2";
>>>>
>>>> message SkuCostAudit {
>>>>     message costs{
>>>>         required string calculatedDateTime = 1;
>>>>         required int64 sku = 2;
>>>>     required int64 vendor = 3;
>>>>     required int64 location = 4;
>>>>     required string locationType = 5;
>>>>     required float cost = 6;
>>>>     required string effectiveBeginDateTime = 7;
>>>>     required string effectiveEndDateTime = 8;
>>>>     required string transactionType = 9;
>>>>     required details details = 10;
>>>>     }
>>>>     message details{
>>>>     required string type = 13;
>>>>     required float cost = 14;
>>>>     required string effective = 15;
>>>>   }
>>>>     repeated costs xyz = 11;
>>>> } 
>>>>
>>>> On Tuesday, November 29, 2022 at 10:33:34 PM UTC-5 [email protected] 
>>>> wrote:
>>>>
>>>>> Looks like details needs to be a repeated message with its own schema 
>>>>> and you have it set to required and string.  
>>>>>
>>>>> On Tue, Nov 29, 2022 at 7:30 PM 'SUDHAVANI SUNKARA' via Protocol 
>>>>> Buffers <[email protected]> wrote:
>>>>>
>>>>>> Hi 
>>>>>>
>>>>>> I am trying to use BQ subscription to write into BQ table. I am using 
>>>>>> pubsub schema and trying to use protocol buffer option.
>>>>>> Here is my schema
>>>>>>
>>>>>> syntax = "proto2";
>>>>>>
>>>>>> message SkuCostAudit {
>>>>>>     message costs{
>>>>>>         required string calculatedDateTime = 1;
>>>>>>         required int64 sku = 2;
>>>>>>     required int64 vendor = 3;
>>>>>>     required int64 location = 4;
>>>>>>     required string locationType = 5;
>>>>>>     required float cost = 6;
>>>>>>     required string effectiveBeginDateTime = 7;
>>>>>>     required string effectiveEndDateTime = 8;
>>>>>>     required string transactionType = 9;
>>>>>>     required string details = 10;
>>>>>>     }
>>>>>>     
>>>>>>     repeated costs xyz = 11;
>>>>>> }
>>>>>>
>>>>>> I am trying to test my schema with this pubsub message..
>>>>>>
>>>>>> {
>>>>>>    "costs":[
>>>>>>       {
>>>>>>          "calculatedDateTime":"2022-11-29T15:38:47Z",
>>>>>>          "sku":122222222,
>>>>>>          "vendor":111111,
>>>>>>          "location":1234,
>>>>>>          "locationType":"",
>>>>>>          "cost":200.1200,
>>>>>>          "effectiveBeginDateTime":"2019-12-25T07:00:00Z",
>>>>>>          "effectiveEndDateTime":"2022-11-17T06:59:59Z",
>>>>>>          "transactionType":"INSERT",
>>>>>>          "details":[
>>>>>>             {
>>>>>>                "type":"PERMANENT",
>>>>>>                "cost":200.1200,
>>>>>>                "effective":true
>>>>>>             }
>>>>>>          ]
>>>>>>       },
>>>>>>       {
>>>>>>          "calculatedDateTime":"2022-11-29T15:38:47Z",
>>>>>>          "sku":222222222,
>>>>>>          "vendor":222222,
>>>>>>          "location":2222,
>>>>>>          "locationType":"",
>>>>>>          "cost":45,
>>>>>>          "effectiveBeginDateTime":"2022-11-17T07:00:00Z",
>>>>>>          "effectiveEndDateTime":"2023-11-24T06:59:59Z",
>>>>>>          "transactionType":"INSERT",
>>>>>>          "details":[
>>>>>>             {
>>>>>>                "type":"PERMANENT",
>>>>>>                "cost":45,
>>>>>>                "effective":true
>>>>>>             }
>>>>>>          ]
>>>>>>       },
>>>>>>       {
>>>>>>          "calculatedDateTime":"2022-11-29T15:38:47Z",
>>>>>>          "sku":3333333333,
>>>>>>          "vendor":44444444,
>>>>>>          "location":2222,
>>>>>>          "locationType":"",
>>>>>>          "cost":200.1200,
>>>>>>          "effectiveBeginDateTime":"2019-12-25T07:00:00Z",
>>>>>>          "effectiveEndDateTime":"9999-12-30T23:59:59Z",
>>>>>>          "transactionType":"DELETE",
>>>>>>          "details":[
>>>>>>             {
>>>>>>                "type":"PERMANENT",
>>>>>>                "cost":200.1200,
>>>>>>                "effective":true
>>>>>>             }
>>>>>>          ]
>>>>>>       }
>>>>>>    ]
>>>>>> }
>>>>>>
>>>>>> I am getting error "Message is invalid against schema" . My pubsub 
>>>>>> message is correct. Can someone guide me to fix my schema? 
>>>>>>
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Protocol Buffers" group.
>>>>>>
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>>> an email to [email protected].
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/protobuf/de950a92-ffe3-4796-b1c4-ba22f290d70an%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/protobuf/de950a92-ffe3-4796-b1c4-ba22f290d70an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Protocol Buffers" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>>
>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/protobuf/419ea2b1-64a4-4c4b-8561-2fba4e158db6n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/protobuf/419ea2b1-64a4-4c4b-8561-2fba4e158db6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/protobuf/92d9a6ab-0bf0-4560-b4b7-360134938f17n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/protobuf/92d9a6ab-0bf0-4560-b4b7-360134938f17n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/dd04d136-b1a8-471f-99de-51886628075cn%40googlegroups.com.

Reply via email to