# Have trouble compressing string columns

**URL:** <https://forum.kx.com/t/have-trouble-compressing-string-columns/7265>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [August 24, 2011, 6:49pm UTC](https://forum.kx.com/t/have-trouble-compressing-string-columns/7265 "2011-08-24T18:49:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay3](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jay3](https://forum.kx.com/u/Jay3)\
**Post date:** [August 24, 2011, 6:49pm UTC](https://forum.kx.com/t/have-trouble-compressing-string-columns/7265/1 "2011-08-24T18:49:00Z")

</div>

Hi, everybody, I am new to kdb+ and I have a newbie question.I tried compression in kdb2.7, it works very well. But when I triedto compress tables with string columns(instead of symbol), it failed.It doesnt not pass the validation. Anybody know how to do this?Thanks a lot.

---

<div class="post-metadata">

**Author:** ![charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@charlie1](https://forum.kx.com/u/charlie1)\
**Post date:** [August 25, 2011, 10:48am UTC](https://forum.kx.com/t/have-trouble-compressing-string-columns/7265/2 "2011-08-25T10:48:00Z")

</div>

this should be fine.

e.g.

q)`:t/ set([]string 10000?`8)

`:t/

q)-19!(`:t/x;`:z/x;17;2;9)

84.96801

q)-19!(`$":t/x#";`$“:z/x#”;17;2;9)

42.30125

q)\cp t/.d z/.d

q)get[`:t]~get`:z / matches ok

1b

q)\ls -al t

“… 10 Aug 25 10:45 .d”

“… 80016 Aug 25 10:45 x”

“… 80000 Aug 25 10:45 x#”

q)\ls -al z

“… 10 Aug 25 10:46 .d”

“… 12028 Aug 25 10:45 x”

“… 46159 Aug 25 10:45 x#”

Please can you provide an example where it fails?

thanks

---

<div class="post-metadata">

**Author:** ![Jay3](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jay3](https://forum.kx.com/u/Jay3)\
**Post date:** [August 25, 2011, 4:23pm UTC](https://forum.kx.com/t/have-trouble-compressing-string-columns/7265/3 "2011-08-25T16:23:00Z")

</div>

Thank you for your response. And sorry that I didnt state my issueclearly.I am using cutil.q to compress tables partitioned by date.Here is a simple example.t:( sym:10000?`a`b`c;str:string 10000?`8);.Q.dpft[`:/home/jay/kdb;2011.08.19;`sym;`t];d: `:/home/jay/kdbdt:`:/home/jay/tmp\l cutil.qcmv cvalidate cwrite cusegz1 cinfo[d;dt;2011.08.19;`t]I got an error message:'/home/jay/tmp/2011.08.19/t/str#: No such file or directoryThanks.JayOn Aug 25, 5:48?am, Charles Skelton \<char…\> wrote:\> this should be fine.\> e.g.\>\> q)`:t/ set([]string 10000?`8)\> `:t/&gt; q)-19!(`:t/x;`:z/x;17;2;9)&gt; 84.96801&gt; q)-19!(`$“:t/x#”;`$":z/x#";17;2;9)&gt; 42.30125&gt; q)\cp t/.d z/.d&gt; q)get[`:t]~get`:z / matches ok\> 1b\>\> q)\ls -al t\> “… 10 Aug 25 10:45 .d”\> “… 80016 Aug 25 10:45 x”\> “… 80000 Aug 25 10:45 x#”\>\> q)\ls -al z\> “… 10 Aug 25 10:46 .d”\> “… 12028 Aug 25 10:45 x”\> “… 46159 Aug 25 10:45 x#”\>\> Please can you provide an example where it fails?\>\> thanks\>\>\>\>\>\>\>\> On Wed, Aug 24, 2011 at 6:49 PM, Jay \<jxu2…\> wrote:\> \> Hi, everybody, I am new to kdb+ and I have a newbie question.\> \> I tried compression in kdb2.7, it works very well. But when I tried\> \> to compress tables with string columns(instead of symbol), it failed.\> \> It doesnt not pass the validation. Anybody know how to do this?\> \> Thanks a lot.\</jxu2…\>\</char…\>

---

<div class="post-metadata">

**Author:** ![simon11](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@simon11](https://forum.kx.com/u/simon11)\
**Post date:** [August 25, 2011, 4:49pm UTC](https://forum.kx.com/t/have-trouble-compressing-string-columns/7265/4 "2011-08-25T16:49:00Z")

</div>

that’s an error in cutil.q - if you compress \<xyz\> it should look for (and maybe compress) \<xyz#\>

I’ll fix it

you can make your compressed partition work for now by just copying over the required ..# files&nbsp;

sorry about that&nbsp;

/Simon

---

<div class="post-metadata">

**Author:** ![Jay3](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jay3](https://forum.kx.com/u/Jay3)\
**Post date:** [August 25, 2011, 5:11pm UTC](https://forum.kx.com/t/have-trouble-compressing-string-columns/7265/5 "2011-08-25T17:11:00Z")

</div>

Thank you very much for the quick response. It solves my problem.I am looking forward to the fix.Thanks.JayOn Aug 25, 11:49?am, Simon Garland \<si…\> wrote:\> that’s an error in cutil.q - if you compress it should look for (and\> maybe compress) \>\> I’ll fix it\> you can make your compressed partition work for now by just copying over the\> required ..# files\>\> sorry about that\>\> /Simon\>\>\>\>\>\>\>\> On Thu, Aug 25, 2011 at 16:23, Jay \<jxu2…\> wrote:\> \> Thank you for your response. And sorry that I didnt state my issue\> \> clearly.\> \> I am using cutil.q to compress tables partitioned by date.\> \> Here is a simple example.\>\> \> t:( sym:10000?`a`b`c;str:string 10000?`8);\> \> .Q.dpft[`:/home/jay/kdb;2011.08.19;`sym;`t];&gt;&gt; &gt; d: `:/home/jay/kdb\> \> dt:`:/home/jay/tmp&gt; &gt; \l cutil.q&gt; &gt; cmv cvalidate cwrite cusegz1 cinfo[d;dt;2011.08.19;`t]\>\> \> I got an error message:\> \> '/home/jay/tmp/2011.08.19/t/str#: No such file or directory\</jxu2…\>\</si…\>
