You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/install.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@
5
5
* Logging: The module generates status and error logs. By default, it utilizes the KX Logging framework. If a custom logger is not provided via the configuration parameters, ensure the [KX logging](https://code.kx.com/kdb-x/modules/logging/overview.html) is installed and available in your [QPATH](https://code.kx.com/kdb-x/modules/module-framework/quickstart.html#search-path). You can install `logging` and `printf` by
Copy file name to clipboardExpand all lines: docs/reference.md
+68-12Lines changed: 68 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# NYSE TAQ Data Loader module
2
2
3
-
This module provides high-performance utilities for parsing [NYSE TAQ (Trade and Quote) PSV files](https://ftp.nyse.com/Historical%20Data%20Samples/DAILY%20TAQ/), performing data transformations, and persisting the results into a date-partitioned kdb+ database (aka. HDB).
3
+
This module provides high-performance utilities for parsing [NYSE TAQ (Trade and Quote) PSV files](https://ftp.nyse.com/Historical%20Data%20Samples/DAILY%20TAQ/), performing data transformations, and loading the results either into a date-partitioned kdb+ database (HDB) or directly into in-memory tables (RDB).
The resulting `trade` and `quote` tables are sorted by `time` and carry a grouped attribute on `sym`, matching the layout of a typical RDB. Unlike the HDB tables produced by `parseToDisk`, in-memory tables do not include a `date` column.
103
+
104
+
```q
105
+
/ Perform an as-of join (aj) between the in-memory trades and quotes
106
+
q)aj[`sym`time; select sym, time, price, size from trade where sym in `MSFT`GOOG`AMZN; select sym, time, bid, ask from quote]
Storing a full day of NYSE TAQ data in memory is RAM-intensive. The table below shows approximate memory requirements by `SIZE` parameter, measured against data from 2025.10.02.
117
+
118
+
|`SIZE`| Symbol Range (First Letter) | Memory need |
119
+
| --- | ---: | ---: |
120
+
|`small`| Z |~2 GB |
121
+
|`medium`| I |~14 GB |
122
+
|`large`| A-H |~79 GB |
123
+
|`full`| A-Z |~170 GB |
124
+
85
125
## Configuration Options
86
126
87
-
You can pass a dictionary as the fourth argument to `parseToDisk` to customize the ingestion process.
127
+
Both `parseToDisk` and `parseToMemory` accept an optional dictionary as their last argument to customize the ingestion process.
128
+
129
+
### Common parameters
130
+
131
+
| Key | Default | Description |
132
+
| --- | ---: | --- |
133
+
|`letters`|`"A-Z"`| Restricts ingestion to symbols whose first letter falls within the specified range (e.g., `"K-N"`). |
134
+
|`includetestsymbols`|`0b`| If `1b`, includes instruments flagged as test symbols in the `master` PSV. |
135
+
|`batchsize`|`10 000 000`| Number of rows processed per chunk. Set to `0` to read the entire file in one pass for faster throughput if RAM permits. |
136
+
|`logger`| logger created by `.logger.createLog[]` of the [KX log module](https://code.kx.com/kdb-x/modules/logging/overview.html)| Logger used for status updates during the ingestion process. |
137
+
138
+
### parseToDisk extra parameters
139
+
140
+
| Key | Default | Description |
141
+
| --- | ---: | --- |
142
+
|`compparam`|`([master: 0 0 0; trade: 0 0 0; quote: 0 0 0])`, i.e. no compression | Table-specific compression settings for [.z.zd](https://code.kx.com/q/ref/dotz/#zzd-compressionencryption-defaults). Example: `([master: 0 0 0; trade: 17 2 6; quote: 17 2 6])`. Pass a dictionary of dictionaries to specify column-level compression. |
143
+
|`linked`|`0b`| Set `1b` to add a linked column `master` to the `trade` and `quote` tables, linking via `sym` to the `master` table. |
144
+
145
+
### parseToMemory extra parameters
88
146
89
147
| Key | Default | Description |
90
148
| --- | ---: | --- |
91
-
|`letters`| "A-Z" | Restricts ingestion to symbols starting with specific letters (e.g., "K-N") |
92
-
|`includetestsymbols`| 0b | If `1b`, includes instruments flagged as test symbols in the `master` PSV. |
93
-
|`batchsize`| 10 000 000 | Number of rows processed in memory per chunk. Set to `0` to read the entire file at once for faster processing if RAM permits. |
94
-
|`compparam`|`3#0`, i.e. no compression | Compression settings for [.z.zd](https://code.kx.com/q/ref/dotz/#zzd-compressionencryption-defaults). Example: `(17;2;6)` for logical block size, algorithm, and level. You can also pass a dictionary if you would like to specify column-level compression |
95
-
|`logger`| logger created by `.logger.createLog[]` of the [KX log module](https://code.kx.com/kdb-x/modules/logging/overview.html)| A logger used for status updates during the long running process |
149
+
|`grouped`|`1b`| If `1b`, applies the grouped attribute to the `sym` column in the `trade` and `quote` tables. |
150
+
|`sortbytime`|`1b`| If `1b`, sorts `trade` and `quote` by `time` and applies the sorted attribute. |
151
+
96
152
97
153
## Performance Notes
98
154
99
-
***Multithreading**: The PSV parsing engine leverages multithreading. Ensure you start your ingestion process with the `-s` flag (e.g., `q -s 8`) to utilize available CPU cores.
100
-
***Memory Management**: If you encounter memory pressure, reduce the `batchSize` in the options dictionary. Conversely, increasing it (or setting it to `0`) will speed up the process.
155
+
***Multithreading**: The PSV parsing engine is multithreaded. Start your ingestion process with the `-s` flag (e.g., `q -s 8`) to make use of available CPU cores.
156
+
***Memory Management**: If you encounter memory pressure, reduce `batchsize` in the options dictionary. Conversely, increasing it (or setting it to `0`) will speed up the process.
0 commit comments