As we saw in Chapter 2, tables and dictionaries stand as giants at the top of the
q datatype hierarchy. The language thus offers different types of join functions, which allow us to combine the tables, or dictionaries, into composite ones. Take, for example, combining two time series, such as a table with market orders and a table with limit orders, which are frequently provided by exchanges as two different data sets. The analysis, however, requires to have them both combined to form a model of price movements. We have to be equipped with the proper tools to be able to do such operations smoothly and efficiently.
7.1 COMMA OPERATOR
We have already covered the join operator
, – the comma. Let us recall how it works on lists:
Comma-join can be used to join tables as well. This type of join is very “vanilla” and puts restrictions on the tables to be joined. Let us illustrate the usage of unkeyed tables first. We define two tables of the same structure and join them with the comma operator:
Since both of the tables are of the same type, the type of the output table ...