You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "fengqiyuqingpingzhimo (via GitHub)" <gi...@apache.org> on 2023/03/24 07:24:53 UTC

[I] apache drill failed to execute SQL such as ' table1 left join table2 on condition 1 or condition 2' (drill)

fengqiyuqingpingzhimo opened a new issue, #2781:
URL: https://github.com/apache/drill/issues/2781

   Execute the following sql (although it may not make sense):
   SELECT aa.employee_id FROM cp.`employee.json` aa left join cp.`employee.json` bb on aa.employee_id=bb.employee_id or aa.employee_id=bb.position_id ;
   I got the results:
   ![7](https://user-images.githubusercontent.com/26477240/227452771-fe7bf138-5ac4-4dfc-b04c-87f3557c4a69.png)
   I tried to modify the corresponding parameters 'planner.enable_nljoin_for_scalar_only', but it still didn't work.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] apache drill failed to execute SQL such as ' table1 left join table2 on condition 1 or condition 2' (drill)

Posted by "cgivre (via GitHub)" <gi...@apache.org>.
cgivre commented on issue #2781:
URL: https://github.com/apache/drill/issues/2781#issuecomment-1482793689

   I'm not sure what you're trying to do with this query, but I found that rewriting it like this worked:
   
   ```sql
    SELECT aa.employee_id 
    FROM cp.`employee.json` aa , 
    cp.`employee.json` bb
    WHERE aa.employee_id=bb.employee_id or aa.employee_id=bb.position_id
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] apache drill failed to execute SQL such as ' table1 left join table2 on condition 1 or condition 2' (drill)

Posted by "fengqiyuqingpingzhimo (via GitHub)" <gi...@apache.org>.
fengqiyuqingpingzhimo commented on issue #2781:
URL: https://github.com/apache/drill/issues/2781#issuecomment-1484423994

   > I'm not sure what you're trying to do with this query, but I found that rewriting it like this worked:
   > 
   > ```sql
   >  SELECT aa.employee_id 
   >  FROM cp.`employee.json` aa , 
   >  cp.`employee.json` bb
   >  WHERE aa.employee_id=bb.employee_id or aa.employee_id=bb.position_id
   > ```
   Thank you very much for your answer,But when I switched to MySQL, I encountered another problem,I created two storage configurations that point to the same MySQL,There is no problem when I use the same storage, such as SQL:
   ```sql
    select * from bb.eladmin.table1 a, bb.eladmin.table2 b where a.id =b.id or a.name=b.name
   ```
   However, when I use two storage systems, the sql is as follows:
   ```sql
    select * from bb.eladmin.table1 a, zz.eladmin.table2 b where a.id =b.id or a.name=b.name
   ```
   It still reports errors,Let me set the option 'planner.enable_nljoin_for_scalar_only' to false and try again,This is why?
   ![aaa](https://user-images.githubusercontent.com/26477240/227832563-0ea63c84-3357-4959-beca-64af91ef9a66.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org