Transform multiple rows into an array in one object through canonical transform


I have a type defined as

entity type TypeA schema name ‘ABCDE’ {
quantities: [double]
other fields…

The data I want to load to the quantities array is in the following csv format

quantity, index
1, 1
2, 2
4, 5

Can I just fetch the object for TypeA, add the quantity to the array, and then upsert it in the transform function?
Is it possible for two threads/workers to run the transform function at the same time and the array upserted by one thread/worker to be overwritten by another thread/worker?


transform function has to be so, no, you can’t fetch+append+and update

I assume there are more fields then quantity and index - e.g. typeA - in which case you need to map this source to a type that will eventually be an fkey child in TypeB (vs. embedded array as you have it here).


@db(compactType=true, datastore=‘cassandra’, partitionKeyField=‘typeA’, persistenceOrder=‘index’)
type Quantity  {
  typeA: TypeA
  index: int
  quantity: double

type TypeA {
  quantities: [Quantity] (typeA)