cancel
Showing results for 
Search instead for 
Did you mean: 

Re: [personal kdb+] Help: explanation kdb-tick

TerryLynch
New Contributor II
That's a pretty recent change, the commit is detailed here by Charlie: https://github.com/KxSystems/kdb-tick/commit/afc67eda6dfbb2ca89322f702db23ee68c2c7be3#diff-2a42c560e...

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

Terry


3 REPLIES 3

dotsch
New Contributor
This is functional amend.

@[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 <robinguillaume.pro@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[x],: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

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/personal-kdbplus/de228c8e-f5ab-4dc4-bb97-c29682a02a0b%40googlegrou....

robinguillaume_
New Contributor
Thank you a lot for your time!

I will dive into it

Le mardi 26 novembre 2019 11:13:48 UTC+1, TerryLynch a écrit :
That's a pretty recent change, the commit is detailed here by Charlie: https://github.com/KxSystems/kdb-tick/commit/afc67eda6dfbb2ca89322f702db23ee68c2c7be3#diff-2a42c560e...

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

Terry


robinguillaume_
New Contributor
Thank you a lot!

It is very well explained.

Kind regards,

Guillaume

Le mardi 26 novembre 2019 12:36:19 UTC+1, András Dőtsch a écrit :
This is functional amend.

@[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[x],: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

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/personal-kdbplus/de228c8e-f5ab-4dc4-bb97-c29682a02a0b%40googlegrou....