Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tau1974 opened this issue Mar 30, 2019 · 0 comments
Open

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

tau1974 opened this issue Mar 30, 2019 · 0 comments

Comments

@tau1974
Copy link

tau1974 commented Mar 30, 2019

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"]]}]

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

No branches or pull requests

2 participants