You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "Dong Li (JIRA)" <ji...@apache.org> on 2015/11/06 05:45:27 UTC

[jira] [Updated] (HAWQ-133) core when use plpython udf

     [ https://issues.apache.org/jira/browse/HAWQ-133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dong Li updated HAWQ-133:
-------------------------
    Description: 
Run sqls below can recur the core.
{code}
CREATE PROCEDURAL LANGUAGE plpythonu;

CREATE TABLE users (
	fname text not null,
	lname text not null,
	username text,
	userid serial
	-- , PRIMARY KEY(lname, fname) 
	) DISTRIBUTED BY (userid);

INSERT INTO users (fname, lname, username) VALUES ('jane', 'doe', 'j_doe');
INSERT INTO users (fname, lname, username) VALUES ('john', 'doe', 'johnd');
INSERT INTO users (fname, lname, username) VALUES ('willem', 'doe', 'w_doe');
INSERT INTO users (fname, lname, username) VALUES ('rick', 'smith', 'slash');

CREATE FUNCTION spi_prepared_plan_test_one(a text) RETURNS text
	AS
'if not SD.has_key("myplan"):
	q = "SELECT count(*) FROM users WHERE lname = $1"
	SD["myplan"] = plpy.prepare(q, [ "text" ])
try:
	rv = plpy.execute(SD["myplan"], [a])
	return "there are " + str(rv[0]["count"]) + " " + str(a) + "s"
except Exception, ex:
	plpy.error(str(ex))
return None
'
	LANGUAGE plpythonu;

select spi_prepared_plan_test_one('doe');

select spi_prepared_plan_test_one('smith');
{code}
when execute "select spi_prepared_plan_test_one('smith');"
server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>

  was:
Run sqls below can recur the core.
<code>
CREATE PROCEDURAL LANGUAGE plpythonu;

CREATE TABLE users (
	fname text not null,
	lname text not null,
	username text,
	userid serial
	-- , PRIMARY KEY(lname, fname) 
	) DISTRIBUTED BY (userid);

INSERT INTO users (fname, lname, username) VALUES ('jane', 'doe', 'j_doe');
INSERT INTO users (fname, lname, username) VALUES ('john', 'doe', 'johnd');
INSERT INTO users (fname, lname, username) VALUES ('willem', 'doe', 'w_doe');
INSERT INTO users (fname, lname, username) VALUES ('rick', 'smith', 'slash');

CREATE FUNCTION spi_prepared_plan_test_one(a text) RETURNS text
	AS
'if not SD.has_key("myplan"):
	q = "SELECT count(*) FROM users WHERE lname = $1"
	SD["myplan"] = plpy.prepare(q, [ "text" ])
try:
	rv = plpy.execute(SD["myplan"], [a])
	return "there are " + str(rv[0]["count"]) + " " + str(a) + "s"
except Exception, ex:
	plpy.error(str(ex))
return None
'
	LANGUAGE plpythonu;

select spi_prepared_plan_test_one('doe');

select spi_prepared_plan_test_one('smith');
<code>
when execute "select spi_prepared_plan_test_one('smith');"
server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>


> core when use plpython udf
> --------------------------
>
>                 Key: HAWQ-133
>                 URL: https://issues.apache.org/jira/browse/HAWQ-133
>             Project: Apache HAWQ
>          Issue Type: Bug
>            Reporter: Dong Li
>            Assignee: Lei Chang
>
> Run sqls below can recur the core.
> {code}
> CREATE PROCEDURAL LANGUAGE plpythonu;
> CREATE TABLE users (
> 	fname text not null,
> 	lname text not null,
> 	username text,
> 	userid serial
> 	-- , PRIMARY KEY(lname, fname) 
> 	) DISTRIBUTED BY (userid);
> INSERT INTO users (fname, lname, username) VALUES ('jane', 'doe', 'j_doe');
> INSERT INTO users (fname, lname, username) VALUES ('john', 'doe', 'johnd');
> INSERT INTO users (fname, lname, username) VALUES ('willem', 'doe', 'w_doe');
> INSERT INTO users (fname, lname, username) VALUES ('rick', 'smith', 'slash');
> CREATE FUNCTION spi_prepared_plan_test_one(a text) RETURNS text
> 	AS
> 'if not SD.has_key("myplan"):
> 	q = "SELECT count(*) FROM users WHERE lname = $1"
> 	SD["myplan"] = plpy.prepare(q, [ "text" ])
> try:
> 	rv = plpy.execute(SD["myplan"], [a])
> 	return "there are " + str(rv[0]["count"]) + " " + str(a) + "s"
> except Exception, ex:
> 	plpy.error(str(ex))
> return None
> '
> 	LANGUAGE plpythonu;
> select spi_prepared_plan_test_one('doe');
> select spi_prepared_plan_test_one('smith');
> {code}
> when execute "select spi_prepared_plan_test_one('smith');"
> server closed the connection unexpectedly
> 	This probably means the server terminated abnormally
> 	before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
> !>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)