plcontainer icon indicating copy to clipboard operation
plcontainer copied to clipboard

ERROR Cannot handle sql when create temporary table

Open BaiShaoqi opened this issue 6 years ago • 1 comments

Expected behavior

 NOTICE:  Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum 
 Database data distribution key for this table.
 HINT:  The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen 
 are the optimal data distribution key to minimize skew.
 CONTEXT:  SQL statement "CREATE TEMPORARY TABLE foo3 (a int, b text)"
 PL/Python function "result_len_test"
 result_len_test
 -----------------
                0
 (1 row)

Actual behavior

NOTICE:  Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT:  The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CONTEXT:  SQL statement "CREATE TEMPORARY TABLE foo3 (a int, b text)"
ERROR:  plcontainer: Cannot handle sql ('CREATE TEMPORARY TABLE foo3 (a int, b text)') with fn_readonly (0) and limit (0). Detail: SPI_OK_UTILITY (sqlhandler.c:330)

Step to reproduce the behavior

CREATE FUNCTION result_len_test(cmd text) RETURNS int AS $$
# container: plc_python_shared
result = plpy.execute(cmd)
return len(result)
$$ language plcontainer;

SELECT result_len_test($$CREATE TEMPORARY TABLE foo3 (a int, b text)$$);

BaiShaoqi avatar Jun 02 '18 15:06 BaiShaoqi