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?