Hello everyone,
I believe I've encountered a bug with the remote table functionality. Here are the steps to replicate it. Tested with MonetDB 11.29.3, both on Ubuntu 14.04.5 LTS and Ubuntu 16.04.4 LTS. The problem persists even after restarting the DB farms and the MonetDB daemons.
On node 1
Create a normal table, insert some data and check its contents:
create table testtable(id int not null, name text, valid boolean);
insert into testtable (id, name) values (1, '1');
insert into testtable (…
[View More]id, name) values (2, '2');
insert into testtable (id) values (3);
select * from testtable;
+------+------+-------+
| id | name | valid |
+======+======+=======+
| 1 | 1 | null |
| 2 | 2 | null |
| 3 | null | null |
+------+------+-------+
3 tuples (6.446ms)
On node 2
Create a remote table and check its contents to make sure it works:
create remote table testtable(id int not null, name text, valid boolean) on 'mapi:monetdb://node1:50000/dbfarm';
select * from testtable;
+------+------+-------+
| id | name | valid |
+======+======+=======+
| 1 | 1 | null |
| 2 | 2 | null |
| 3 | null | null |
+------+------+-------+
3 tuples (6.446ms)
Then try to select anything with a WHERE clause:
select * from testtable where name is null;
+------+------+-------+
| id | name | valid |
+======+======+=======+
| 3 | null | null |
+------+------+-------+
1 tuple (5.186ms)
It seemingly works fine, but now when you try to select anything else, you get the same result:
select * from testtable;
+------+------+-------+
| id | name | valid |
+======+======+=======+
| 3 | null | null |
+------+------+-------+
1 tuple (4.466ms)
If you log out from mclient and then back in, select * works fine again, so there's no data loss. However, even if you try the opposite of the previous query (is not null instead of is null), you get the same result:
select * from testtable where name is not null;
+------+------+-------+
| id | name | valid |
+======+======+=======+
| 3 | null | null |
+------+------+-------+
1 tuple (5.358ms)
Can someone else please try this to confirm it's a bug and not something on my end?
Thanks in advance.
Best regards,
Marcell
[View Less]
Dear all,
A first version for MonetDB-rmath is now available. It includes
approximately 90% of the functions in Rmath.h, including
[rpdq](norm|unif|gamma|beta|lnorm|chisq|nchisq|f|t|binom|cauchy|exp|geom|hyper|
nbinom|pois|weibull|logis|wilcox|signrank) and another 40 functions. The
current implementation uses m4 for code generation and requires the
r-mathlib package under Debian.
One can clone the GitHub repository and install using:
git clone https://github.com/mclements/MonetDB-rmath.git…
[View More]cd MonetDB-rmath
make
sudo make install
You will then need to use a fresh database. An example script is:
-- calculate the quantile and cumulative distribution function for a
unit normal
select qnorm(0.025,0,1), pnorm(-1.96,0,1);
-- calculate E(Z^2) for Z~Normal(0,1)
select sum(R_pow(value,2)*0.01*dnorm(value,0,1)) from
sys.generate_series(-5.0,5.0,0.01);
-- random numbers
select set_seed(1,2);
select rpois(value*0+100) from sys.generate_series(1,10); -- ok
select rpois(100) from sys.generate_series(1,10); -- repeats the values
10 times:-<
All of the functions are currently scalars. Next steps include adding
BAT functions, including some of the constants at the beginning of
Rmath.h, and adding some statistical tests. As an example, I have
included poissonci(y,boundary) for an exact Poisson confidence interval
for count y for a specific boundary (1=left, 2=right) with default
confidence level of 95%:
select poissonci(10,1), poissonci(10,2);
The equivalent code in R would be poisson.test(10). For confidence
intervals, it would be nice to have a type that is a pair of doubles.
Sincerely, Mark.
[View Less]
I am trying to adapt MonetDB-gsl to use the rmath library. My code is at:
https://github.com/mclements/MonetDB-rmath
Under Ubuntu 16.04 LTS, I used:
sudo apt install r-mathlib
git clone https://github.com/mclements/MonetDB-rmath
cd MonetDB-rmath
make
sudo make install
// start up MonetDB server with a test database
mclient -d test -s "select sys.pchisq(20.0,5.0);"
This compiles but when I try "select sys.pchisq(20.0,5.0);" I get the error:
SELECT: no such binary operator '…
[View More]pchisq(decimal,decimal)'
Any guidance would be appreciated.
(You may ask why one would want to do this when one could use embedded R
- I wanted to see how fast and easy it was to use the rmath library.)
Kindly, Mark.
[View Less]