Sometimes getting empty columns when loading data

Loading a number of *.mat files into Kdb. Some of the files load with no problems, some (probably less than a half) frow a bunch of 'type 'rank errors and leave consistently four columns in the table blank. The failed *.mat files seem OK.

Not sure what you mean by loading a matlab file into kdb+.<o:p></o:p>

<o:p> </o:p>

Normally you <o:p></o:p>

<o:p> </o:p>

·       load c.jar in matlab,<o:p></o:p>

·       make a connection to kdb+ using kx.c,<o:p></o:p>

·       send a command and\or data to kdb+ using kx.c.k or kx.c.ks<o:p></o:p>

<o:p> </o:p>

What you need to make sure is that the matlab object can be cast to native java object. See here: http://uk.mathworks.com/help/matlab/matlab_external/passing-data-to-a-java-method.html <o:p></o:p>

<o:p> </o:p>

HTH,<o:p></o:p>

<o:p> </o:p>

Kim<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

Von: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] Im Auftrag von A.L.V.
Gesendet: Samstag, 28. Februar 2015 03:34
An: personal-kdbplus@googlegroups.com
Betreff: [personal kdb+] Sometimes getting empty columns when loading data<o:p></o:p>

<o:p> </o:p>

Loading a number of *.mat files into Kdb. Some of the files load with no problems, some (probably less than a half) frow a bunch of 'type 'rank errors and leave consistently four columns in the table blank. The failed *.mat files seem OK.<o:p></o:p>


Submitted via Google Groups

It is more to do with the q syntax I am using:

exec(q, [‘tempTable:( name; number1; number2;’…
    ‘number3; number4; number5; number6; number7; number8l)’]);

exec(q,‘:Table/ upsert .Q.en[:.; tempTable]’);

I have a temp table for memory management purposes.

This works for loading individual entries (each entry corrresponds to a matlab file), but as the number of entries grows I start to get empty values in number6, number7 and number8.

Again, you need to make sure that number6, number7, number8 are correctly transferred to kdb from matlab.<o:p></o:p>

What kind of values are stored in number6,7 and 8. I remember that cells cannot be transferred to kdb+.<o:p></o:p>

<o:p> </o:p>

And I have seen tables with more than 200 columns.<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

HTH,<o:p></o:p>

<o:p> </o:p>

Kim<o:p></o:p>

<o:p> </o:p>

Von: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] Im Auftrag von A.L.V.
Gesendet: Samstag, 28. Februar 2015 22:45
An: personal-kdbplus@googlegroups.com
Betreff: Re: [personal kdb+] Sometimes getting empty columns when loading data<o:p></o:p>

<o:p> </o:p>

It is more to do with the q syntax I am using:

exec(q, [‘tempTable:( name; number1; number2;’…
    ‘number3; number4; number5; number6; number7; number8l)’]);

exec(q,‘:Table/ upsert .Q.en[:.; tempTable]’);

I have a temp table for memory management purposes.

This works for loading individual entries (each entry corrresponds to a matlab file), but as the number of entries grows I start to get empty values in number6, number7 and number8.

double and int64. Some double variables actually could be int, as they contain no decimal places.

Is there an alternative syntax I could try? The thing that worries me that this problem only occurs when I append the table; it does not happen for loading individual entries.

It is the number of rows that is high (milions) rather than columns.

<o:p> </o:p>

Works as expected,<o:p></o:p>

<o:p> </o:p>

HTH,<o:p></o:p>

<o:p> </o:p>

Kim<o:p></o:p>

<o:p> </o:p>

javaaddpath(‘C:\q\listbox\26matlab\c.jar’)<o:p></o:p>

q=kx.c(‘localhost’,8888);<o:p></o:p>

x = random(‘Normal’,0,1,50,1500000);<o:p></o:p>

for k=1:50;q.k(‘{(`$“a”,string x) set y}’,k,x(k,:));end<o:p></o:p>

q.ks(‘t:flip t!value each t:`$“a”,:string 1+til 50’)<o:p></o:p>

<o:p> </o:p>

Von: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] Im Auftrag von A.L.V.
Gesendet: Montag, 2. März 2015 02:27
An: personal-kdbplus@googlegroups.com
Betreff: Re: [personal kdb+] Sometimes getting empty columns when loading data<o:p></o:p>

<o:p> </o:p>

double and int64. Some double variables actually could be int, as they contain no decimal places.

Is there an alternative syntax I could try? The thing that worries me that this problem only occurs when I append the table; it does not happen for loading individual entries.

It is the number of rows that is high (milions) rather than columns.

Fixed. The problen was I was not specifying data types when creating lists to be used in the table kdb woudl assign different data types sometimes when reading which created problems with upserting.