.Q.bv[]
.Q.bv[`]
In partitioned DBs, construct the dictionary .Q.vp of table schemas for tables with missing partitions.
Optionally allow tables to be missing from partitions, by scanning partitions for missing tables and taking the
tables’ prototypes from the last partition. After loading/re-loading from the filesystem, invoke
.Q.bv[] to (re)populate .Q.vt/.Q.vp, which are used inside .Q.p1
during the partitioned select .Q.ps.
(Since V2.8 2012.01.20, modified V3.0 2012.01.26)
If your table exists at least in the latest partition (so there is a prototype for the schema), you could use .Q.bv[]
to create empty tables on the fly at run-time without having to create those empties on disk. .Q.bv[`]
(with argument) will use prototype from first partition instead of last. (Since V3.2 2014.08.22.)
Some admins prefer to see errors instead of auto-manufactured empties for missing data, which is why
.Q.bv is not the default behavior.
q)n:100
q)t:([]time:.z.T+til n;sym:n?`2;num:n)
q).Q.dpft[`:.;;`sym;`t]each 2010.01.01+til 5
`t`t`t`t`t
q)tt:t
q).Q.dpft[`:.;;`sym;`tt]last 2010.01.01+til 5
`tt
q)\l .
q)tt
+`sym`time`num!`tt
q)@[get;"select from tt";-2@]; / error
./2010.01.01/tt/sym: No such file or directory
q).Q.bv[]
q).Q.vp
tt| +`date`sym`time`num!(`date$();`sym$();`time$();`long$())
q)@[get;"select from tt";-2@]; / no error