These are chat archives for harelba/q

7th
Mar 2014
Zack Piper
@zackp30
Mar 07 2014 00:00
Hello, the REGEXP operator returns user defined function raised exception.
Nick Beeuwsaert
@NickBeeuwsaert
Mar 07 2014 00:41
@zackp30: it looks that that is caused when a the column has a NULL value. doing ls -alh | q 'SELECT * FROM - WHERE c3 REGEXP “staff”;’ will cause the error whereas doing ls -alh * | q 'SELECT * FROM - WHERE c3 REGEXP “staff”;’ does not (note the * in the ls call)
Zack Piper
@zackp30
Mar 07 2014 01:16
Hmm, I can't seem to find a NULL in my data. :/
Nick Beeuwsaert
@NickBeeuwsaert
Mar 07 2014 01:39
what is your data set? are there any rows with fewer columns than the rest?
you can also add a check before the regexp to test if the column is null e.g. SELECT FROM - WHERE c3 IS NOT NULL AND c3 regexp '.*’
Zack Piper
@zackp30
Mar 07 2014 01:48
Just an ls -la of my home dir (playing around with q ATM)
Nick Beeuwsaert
@NickBeeuwsaert
Mar 07 2014 01:49
ls might be printing out a line at the top that is one column, something like “total 123"
Zack Piper
@zackp30
Mar 07 2014 01:50
Oh, ofc...
Okay, thans. :)
Nick Beeuwsaert
@NickBeeuwsaert
Mar 07 2014 01:51
welcome :D
Zack Piper
@zackp30
Mar 07 2014 01:51
*thanks
Harel Ben-Attia
@harelba
Mar 07 2014 14:48
@zackp30 @NickBeeuwsaert hi, yeah, it's a bug in my regexp implementation. Will add a fix for that in the next release. In the mean time, you can use the NOT NULL clause or filter out rows with fewer columns. btw, if you run q with -m strict, you'll get an error if there are rows with different column counts (such as the "total XXX" row)
opened an issue about this: harelba/q#47
Nick Beeuwsaert
@NickBeeuwsaert
Mar 07 2014 20:43
@harelba: why is the SHOW_SQL constant set to False?
Harel Ben-Attia
@harelba
Mar 07 2014 22:00
@NickBeeuwsaert This is a debugging parameter - Should not be turned on for any regular use. I'm planning on moving it to become some kind of "verbose" command line parameter which will be used for debugging and sending any issues to me