Skip to content

kdb+ 3.5 Release Notes

This page details the latest features and improvements released to kdb+ 3.5.

2023.11.21

New

  • removed the 255 byte limit from hsym, e.g.

    q)hsym`$263?" "
  • path length limit is now 4095 bytes, instead of 255

  • os errors are now truncated (indicated by '..') on the left to retain the more important tail, e.g.

    q)get`$":root/",(250#"path/"),"file"
    '..path/path/<snip>/path/file. OS reports: No such file or directory

2023.04.17

NUC (Not Upwardly Compatible)

Not backward compatible. Changes existing behavior.

  • added support for openssl 1.1.x

Fixes and improvements

  • on linux/mac, kdb+ could seg-fault if at least one TLS connection was present, and a new connection was assigned a socket descriptor above 1010.

2023.03.13

New

  • -p cmd line option (or \p system command) can now listen on a port within a specified range e.g.

    q)\p 80/85
    q)\p
    81
  • range of ports is inclusive & tried in a random order. A service name can be used instead of a port number. The existing option of using 0W to choose a free ephemeral port can be more efficient (where suitable).

  • range can be used in place of port number, when setting using existing rules e.g. for hostname

    q)\p myhost:2000/2010

    or for multithreaded port

    q)\p -2000/2010

2021.12.07

Fixes and improvements

  • select with a symbol literal under simple aggregate could seg-fault, e.g.

    q)select sum a*(`aaf=`aaf)|(`aaf=`aaf)|(`aaf=`aaf) by b from ([]a:1 2;b:3 4)

2021.04.26

Fixes and improvements

  • writes to compressed files did not retry when data was only partially written by the OS, leaving the file unreadable, present since v2.8

2021.03.25

New

  • on windows builds, tcp send and receive buffers are no longer set to fixed sizes allowing autotuning by the OS.

Fixes and improvements

  • an error response to a sync ipc request would leave the handle in a blocking mode, potentially stalling kdb+ until another message was received on that same handle.

2020.11.27

Fixes and improvements

  • mapped ragged splays would sometimes leak virtual memory, e.g. select from`:ragged/

2020.09.22

Fixes and improvements

  • http client would throw 'close if the content-length header was missing from the response, since v.35 2020.04.16.

  • fills on a vector with nulls longer than 2^31 could return incorrect result

  • enumerating a symbol vector with nulls longer than 2^31 could return incorrect result

  • ssl ipc and https could seg-fault under on demand

2020.05.04

Fixes and improvements

  • after an http client request, or under on demand licensing, \p 0 could close a handle other than the listening port,

    and hclose h could erroneously throw 'domain, since 3.5 2020.04.16.

2020.04.16

Fixes and improvements

  • select was leaking memory when passed a constraint of a boolean vector of an incorrect length. e.g.

    q)select from ([]())where 100000000#0b
  • kdb+ would enter an infinite loop when reading a response to an http request if the remote disconnected during the read.

  • http client was case-sensitive to http header field names. For ease of processing, all field names are now automatically converted to lowercase on reception. e.g.

    q)(`$":http://www.kx.com:80")"GET / HTTP/1.1\r\nHost: host:port\r\n\r\n"

2020.02.12

(windows only)

Fixes and improvements

  • set was erroneously testing for the presence of the cwd, and recreating it when missing, for a fully qualified windows path containing a disk designator. e.g.

    q)`:C:/parentdir/subdir/file set 0

2019.11.13

New

  • .z.ph now calls .h.val instead of value, to allow users to interpose their own evaluation code. .h.val defaults to value.

Fixes and improvements

  • to reduce the number of system calls with glibc 2.25, sorting no longer makes calls to getpid() to seed the random number generator.

  • grading functions, compositions and projections was erroneous. e.g.

    q)`s#({};{}) / sometimes threw s-fail
  • functional select could erroneously engage aggregation optimisations if an application was represented as a symbol list. e.g.

    q)f:count;t:([]1 0;2 3);(0 1!1 1)~?[t;();`x;(last;`f`x1)]
  • ljf was not filling from lhs for null rhs for sorted key on rhs. e.g.

    q)([]a:0 1;b:`x`z;c:0 0N)~([]a:0 1;b:`x`y;c:2 0N)ljf([a:`s#0 1]b:``z;c:0 0N)

2019.08.13

Fixes and improvements

  • serving process would print "'snd. OS reports: Broken pipe" in the event a client disconnected prior to handshake completion.

  • encountering 'params, 'locals, 'globals, 'limit and 'branch errors for lambdas could leak memory. e.g.

    q)do[5;@[value;"{[a;b;c;d;e;f;g;h;i]}";::];0N!.Q.w[]`used]

2019.05.15

Fixes and improvements

  • block append to enum domain files which have sort attr. e.g.

    q)(`:myenum set`s#`a`b)?`c / now throws 'no append to `s#enum domain: myenum
  • (`s#chars)ss char would return an invalid object, since kdb+3.1. e.g.

    q)1 2~(`s#"foo")ss"o"
  • .z.bm was passed the compressed message when a compressed but invalid message was deserialized.

  • windows only - if kdb+ was listening on the same port as the target process for hopen, and the target was not a local interface,

    it was random whether the target would be erroneously identified as self.

2019.03.07

Fixes and improvements

  • vs would seg fault if rhs was an atomic enum and the domain of the enum was not available. e.g.

    q)@[` vs;`missingenumname!0;"type"~]
  • deserializer was not validating that booleans were either 0 or 1. e.g.

    q)@[-9!;@[-8!2#1b;14;:;0x2];"badmsg"~]&@[-9!;@[-8!1b;09;:;0x2];"badmsg"~]
  • group was throwing 'rank for a table of a single column of conforming dicts (a table column). e.g.

    q)(([]a:(`a`b!1 2;`a`b!3 4))!(1#0;1#1))~group([]a:(`a`b!1 2;`a`b!3 4))

2019.02.19

Fixes and improvements

  • 0: was throwing type if given a delimiter of "\000". e.g.

    q(`a`A;`b`B)~("SS";"\000")0:("a\000b";"A\000B")
  • string was not treating \000 the same as other chars. e.g.

    q){string[x]~enlist each x}"a\000b"

2019.01.31

New

  • remote connections using the "qcon" text protocol are now routed to .z.pq, which defaults to calling .z.pi.

    This allows a user to handle remote qcon connections (via .z.pq) without defining special handling for console processing (via .z.pi).
    see https://code.kx.com/q/cookbook/firewalling for locking down message handlers.

Fixes and improvements

  • under some circumstances, \d was throwing random error text for an invalid namespace.

2018.12.06

Fixes and improvements

  • fby was throwing the value of length rather than the symbol`length on error.

  • writing to files which reside on nfs might not report an i/o error.

  • fix lower for char arrays longer than 2B and speedup lowering symbols. e.g.

    q)not{x~lower x}(1+0Wi)#.Q.A
  • the symbols in the value of the result of-26! might not have been interned. e.g.

    q){x~`$string x}'[(-26!)[]]
  • indexing a splay at depth was leaking memory. e.g.

    q)`:t/ set([]0 1);get[`:t/][0 1;`x];.Q.w[]`mmap

2018.10.03

Fixes and improvements

  • https responses could be incomplete. e.g.

    q).z.ph:{.h.hy[`json;.j.j 100000000?.Q.a]}  / q started with q -E 1 -p 5000
    $curl -k https://localhost:5000
  • sorting a vector of longs which contained a 0N and an overall range <9e15 was incorrect. asc would throw 's-fail, iasc would return an incorrect permutation. e.g.

    q)asc -1+0W+3 9000000000000000 1
  • each/eachright/eachleft could segfault when interrupted on splay or operating on malformed splays. e.g.

    q)t:get`:notab/ set([]a:1 2 3;b:5 6 7);hdel`:notab/b;@[t,\:;enlist`a`b!3 4;{1b}]

2018.09.18

Fixes and improvements

  • listening on explicit addresses on multihomed hosts was not routing connections to the listening port correctly. e.g.

    q)\p 192.168.0.1:5000

2018.08.24

Fixes and improvements

  • opening a tls connection would report errors regarding certificate loading/initialization only on the first connect attempt. e.g.

    q).Q.hg `$"https://www.google.com"
  • allow system"tshark"; was confused by system"ts..." for timing execution.

  • kdb+ could seg fault when trying to select random rows from a missing partitioned or splayed table. e.g.

    q)any("pn";"missingtable")~\:@[2?;flip`a`b!`missingtable;::]

2018.05.20

Fixes and improvements

  • with env var QUDSPATH="", q was unable to listen on a port, since 2018.04.25. e.g.

    $QUDSPATH="" q -p 5000

2018.04.25

Fixes and improvements

  • atom@guid was throwing 'type but was not trappable. e.g.

    q).[@;(();0Ng);::]
  • get httpurl was seg faulting, currently nyi. Use .Q.hg instead.

  • dirsymbol@handle was not recognizing \ for windows path. e.g.

    q)(`$":c:\\q")`file
  • adjusting slave count to 0 was possible from a handle other than 0. e.g.

    q)h"\\s 0" / setting of remote
  • now checks that handles returned from .z.pd are ipc handles.

  • allow hopen`:unix:// with env var QUDSPATH="".

  • "B"$ was erroneously processing char value 0 as 1b. Only "1tTyYxX" are 1b. e.g.

    q)0b~"B"$"c"$0

2018.02.26

Fixes and improvements

  • tightened the verification that .Q.k==.z.K, to avoid mismatching q.k with the wrong q binary.

  • enumerating a null atom cleared the enum domain, since 3.5 2017.09.25. e.g.

    q)s:`a`b`c;`sym?`;`a`b`c~s
  • language hook mechanism was seg faulting if language did not define .x.e where x is the language. e.g.

    q)system"touch f.k";system"f)1"

2018.02.20

Fixes and improvements

  • hcount`:dir was reporting an unrelated error string on unix, since 3.4t 2015.09.25.

  • avg for char vector could seg fault if the vector contained a null. e.g.

    q)81.5~avg 7500000#"abc "

2018.02.09

Fixes and improvements

  • appending to a sym file was rewriting the file on each append, since v3.0. e.g.

    q)`:file set 0#`;system"t do[10000;`:file upsert `a`b]"
  • peach x would spin cpu or seg fault if x had more than ~2 billion elements

  • windows only - for a background process, a repl error triggered a continuous printing of the prompt

2018.02.07

Fixes and improvements

  • allow parsing of GUIDs wrapped in {}, a.k.a. Microsoft style GUIDs. e.g.

    {(~)."G"$/:(x;"{",x,"}")}"aaaef973-d8ce-4c92-95b4-3635bb2d42d5"
  • kod licensed usage could seg fault if dns response was slow.

  • avg was not ignoring nulls wrt count for dictionaries. e.g.

    q)all 1.5=first each avg each(1 0N 2;`a`b`c!1 0N 2;([]1 0N 2);([`a`b`c]1 0N 2))

2017.11.30

Fixes and improvements

  • reception of badly formed response messages was leaking memory.

  • ipc messages with an invalid header length field of <8 bytes was corrupting memory resulting in a seg fault. Now throws 'badMsg.

  • json serializer was not generating correct json for control chars. e.g.

    q)"\"one\\u0013\""~.j.j "one\023"
  • listening on 0.0.0.0 was not listening on any interface, other than the unix domain socket, twice. e.g.

    q)\p 0.0.0.0:5010

2017.11.08

Fixes and improvements

  • invalid (.e.g non-unique or partial) enum domains could cause a seg fault with grouped selects. e.g.

    q)sym:`a`b;0!select by x,x1 from([]`sym!2 0N 2 0N;til 4;til 4)

2017.10.11

Fixes and improvements

  • sort performance was poor for some distributions, with potential to seg fault, since 3.5t 2017.02.03. e.g.

    q)f:{asc(2*x)#((floor x%7)#0),"j"$1e11*til x};value each "\\t f ",/:string 100000*1+til 5

2017.10.05

Fixes and improvements

  • rollback mismatch error from last release 2017.10.04, since it broke valid joins. e.g.

    q)d:`a`b`c!(([]a:0 1);([]b:2 3);([]c:4 5));d,'`a`b#d

2017.10.04

Fixes and improvements

  • catenate was not throwing 'mismatch for t,t1 when t or t1 was empty and columns were not common. e.g.

    q)([]a:0#0),([]a:1#0;b:1#`)
  • char vector like enlist"*" was throwing 'type since 2017.09.25. e.g.

    q)"abc"like enlist"*"
  • flip could create a table with zero columns which could cause a seg fault later. Now throws 'rank. e.g.

    q)@[flip;(0#`)!([]());"rank"~]
  • upsert to a splayed table required columns to be the same as on disk. e.g.

    q)(`:t/t/ set([]a:0 1;b:"ab"))upsert([]b:"cd";a:2 3) / was throwing 'mismatch
  • kdb+ would seg fault when printing to console if on startup the environment variables LINES or COLUMNS was set to "".

2017.09.25

Fixes and improvements

  • on windows only, hopen with timeout could be erroneous if there was a TLS connection active.

  • creating a new enumeration target with a null atom was creating an untyped list instead of a symbol vector. .e.g.

    q)`x?`;(0#`)~x
  • like was not returning matches for enumerations containing null for "*" match. e.g.

    q)(0001b;1111b)~(`sym?`a`b`c`)like/:("";enlist"*")
  • an error thrown from a function during multi-arg (>2 args) scan or each could leak memory. e.g.

    q){$[x>2;'`e;x+y+z]}\[0;til 5;til 5]
    q){$[x>2;'`e;x+y+z]}'[til 5;til 5;til 5]

2017.09.07

(windows only)

Fixes and improvements

  • on windows only, if kdb+ opened or accepted >64 connections and at least one of them used TLS, it could seg fault.

2017.09.06

Fixes and improvements

  • min/max on small vectors with a `p attribute could be erroneous, since v3.5 2017.05.02. e.g.

    q)(~).(min;max)@\:/:{(`p#x;x)}"45"

2017.09.01

Fixes and improvements

  • receiving an https POST could have thrown 'rcv error and closed the connection.

2017.08.22

Fixes and improvements

  • hopen for unix domain sockets was erroneously connecting the badly formatted `:unix://:4444 (should be `:unix://4444) through handle 0.

  • hopen without using a hostname was not setting Server_Name_Indication for tls correctly. e.g.

    q)hopen`:tcps://:4444 / implicit localhost
  • hopen with timeout was not working for tls connections (windows client only). e.g.

    q)hopen(`:tcps://localhost:4444;2000) / if server busy, immediately threw 'hop. OS reports: A blocking operation is currently executing.
  • pad was seg faulting if given 0W as input. Now throws 'limit. e.g.

    q)"limit"~@[0W$;();::]
  • more strict parsing of ip addresses. e.g.

    q)0Ni~"I"$"127.a.b.1"
  • creating a boolean through the c-api kb(I) function was storing input as given. Now it stores 0|1.

  • 0N#dict was not throwing 'type for some inputs. e.g.

    q)"type"~@[0N#;0 1!0 1;{x}]

2017.08.04

Fixes and improvements

  • memory usage tally for used and mmap was incorrect when peach returned data which was mapped from disk, or larger than 32MB with -g 1 cmd line.

  • reassigning a view during its calculation could result in a seg fault. e.g.

    q)a::@[value;`.a;a:1 2 3]
  • improved performance of pattern select ... by sym from t where sym in ... with p or g attr on sym and few rows per distinct sym. e.g.

    q)`:t/ set([]x:`p#til 10000000;y:10000000?0xff);z:-20?get`:t/x;system"ts select max y by x from get`:t where x in z"
  • socket broadcast, -25!(handles;msg) was leaking a ref count on (::) which would cause a random seg fault later. e.g.

    q)-25!(handles;msg);-16!(::)
  • rolled back change from 2017.05.30 regarding % with dict with uncommon keys. Currently the op is applied to common keys only.

2017.07.19

Fixes and improvements

  • compressed messages were not length limit checked for older clients (c.o, or kdb+ prior to v3.4), causing the client to seg fault.

  • debug caret was printing at the wrong location if tabs were present. e.g.

    q)f:value"{{\t\t\t\t\t\t\"some very long and irrelevant code\"};1+`a}";f[]

2017.06.19

updated

Fixes and improvements

  • raze of a dictionary could throw 'type error when the value of the result is a mixed list. e.g.

    q)d:(enlist 0)!enlist 0;e:1 2!`a`b;(0 1 2!(0;`a;`b))~raze(d;d;d;e)

2017.06.15

Fixes and improvements

  • kdb+ is not yet compatible with openssl 1.1.x due to openssl breaking their binary api; kdb+ seg faulted if openssl 1.1.x was loaded.

    Now, if openssl 1.1.x is detected, it is ignored.
  • the debug caret was showing wrong location for <=. e.g.

    q){"some very long irrelevant code";`a<=1}[]
  • was leaking memory for failed column amend, since v2.x. e.g.

    q)t:([]1 2 3);@[t;`x;+;"a"]
  • .j.j was not escaping symbols as it was char vectors. e.g.

    q)(2#enlist x)~.j.k .j.j(`$;::)@\:x:"A\\B"

2017.05.30

Fixes and improvements

  • % with dict with uncommon keys was erroneously using identities for those keys. e.g.

    q)(`a`b`c!0n 3 0n)~(`a`b!15 12)%`b`c!4 3
  • q debugger could report line numbers that are past the end of the file.

  • re-allow attr to be set on mapped nested data. e.g.

    t)`g~attr`g#get`:x set("ab";"cd") / was throwing type

2017.05.02

New

  • extended SSL/TLS client to support SNI - see https://en.wikipedia.org/wiki/Server_Name_Indication.

  • slaves can be adjusted at runtime, if the cmd line -s arg is set. That becomes the maximum for the process lifetime. e.g.

    q)0N!("current slave threads";system"s");system"s 4";0N!("current,max slave threads";system"s";system"s 0N"); / q -s 8
    q)system"s 0" / disable slave threads
    q)system"s 0N" / show max slave threads

Fixes and improvements

  • saving to csv could seg fault if passed a dictionary which was not a keyed table, since 3.5t 2016.09.20. e.g.

    q)csv 0:`a`b!10b / should throw 'type
  • loading shared libraries (e.g. qml) on unix platforms could cause a seg fault if the code was using _IO_stdin.

  • on windows, hopen with timeout would always throw timeout if the connection was not accepted. e.g.

    q)hopen(`::4444;5000) / if nothing listening on 4444 'timeout after 5 seconds
  • check lengths of dictionary result from indexing, as different lengths can cause a seg fault later. e.g.

    q)@[([b:0 1]a:0 1).;(::;`c);{"length"~x}]
  • optimized min/max on mapped vectors with a g or p attr. e.g.

    q)a:get`:v set b:`g#10000000?10;system each("ts min a";"ts min b")
  • select avg x by y from t was incorrect for nested x since v3.4 2016.11.18. e.g

    q)([a:`a`b]b:enlist each 4 5.)~select avg b by a from([]a:10#`a`b;b:1 cut til 10)
  • hsym was returning type 0 list when passed an empty symbol list. e.g.

    q)11 -11 11 11h~type each hsym each(0#`;`;`a`b;())

2017.04.10

Fixes and improvements

  • errors which did not cause debugger interaction were not propagated further, since v3.5 2017.04.06. e.g.

    q){`x set x}peach 0 1 / with slave threads, should throw 'noupdate
    q).Q.trp[{x+1;2+2};"asd";{1@.Q.sbt y}] / x+1 should throw 'type

2017.04.06

NUC (Not Upwardly Compatible)

Not backward compatible. Changes existing behavior.

  • linux unix domain socket (uds) connection paths had trailing nulls in the path, making them incompatible with some system tools.

    As a result this release will not accept connections from previous releases via uds on linux.

Fixes and improvements

  • : with an optional value can now be used in the debugger to continue execution. e.g.

    q){answer}[]
    'answer
      [1]  {answer}
           ^
    q)):42
  • hdel was not unlinking a symbolic link if the target pointed to a directory. e.g.

    q)system"ln -s /tmp tmplink";hdel`:tmplink

2017.03.28

Fixes and improvements

  • distinct on a vector of longs with more than 2 billion uniques was causing wsfull|seg fault. e.g.

    q)distinct til prd 31#2
  • .z.W was reporting incorrect info for websocket handles since 3.5t 2017.02.28,

    and for ipc handles, it did not take into account coalesced msgs nor already partially sent data.

2017.03.27

Fixes and improvements

  • hopen with timeout was always throwing timeout for values>10737418. e.g.

    q)hopen(`:localhost:5000;10737419) / immediately threw 'timeout
  • evaluating an invalid view remotely was seg faulting. e.g.

    q)system each("q -p 15123";"sleep 1");hopen[15123]each("v::select from t";`v) / child process seg faulted

2017.03.17

(windows only)

Fixes and improvements

  • handles were inherited by child process which were not started via "q ...". e.g.

    q)\start cmd /c "q -p 6001" / parent's port could not be reused until child exited
  • windows builds could lock up spinning cpu during peach with slave threads. e.g.

    q){0 1}peach 0 1 / with -s 2 cmd line
  • hopen again checks symbol is a path. Was not checking since kdb+3.4 2016.05.31. e.g.

    q)hopen`file / throws 'type

2017.03.15

First production release of kdb+ 3.5.

Fixes and improvements

  • removed t from version number in startup banner.

2017.03.03

New

  • wsfull error now prints additional diagnostic info for assisting kx tech support.

Fixes and improvements

  • value strips out bytecode, constants for locked fns.

  • .Q.pbt renamed to .Q.sbt.

  • select[<c] .. by ... could leak memory when <c failed. e.g.

    q)select[>c] by a from ([]a:0 1;b:0 1)

2017.03.01

Fixes and improvements

  • select ... by time.minute could seg fault or wsful if time was sorted and of type datetime, timestamp or timespan. e.g.

    q)select by time.minute from([]time:`s#2#.z.p)

2017.02.28

New

  • now checks validity of compressed ipc messages, calls .z.bm[0Ni;msg] when compressed message is found to be invalid.

Fixes and improvements

  • caret position for error report was incorrect for ,:. e.g.

    q)a:1b;a,:1b
  • error report for lines outside lambdas loaded with \l now have file:line.

  • hopen with timeout could erroneously report timeout since 3.5t 2017.02.16.

  • multiple queued websocket messages were not being written correctly since 3.5t 2016.10.28.

  • async broadcast -25!(handles;data) did not check if any handle was a websocket.

2017.02.16

New

  • the json serializer .j.j now serializes (::) to "null". e.g.

    q)"null"~.j.j(::)
  • exposed K ee(K) in c-api. Use this to wrap api calls to capture (and reset) error string into usual error object. e.g.

    K x=ee(dot(a,b));if(xt==-128)printf("error %s\n",x->s);

Fixes and improvements

  • updating a file in place was leaking a ref count. e.g.

    q)`:a set 10#0b;@[`:a;2 3;:;11b];-16!(::)
  • update could leak a ref count for (::) if target type did not match. e.g.

    q)@[value;"update raze a from([]a:enlist enlist[`a]!enlist 0)";{}];-16!(::)
  • ipc msg validation could seg fault under some rare scenarios if given a malformed msg with incorrectly large length fields.

    q)@[-9!;@[-8!(0#0;1#0);15+til 12;:;0x806653b07bf67d07186f53b0];{"badmsg"~x}] / was seg faulting

2017.02.11

Fixes and improvements

  • some parse trees could incorrectly be assigned a sort attribute via .Q.ps causing s-fail (e.g. with deach). 3.5t only.

  • parsing select[] ... leaked memory. 3.5t only. e.g.

    q)-5!"select[m] a by b from t where c";.Q.w[]`used
  • ipc msg validation could seg fault under some rare scenarios if given a malformed msg.

  • fby takes 3 args, a function and two vectors which must be of equal length; it now throws 'length if these are not equal.

    q).[fby;((count distinct@;0 1);`a`a`b`b`b);{"length"~x}]
  • websocket client was sensitive to the case of the response headers sec-websocket-accept and sec-websocket-extensions.

2017.02.03

New

  • improved sort performance of certain distributions, typically those including a null. e.g.

    q)a:@[10000001?100000;0;:;0N];system"t iasc a" / 5x faster

Fixes and improvements

  • loading a vector of symbols, or a mixed list, with a u,p,g attr could seg fault, since 2017.01.27. e.g.

    q)`:a set`u#`A`B`C`D`E;`:a?`V`W`X`Y`Z;(`a$`a`b`c`d`e)~`:a?`a`b`c`d`e
  • -25!(h;::) was not flushing the internal send buffers for each handle in h.

  • http get did not allow for a result with a specified content-length > 2GB. e.g.

    q).Q.hg`$"http://data.sdss3.org/sas/dr12/sdss/spectro/redux/specObj-dr12.fits"

2017.01.27

Fixes and improvements

  • json serializer (.j.j) did not wrap keys in quotes for some types. e.g.

    q)(`0`1!0 2f)~.j.k .j.j 0 1!0 2
  • desc sort of a char vector was relatively much (~50x) slower than asc. e.g.

    q)a:10000000?`char$97+til 26;system each("t asc a";"t desc a")
  • removing an attribute was removing the attribute on the referenced input, since 3.5t 2017.01.18. e.g.

    q)v:`u#`a`b`c;`#v;`u=attr v
  • upsert was seg faulting when appending a table to an empty list which had a g attr. e.g.

    q)a:`g#();a,:([]1 2)
  • setting an s attr on a vector which had a g attr and no other references was leaking memory, or removing the g attr on the original. e.g.

    q)`s#`g#til 1000 / leaked mem
    q)v:`g#`a`b;`s#v!1 2;`g~attr v / dropped g attr

2017.01.18

New

  • functions are assigned names upon the first assignment to a global. Internal lambdas inherit the name with '@' appended.

  • the debugger goes up to the first frame from outside q.k on error. q.k code is hidden in stack trace printouts.

  • peach returns the result w/o serialization (performance improvement for large result sets). e.g.

    q)\t {20#enlist 1000000#0}peach til 2
  • peach collects stack trace on error.

Fixes and improvements

  • throwing an empty error with (') from the debugger could lead to a seg fault.

  • debugger could fail with noamend or noupdate. e.g.

    q)a:1 2 3;@[`a;0;{y;asd};1]
  • restriction on amending global `g# has been lifted. e.g.

    q)a:`g#1 2 3;{x,:1}peach 2#enlist a
  • raze (,/) could corrupt memory resulting in a later seg fault when passed a mixed list which contained a table. e.g.

    q)\ts:100 raze a:(0;([]a:0#0);([]b:0#()))
  • q.k - trimmed unnecessary .Q. prefix for .Q.Xf,.Q.Cf.

  • errors thrown by .z.ph,.z.pp and .z.pm now result in a well-formed http 500 response. e.g.

    q)system"p 14999";.z.ph:{'`error} / curl -i --raw "http://127.0.0.1:14999"
  • saving tables with >2^32 rows to a single file is now blocked since the file format's sizes are still 32bit. e.g.

    q)`:file set([]a:1+prd 32#2)#"a")
    throws "The file size exceeds the limit allowed and cannot be saved"|"Value too large to be stored in data type".
  • hopen port now checks that port is within 0..65535. e.g.

    q)hopen 0N / domain error
  • HIJ wavg E and B wsum J were not ignoring nulls, producing incorrect results in some cases. e.g.

    q)3 3 3f~wavg[;1 2 3 4e]each "hie"$\:0N 1 1 1
    q)2 2~{(wsum[x;y];wsum[y;x])}[1010b;0N 1 2 3]
    q)3 3 3f~wavg[;1 2 0N 4e]each "hie"$\:0N 1 1 1
  • assigning to multiple columns of a table with initial column of rank > those being assigned was failing with 'length. e.g.

    q)t:([]c:3 2#10*1+til 6;a:3#0;b:3#0);t[;`a`b]:t[;`c];([]c:(10 20;30 40;50 60);a:10 30 50;b:20 40 60)~t
  • was seg faulting if a function which had selected from a partitioned table threw an error. e.g.

    q)`:./dbtest/1/t/ set([] b:0 1);system"l dbtest";{select from t;'`e}[]
  • processing an http post with incorrect Content-length field could cause a seg fault. e.g.

    q)system"\p 14999";.z.pp:{0N!x 0} / server process
    q)`:http://127.0.0.1:14999"POST / HTTP/1.0\r\nContent-length: 150\r\n\r\n",251?.Q.a / client process
  • allow case to work with I type. e.g.

    q)1 20 100~0 1 2i'[1 2 3;10 20 30;100]
  • q.k - med across partitions was throwing 'rank. Now it throw's 'part to indicate med does not work across partitions. e.g.

    q)select med a from t
  • q.k - .z.ph now returns HTTP/1.1 400 Bad Request response for uncached paging request. e.g.

    curl -i --raw "http://127.0.0.1:5000/?\[=1"
  • updating mappable files in situ was adjusting memory usage tally incorrectly, since v3.4 2016.02.02. e.g.

    q){a:.Q.w[]`mmap;`:file set til 10;@[`:file;2 4 6;:;10 20 30];hdel`:file;a~.Q.w[]`mmap}[]
  • allow drop to accept rhs int. e.g.

    q)"ac"~"abc" _ 1i
  • symbol visibility of q binary was too strict, hiding the c-api sw0 and sw1 functions. Since 3.5t 2016.11.03

  • dlopen was loading libsnappy,openssl and zlib with RTLD_GLOBAL flag.

  • keyedTable%atom was throwing 'nyi since v3.4 2016.09.26. e.g.

    q)([a:`a`b`c]b:0 .1 .2)~([a:`a`b`c]b:til 3)%10

2016.12.19

New

  • extended key value parsing to allow delimiters in string values. e.g.

    q)enlist["hello,world"]~last"I=*,"0:"0=\"hello,world\""

Fixes and improvements

  • x in Y was throwing type error when Y was length 1 and different type to x. It should have behaved as x in first Y. e.g.

    q)(~). 1 2 3h in/:(enlist;::)@\:1
  • key value parsing returned J even if I was specified, since v3.0. e.g.

    q)6h=type first "I=,"0:"1=val,2=val"

2016.12.14

New

  • "F"$"inf" and variations were not supported on windows. e.g.

    q)(4 3#0w 0w -0w)~"F"$" +-",\:/:("inf";"infinity";"INF";"INFINITY")

Fixes and improvements

  • q.k - .Q.fc was returning additional empties when count[rhs]<number of slave threads, since v3.3 2015.02.12. e.g.

    q).Q.fc[0N!]til 3; / start with q -s 4
  • triadic (and above) scan leaked memory when its result is empty, since v1.0. e.g.

    q){0N!.Q.w[]`used;value x;0N!.Q.w[]`used;}"{x+y+z}\\[0 1;();()]"
  • improved performance of bin/find/distinct/joins for large inputs, particularly for multi-column input. e.g.

    q)nn:166*n:600000;v1:50?v2:neg[100]?`2;t1:`c1`c2`c3#n?t2:([]c1:`g#nn?v1;c2:nn?v1;c3:nn?v2;val:nn?100);system"ts t1 lj 3!t2"
    q)a:-1234567890 123456789,100000?10;b:1000?a;system each("ts:100 distinct a";"ts:1000 a?b")
  • q.k - removed ema,reval,scov,sdev and svar from .Q.res, since .Q.res contains k control words and verbs defined as symbols.

    q).Q.res,key`.q / full list of reserved words
  • improved performance of within as first constraint in a where clause. e.g.

    q)n:4000000;a:`s#til n;b:n?100;system"ts:10 exec sum b from([]a;b)where a within 1 3999999"
  • select from t where x in y was slow for large x with g attr, and small y, since v3.4 2016.03.29. e.g.

    q)t:([]`g#6000000?500000i);system"ts select from t where x in enlist 5i"
  • .Q.gc[] leaked 16 bytes on each invocation when slave threads are in use. e.g.

    q).Q.gc[];0N!.Q.w[]`used;do[100;.Q.gc[]];0N!.Q.w[]`used;

2016.11.18

New

  • use SO_REUSEPORT(osx,linux)/SO_REUSEADDR(win) if port prefix is "rp," for \p system command, or -p cmd line arg. e.g.

    q)\p rp,5000

NUC (Not Upwardly Compatible)

Not backward compatible. Changes existing behavior.

  • added ujf which mimics the behaviour of uj from v2.x, i.e. that it fills from lhs. e.g.

    q)([a:1 2 3]b:2 3 7;c:10 20 30;d:"WEC")~([a:1 2]b:2 3;c:5 7;d:"WE")ujf([a:1 2 3]b:2 3 7;c:10 20 30;d:"  C")

Fixes and improvements

  • extend where to accept I in addition to J. e.g.

    q)1 2 2~where 0 1 2i
  • extend = to work with types above 99h; previously threw 'type. e.g.

    q)all{x=x}each({};neg;(+);(\);1+;1+2+;{}';{}/;{}\;{}':;{}/:;{}\:)
  • avg could overflow during select avg x by group for 32bit int type, since v3.3 2015.04.13. e.g.

    q)([y:1#0]x:1#1000000.)~select avg x by y from([]1000000#1000000i;y:1000000#0)
  • errors resulting from unreadable compressed files now include the filename.

  • symbol visibility of q binary was too strict, hiding the c-api m9 and ku functions. Since 3.5t 2016.11.03

  • allow "P"$ to parse date only with delimiters "./ -", same as "Z"$.

    q)enlist[2012.12.31]~distinct raze"d"$"PZ"$\:/:@["2012 12 31";4 7;:;]@/:"./ -"
  • if listen on a unix domain socket fails, it now throws a more explicit error msg:

    "'cannot listen on uds /tmp/kx.9000. OS reports: Address already in use"
  • allow user to disable listening on unix domain socket, or change default path from /tmp using env var QUDSPATH. e.g.

    q)system"p 0";setenv[`QUDSPATH;""];system"p 6000" / disables listening on unix domain socket
    q)system"p 0";setenv[`QUDSPATH;"/home/kdbuser"];system"p 6000" / use /home/kdbuser as path

2016.11.03

Fixes and improvements

  • reduced symbol visibility in binary to avoid clashes with other dynamically loaded code.

  • fixed random seg fault which came in with first release of v3.5t.

  • json parser is now RFC7159 compliant, in that it allows values at root, outside of [] and {}. e.g.

    q).j.k each ("true";"false";"null";"12";"12.3";"\"hello\"")
  • json parser requires a digit after a . for a floating point number. e.g.

    q).j.k "12." // is an error
  • remove unix domain file in /tmp/kx.[0-9]+ on seg fault.

2016.10.28

New

  • \e 2 dumps stack to http/qcon.

  • minimize number of OS send calls when sending many queued async msgs. e.g.

    q)v:1024#0x0;do[1000;neg[h](::;v)];s:.z.p;neg[h](::);0N!.z.p-s

Fixes and improvements

  • .Q.trp keeps the innermost stackframe when it has value or throw. e.g.

    q)s~.Q.trp[.:;s:"1 2+3 4 5";{y[0;1;2]}]
  • throw('), return(:), if/do/while now have dbg location information.

  • k code in .q files now stores file/line information.

  • assign could generate incorrect bytecode leading to 'branch or wrong results. e.g.

    q)4~{x:x+x}[2]
  • leading whitespace in lambda could result in incorrect location info.

  • http requests could cause memory corruption when .z.ph is not defined.

  • check type of arg to value. e.g.

    q)value 1 / now throws 'type
  • stack overflow ('stack) leaked memory. e.g.

    q)@[value;"x:`x@;x`";{(.Q.w[]`used)}]
  • q.k - the sum in wavg was not ignoring nulls during map/reduce for a partitioned table. e.g.

    q)t:([]1 2 0N 0N);.Q.dpft[`:hdb;;`x;`t]each .z.d-til 2;system"l hdb";
    q)(exec distinct x from select avg x by date from t)~exec x from select 1 wavg x from t
  • updating mappable files in-place was erroneously blocked for boolean vectors. e.g.

    q)`:a set 10#0b;@[`:a;2 3;:;11b];get[`:a]~@[10#0b;2 3;:;11b]

2016.10.03

New

  • \e 2 dumps stack to stderr for untrapped errors during request from a remote.

Fixes and improvements

  • keep leading whitespace in function text. e.g.

    q)x~string value x:"{ /hello\n x}"
  • \l tries $QHOME for loading files; it skipped QHOME since initial release of 3.5t.

  • amend (e.g. x[y]+:z) now has location information in functions.

  • debug and error messages are output to stderr instead of stdout.

  • neg[i]!x now throws 'domain rather than 'type for i outside of domain. e.g.

    q)-2500!0
  • debugger could seg fault if an error were thrown in suspended mode whilst traversing up the stack.

  • check for exceeding limit on take/reshape. e.g.

    q)all(@[2 2 0W#;0;{"limit"~x}];@[2 0W 3#;0;{"limit"~x}];@[0W 2 3#;0;{"limit"~x}];@[10 0W#;1;{"limit"~x}])
    q)@[(2#ceiling 2 xexp 32)#;0;{"limit"~x}] / was infinite loop

2016.09.26

Fixes and improvements

  • now checks .Q.k is at least v3.5 in q.k.

2016.09.23

  • 0b vs x was creating vectors which were unnecessarly long for x where x was not its underlying type. e.g.

    q)(0b vs "a";0b vs 0t)

2016.09.21

Fixes and improvements

  • J div j and F%f had precision errors. e.g.

    q)all(enlist[30]~(1#3000000000000)div 100000000000;enlist[0f]~-30+enlist[3000000000000.]%100000000000.)
  • divide on temporal types was not returning float. e.g.

    q){(1#x;x)}[0.00010230141846745273]~{((1#x)%y;x%y)}[2016.09.21;16:35:05.917]

2016.09.20

NUC (Not Upwardly Compatible)

Not backward compatible. Changes existing behavior.

  • constants limit in lambdas reduced from 96 to 95. e.g.

    q)value raze"{",(string[10+til 96],\:";"),"}"
  • now uses abstract namespace for unix domain sockets on linux to avoid file permission issues in /tmp.

  • N.B. hence 3.5 cannot connect to 3.4 using uds. e.g.

    q)hopen`:unix://5000
  • comments no longer stripped from the function text by the tokenizer (-4!x); they can be stripped explicitly from the -4! result with

    q){x where not(1<count each x)&x[;0]in" \t\n"} -4!"{2+ 3; /comment\n3\n\t/ another comment\n \n/yet another\n /and one more\n}"

New

  • print location information with the error

  • functions now store definition's file/line

  • debugger commands:

    `     browse the stack frame above
    .     browse the stack frame below
    'str  throw str from the innermost stack frame
    .z.ex .z.ey  (set in the debugger) the failing primitive and its arglist, if available
  • .Q.bt[] print current stack trace (list of stack frames)

  • .Q.pbt[x] format a stack trace x

  • .Q.trp[f;x;g] like @(trap), but g's second argument is a stack trace: g[error symbol;stack trace]

  • (types;enlist delimiter)0:filename now creates missing column names, renaming collisions. e.g.

    q)`a`b`c`x`x1~cols("SSSSS";enlist csv)0:("a,b,c";"d1,d1,d1";"e2,e2,e2")
  • added support for parsing 15 chars of digits representing HHMMSSmmmuuunnn as timespan or time. e.g.

    q)"NT"$\:"123456123987654"
  • added hopen timeout for tls. e.g.

    q)hopen(`:tcps://myhost:5000:username:password;30000)

Fixes and improvements

  • on windows, ensure the TEMP directory exists before trying to use it. e.g.

    q)system"dir"
  • https post was limited to ~16kB. e.g.

    q).Q.hp[`:https://httpbin.org/post;.h.ty`txt]16384#" "
  • generating csv output directly from a partitioned table was throwing a 'No such file or directory error. e.g.

    q)`:db/2001.01.01/t/ set([]0 1);system"l db";","0:t / workaround is to do ","0:select from t