Q1: shouldn’t this be enough when persisting data for 1 partition:
.Q.par[`:.;2010.02.02;quote] set .Q.en[`:.;t] where t is our quote’s data
Q2: If I select data from the hdb for a date, do some processing and then persist again, do I need to delete ‘date’?
t:select from quote where date=2010.02.02;
t:delete from t where bid<100;
.Q.dd[.Q.par[`:.;2010.02.02;quote];`] set .Q.en[`:.;``date _ t]
- .Q.par does not return a trailing
/. You need one so the table is set as a splayed table and not a flat file. You can do this using .Q.dd.
- Yes you need to delete the date column.
t:select from quote where date=2010.02.02;
t:delete date from delete from t where bid<100;
.Q.dd[;`] .Q.par[`:.;2010.02.03;`quote] set .Q.en[`:.] t
Behaviour with duplicate date columns is undefined and will lead to unexpected results:
q)`:HDB/2020.01.01/tab/ set ([] time:2#.z.p;date:2#.z.d;val:2 3)
`:HDB/2020.01.01/tab/
q)\l HDB
q)select from tab
date time val
--------------------------------------------
2025.10.15 2025.10.15D08:54:10.218114927 2
2025.10.15 2025.10.15D08:54:10.218114927 3
q)select from tab where date=2025.10.15
date time val
-------------
q)select from tab where date=2020.01.01
date time val
--------------------------------------------
2025.10.15 2025.10.15D08:54:10.218114927 2
2025.10.15 2025.10.15D08:54:10.218114927 3