Skip to content

Table UDF: cannot mix range variables and scalar variables #6378

@monetdb-team

Description

@monetdb-team

Date: 2017-07-27 19:09:07 +0200
From: Dean De Leo <>
To: MonetDB5 devs <>
Version: -- development
CC: @PedroTadim

Last updated: 2019-12-05 16:07:59 +0100

Comment 25504

Date: 2017-07-27 19:09:07 +0200
From: Dean De Leo <>

User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.40 Safari/537.36
Build Identifier:

The MAL layer throws an error when invoking a table function with actual parameters both range variables and scalars.

Linux, developer build at commit:
commit 3eeb3cb
Merge: 076f8e6 fe682d4
Author: Sjoerd Mullender sjoerd@acm.org
Date: Wed Jul 26 14:11:12 2017 +0200

 Merge with Jul2017 branch.

Reproducible: Always

Steps to Reproduce:

  1. Create a shared library with an implementation for `test1.impl1' and link to the MAL system using a script such as:

module test1;

pattern impl1(:any... ) :bat[:int]
address TESTimpl1
comment "test table udf";

  1. SQL snippet:

CREATE TABLE table1(A INT, B INT);
CREATE FUNCTION test1(p1 INT, p2 INT) RETURNS TABLE (ret1 INT) EXTERNAL NAME test1.impl1;
SELECT * FROM table1, LATERAL test1(table1.A, (SELECT table1.B FROM table1));
TypeException:user.Lest2[19]:'A0' may not be used before being initialized
TypeException:user.s20_1[27]:'user.Lest2' undefined in: user.Lest2(X_135:int, X_137:bte, X_139:oid);
Program contains errors.:(NONE).multiplex

SELECT * FROM table1, LATERAL test1(table1.A, 2);
TypeException:user.Lest2[19]:'A0' may not be used before being initialized
TypeException:user.s20_1[27]:'user.Lest2' undefined in: user.Lest2(X_135:int, X_137:bte, X_139:oid);
Program contains errors.:(NONE).multiplex

Actual Results:

An error is raised at the MAL layer.

Expected Results:

The interpreter should invoke the function TESTimpl1 passing as arguments the column table1.A and the given scalar expression.

Comment 27445

Date: 2019-12-05 16:07:59 +0100
From: @PedroTadim

I couldn't reproduce this, so it got fixed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sjoerdmullender@lrpereira@monetdb-team

        Issue actions

          Table UDF: cannot mix range variables and scalar variables · Issue #6378 · MonetDB/MonetDB