Changeset: 5ea3c7e36bc5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5ea3c7e36bc5
Modified Files:
monetdb5/extras/pyapi3/Tests/pyapi3_25.sql
monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.err
monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.err.Windows
monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.out
Branch: python3udf
Log Message:
Fix last tests.
diffs (100 lines):
diff --git a/monetdb5/extras/pyapi3/Tests/pyapi3_25.sql
b/monetdb5/extras/pyapi3/Tests/pyapi3_25.sql
--- a/monetdb5/extras/pyapi3/Tests/pyapi3_25.sql
+++ b/monetdb5/extras/pyapi3/Tests/pyapi3_25.sql
@@ -9,7 +9,7 @@ CREATE TABLE pyapi25multiplication(i int
INSERT INTO pyapi25multiplication VALUES (3);
CREATE FUNCTION pyapi25(i integer) returns integer
-language PYTHON_MAP
+LANGUAGE PYTHON3_MAP
{
res = _conn.execute('SELECT i FROM pyapi25multiplication;')
return res['i'] * i
@@ -29,7 +29,7 @@ CREATE TABLE pyapi25table(i integer);
INSERT INTO pyapi25table VALUES (1), (2), (3), (4);
CREATE FUNCTION pyapi25(i integer) returns integer
-language PYTHON
+LANGUAGE PYTHON3
{
_conn.execute('CREATE TABLE mytable(i INTEGER);')
_conn.execute('INSERT INTO mytable VALUES (1), (2), (3), (4);')
@@ -39,7 +39,7 @@ language PYTHON
SELECT pyapi25(i) FROM pyapi25table;
CREATE FUNCTION pyapi25map(i integer) returns integer
-language PYTHON_MAP
+LANGUAGE PYTHON3_MAP
{
_conn.execute('UPDATE mytable SET i=i*10;')
return i
@@ -53,14 +53,14 @@ SELECT * FROM mytable; # 10000, 20000, 3
# we compute the mean in parallel, then store the mean of every thread in the
table
CREATE TABLE pyapi25medians(mean DOUBLE);
-CREATE FUNCTION pyapi25randomtable() returns TABLE(d DOUBLE) LANGUAGE
PYTHON3YTHON
+CREATE FUNCTION pyapi25randomtable() returns TABLE(d DOUBLE) LANGUAGE PYTHON3
{
numpy.random.seed(33)
return numpy.random.rand(1000000)
};
CREATE FUNCTION pyapi25mediancompute(d DOUBLE) RETURNS DOUBLE
-language PYTHON_MAP
+LANGUAGE PYTHON3_MAP
{
mean = numpy.mean(d)
_conn.execute('INSERT INTO pyapi25medians (mean) VALUES (%g);' % mean)
@@ -68,7 +68,7 @@ language PYTHON_MAP
};
# to verify that the output is correct, we check if the mean stored in
pyapi25medians is within an epsilon of the actual mean of the data
-CREATE FUNCTION pyapi25checker(d DOUBLE) RETURNS BOOL LANGUAGE PYTHON3YTHON {
+CREATE FUNCTION pyapi25checker(d DOUBLE) RETURNS BOOL LANGUAGE PYTHON3 {
actual_mean = numpy.mean(d)
numpy.random.seed(33)
expected_mean = numpy.mean(numpy.random.rand(1000000))
@@ -88,7 +88,7 @@ SELECT pyapi25checker(mean) FROM pyapi25
# test error in parallel SQL query
-CREATE FUNCTION pyapi25errortable() returns TABLE(d DOUBLE) LANGUAGE
PYTHON3YTHON_MAP
+CREATE FUNCTION pyapi25errortable() returns TABLE(d DOUBLE) LANGUAGE
PYTHON3_MAP
{
_conn.execute('SELECT * FROM HOPEFULLYNONEXISTANTTABLE;')
return 1
diff --git a/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.err
b/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.err
--- a/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.err
+++ b/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'pyapi25` in directory 'sql/backends/monet5` itself:
+stderr of test 'pyapi3_25` in directory 'monetdb5/extras/pyapi3` itself:
# 12:40:00 >
diff --git a/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.err.Windows
b/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.err.Windows
--- a/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.err.Windows
+++ b/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.err.Windows
@@ -1,4 +1,4 @@
-stderr of test 'pyapi25` in directory 'sql/backends/monet5` itself:
+stderr of test 'pyapi3_25` in directory 'monetdb5/extras/pyapi3` itself:
# 12:40:00 >
diff --git a/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.out
b/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.out
--- a/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.out
+++ b/monetdb5/extras/pyapi3/Tests/pyapi3_25.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'pyapi25` in directory 'sql/backends/monet5` itself:
+stdout of test 'pyapi3_25` in directory 'monetdb5/extras/pyapi3` itself:
# 12:40:00 >
@@ -61,7 +61,6 @@ Ready.
# loading sql script: 90_generator.sql
# loading sql script: 90_generator_hge.sql
# loading sql script: 99_system.sql
-Great success!
# 12:40:00 >
# 12:40:00 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-21450" "--port=30737"
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list