You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:19:22 UTC

[jira] [Created] (TRAFODION-997) LP Bug: 1420539 - UDF: A select query with multi-value UDF sees generator internal error

Alice Chen created TRAFODION-997:
------------------------------------

             Summary: LP Bug: 1420539 - UDF: A select query with multi-value UDF sees generator internal error
                 Key: TRAFODION-997
                 URL: https://issues.apache.org/jira/browse/TRAFODION-997
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-cmp
            Reporter: Weishiun Tsai
            Assignee: Hans Zeller


The following select query uses the UDF ENCRYPT_I_MVF, which is a multi-value UDF that returns 2 integer values.  The query returns internal errors from ../generator/Generator.cpp.   This is seen on the v0210 build installed on a workstation.

To reproduce this problem:

(1) Download the attached tar file and untar it to get the 4 files in there. Put the 4 files in any directory <mydir>
(2) Run build.sh from <mydir> to build the UDF so file.
(3) Change the line ‘create library qa_udf_lib file '<mydir>/myudf.so'; in mytest.sql and fill in <mydir>
(4) From sqlci, obey mytest.sql

----------------------------------------------------------------------------------------------------------------------

Here is the execution output:

>>obey mytest.sql
+>;
>>create schema mytest;

--- SQL operation complete.
>>set schema mytest;

--- SQL operation complete.
>>
>>create library qa_udf_lib file '<mydir>/myudf.so';

--- SQL operation complete.
>>
>>create function ENCRYPT_I_MVF
+>(INVAL int)
+>returns (OUTVAL1 int, OUTVAL2 int)
+>language c
+>parameter style sql
+>external name 'encrypt_i_mvf'
+>library qa_udf_lib
+>deterministic
+>state area size 1024
+>allow any parallelism
+>no sql;

--- SQL operation complete.
>>
>>create table mytable (a int, b int);

--- SQL operation complete.
>>insert into mytable values (6,6);

--- 1 row(s) inserted.
>>
>>select * from mytable sample first
+>balance when encrypt_i_mvf(a)=(values(1,1)) then 10 rows
+>when encrypt_i_mvf(a)=(values(2,2)) then 15 rows
+>else 20 rows
+>end;

*** ERROR[7000] An internal error occurred in the code generator in file ../generator/Generator.cpp at line 1714:
ValueId 55 (oneRow(1), oneRow(1)...) not found in MapTable 0x7ffffffed400.

*** ERROR[2235] Compiler Internal Error: An unknown error, originated from file ../generator/Generator.cpp at line 2079.

*** ERROR[8822] The statement was not prepared.

>>
>>drop function ENCRYPT_I_MVF;

--- SQL operation complete.
>>drop library qa_udf_lib cascade;

--- SQL operation complete.
>>drop schema mytest cascade;

--- SQL operation complete.



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