Skip to content

Add the virtual-table capture pack - #1

Open
DI-Dexter wants to merge 1 commit into
DataIntellectTech:mainfrom
DI-Dexter:part1-virtual-table-capture-pack
Open

Add the virtual-table capture pack#1
DI-Dexter wants to merge 1 commit into
DataIntellectTech:mainfrom
DI-Dexter:part1-virtual-table-capture-pack

Conversation

@DI-Dexter

Copy link
Copy Markdown

A TorQ application overlay that captures data partitioned by date AND instrument, and serves it through kdb-x virtual tables. No RDB, no HDB, no sort process and no gateway: the writer writes where the readers read, and nothing moves at end of day.

The instrument becomes a directory rather than a column, so a selective lookup is a directory lookup instead of a scan. That needs no p# attribute, which means the live day is as fast as history and there is nothing to rebuild overnight.

Contents

code/wdb/vtwrite.q           writer overrides
code/processes/vtidb.q       the reader
code/processes/vtcompress.q  the weekend compression job
appconfig/                   process list, settings, compression tiers
testfiles/                   16 assertion tests + 9 evidence scripts
docs/                        architecture document and status report

Verification

./regress.sh    16 assertion tests, 16/16
./selftest.sh   end-to-end through the live stack, 7/7

Notes for review

  • appconfig/passwords/ is the stock TorQ demo :pass list, same as the Finance Starter Pack ships. No real credentials.
  • Requires kdb-x, not kdb+ 4.x — the reader binds mkP via use`kx.pq.t, and use is a kdb-x keyword.

A TorQ application overlay that captures data partitioned by date AND
instrument, and serves it through kdb-x virtual tables. No RDB, no HDB,
no sort process and no gateway: the writer writes where the readers read,
and nothing moves at end of day.

The instrument becomes a directory rather than a column, so a selective
lookup is a directory lookup instead of a scan. That needs no p# attribute,
which means the live day is as fast as history and there is nothing to
rebuild overnight.

Contents
  code/wdb/vtwrite.q          writer overrides (5 of them)
  code/processes/vtidb.q      the reader
  code/processes/vtcompress.q the weekend compression job
  appconfig/                  process list, settings, compression tiers
  testfiles/                  16 assertion tests + 9 evidence scripts
  docs/                       architecture document and status report

Verification
  ./regress.sh   16 assertion tests, 16/16
  ./selftest.sh  end-to-end through the live stack, 7/7
  Results checked against the same bytes in a stock kdb+ database:
  16 of 19 queries identical, 3 raise an error, none silently different.

Known limitation: a single virtual table cannot span both this format and
existing date-partitioned history, because the column list is taken from
the first directory only. Raised with KX; see section 10 of the doc.

Parts 2 (split capture stacks) and 3 (chained tickerplant) are not included.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@@ -0,0 +1,26 @@
discovery:pass
feed:pass
gateway:pass

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we need all of these in here given we only have a few processes

// them - on the reference partition (doc §7.3).
// set 0 to compress everything, as stock TorQ does

// the hdbstructure override that teaches compression to see this layout is NOT here, even

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is all this nonesense in the comments?
Can you compress these to something sensible.

@@ -0,0 +1,2 @@
table,minage,column,calgo,cblocksize,clevel
default,1,default,2,16,9

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is a test file we shouldn't have it in the main code base, it should be in a test directory somewhere

inputcsv:@[value;`inputcsv;.proc.getconfigfile["compressionconfig.csv"]];
hdbpath:@[value;`hdbpath;`:hdb];
maxage:@[value;`maxage;365];
dryrun:@[{[x] `dryrun in key .proc.params};::;0b];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems an odd way to do it. Should this not just be "`dryrun in key .proc.params"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants