Uploaded image for project: 'Apache HAWQ (Retired)'
  1. Apache HAWQ (Retired)
  2. HAWQ-133

core when use plpython udf

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Resolved
    • 2.0.0.0-incubating
    • 2.0.0.0-incubating
    • Core
    • None

    Description

      Run sqls below can recur the core.

      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');
      

      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.
      !>

      Attachments

        Issue Links

          Activity

            People

              huor Ruilong Huo
              doli Dong Li
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: