Skip to content

node-red-contrib-alasql: JOIN DOESN'T WORK #17

@tau1974

Description

@tau1974

Hi guys,
maybe someone of you can help me.

I'm working with AlaSQL wrapper for node-red, and it seems that JOIN condition doesn't work at all.

Let's start with something simple (from the examples):

  1. I have a first function-block set with this code:
var data = { COLORS: [[1,"red"],[2,"yellow"],[3,"orange"]], "FRUITS":[[1,"apple"],[2,"banana"],[3,"orange"]]}; 

msg.payload=[data.COLORS, data.FRUITS];

return msg;
  1. then I have AlaSQL block with the following query
    SELECT MATRIX COLORS.[0], COLORS.[1], FRUITS.[1] AS [2] FROM ? AS COLORS JOIN ? AS FRUITS USING [0]
  2. Then if I deploy the flow and execute it I get :

TypeError: Cannot read property 'length' of undefined

Does anyone of you have an example of a working join condition with AlaSQL in node-red ?

Here are the complete flow code

[{"id":"d8ea2581.c9eaa8","type":"alasql","z":"44bba25d.edd63c","name":"","query":"SELECT MATRIX COLORS.[0], COLORS.[1], FRUITS.[1] AS [2] FROM ? AS COLORS JOIN ? AS FRUITS USING [0]","x":910,"y":80,"wires":[["4e58c548.dcf80c"]]},{"id":"e1180ede.b9d41","type":"function","z":"44bba25d.edd63c","name":"","func":"var data = {COLORS: [[1,\"red\"],[2,\"yellow\"],[3,\"orange\"]],\"FRUITS\":[[1,\"apple\"],[2,\"banana\"],[3,\"orange\"]]};\n\nmsg.payload=[data.COLORS, data.FRUITS];\n\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":80,"wires":[["d8ea2581.c9eaa8"]]},{"id":"4e58c548.dcf80c","type":"debug","z":"44bba25d.edd63c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1030,"y":80,"wires":[]},{"id":"a887efce.c7898","type":"inject","z":"44bba25d.edd63c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":660,"y":80,"wires":[["e1180ede.b9d41"]]}]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions