Originally .u.add would return the empty schema (0#v) but in order to preserve grouped attribute on sym column it now uses index/apply to ensure the attribute is maintained
@[t;sym;g#] will apply the `g attribute on t’s sym column. t can be a table (or dict) or the name of the table (or dict) as a sym or even file path sym to a (eg. splayed table) folder. For sym t the data is modified inplace and t is returned, otherwise the modified data is returned.
In this particular case this will return the table schema with sym having the `g attribute.
I’m currently deep diving in the code of kdb-tick and I have difficulties to understand one specific part of the code. Actually, is the last part I need to understand to clearly read kdb-tick.
Here is the code :
add:{
$[
(count w x)>i:w[x;;0]?.z.w;
.[`.u.w;(x;i;1);union;y];
w,:enlist(.z.w;y)
];
(x;
$[99=type v:value x;
sel[v]y;
@[0#v;sym;g#] / here is my problem
]
)
}
It will be very kind if anyone can give me a detailed explanation. Otherwise, resources will be fine.
I already understood it was about @ verb but I don
Originally .u.add would return the empty schema (0#v) but in order to preserve grouped attribute on sym column it now uses index/apply to ensure the attribute is maintained
@[t;sym;g#] will apply the `g attribute on t’s sym column. t can be a table (or dict) or the name of the table (or dict) as a sym or even file path sym to a (eg. splayed table) folder. For sym t the data is modified inplace and t is returned, otherwise the modified data is returned.
In this particular case this will return the table schema with sym having the `g attribute.
Regards,
András
Guillaume Robin <robingui…@gmail.com> ezt írta (id?pont: 2019. nov. 26., K 10:59):
Hi,
I’m currently deep diving in the code of kdb-tick and I have difficulties to understand one specific part of the code. Actually, is the last part I need to understand to clearly read kdb-tick.
Here is the code :
add:{
$[
(count w x)>i:w[x;;0]?.z.w;
.[`.u.w;(x;i;1);union;y];
w,:enlist(.z.w;y)
];
(x;
$[99=type v:value x;
sel[v]y;
@[0#v;sym;g#] / here is my problem
]
)
}
It will be very kind if anyone can give me a detailed explanation. Otherwise, resources will be fine.
I already understood it was about @ verb but I don