You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/03/26 23:54:41 UTC

[GitHub] [druid] benkrug opened a new issue #11037: two failures with druid sql queries using LOOKUP(), one seen in 0.20.0, another seen in 0.20.1

benkrug opened a new issue #11037:
URL: https://github.com/apache/druid/issues/11037


   LOOKUP() doesn't seem to be working well in druid sql.
   
   In 0.20.0, I created a regular table and a lookup.  Doing a JOIN to the lookup works - eg
   
   `SELECT m1_int1_min, v 
   FROM dataTest 
   JOIN lookup.myLookup 
   ON m1_int1_min=k`
   
   Using LOOKUP to do the same gives an error -
   
   `SELECT m1_int1_min, LOOKUP(m1_int1_min,myLookup)
   FROM dataTest`
   
   gives this:
   
   ```
   Error: Unknown exception
   
   org.apache.calcite.runtime.CalciteContextException: From line 1, column 40 to line 1, column 47: Column 'myLookup' not found in any table
   
   org.apache.calcite.tools.ValidationException
   ```
   
   I don't know whether it's related, but in ASF slack, someone [reported](https://the-asf.slack.com/archives/CJ8D1JTB8/p1616731408247400) that a join worked for them, but that when the key being looked up was not in the lookup, it gave an error (although a JOIN worked).  See 
   
   ```
   Hi, we are having a problem with the LOOKUP SQL function in Druid 0.20.1.  Given this example query:
   
   SELECT channel, LOOKUP(channel, 'channel_to_language')
   FROM wikipedia_example
   WHERE channel = 'foo'
   
   we get the following error if "foo" is not a key in the channel_to_language lookup table:
   
   javax.servlet.ServletException: java.lang.AssertionError: Cannot add expression of different type to set: set type is RecordType(VARCHAR channel, VARCHAR NOT NULL EXPR$1) NOT NULL expression type is RecordType(VARCHAR channel, VARCHAR EXPR$1) NOT NULL set is rel#10120546:LogicalProject.NONE.[](input=HepRelVertex#10120545,channel=$0,EXPR$1=LOOKUP($0, &apos;channel_to_language&apos;)) expression is LogicalProject(channel=[CAST(&apos;foo&apos;:VARCHAR):VARCHAR], EXPR$1=[null:VARCHAR]) LogicalFilter(condition=[=($0, &apos;foo&apos;)]) LogicalProject(channel=[$1]) LogicalTableScan(table=[[druid, wikipedia_example]])
   
   However, if we change the WHERE clause to use LIKE instead of equals, the query executes and correctly returns 0 results.
   ```
   
   If these are unrelated, I can create separate bug reports.
   


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] benkrug commented on issue #11037: two failures with druid sql queries using LOOKUP(), one seen in 0.20.0, another seen in 0.20.1

Posted by GitBox <gi...@apache.org>.
benkrug commented on issue #11037:
URL: https://github.com/apache/druid/issues/11037#issuecomment-808638051


   going to close and file a new one with the one reproducible issue.


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] benkrug commented on issue #11037: two failures with druid sql queries using LOOKUP(), one seen in 0.20.0, another seen in 0.20.1

Posted by GitBox <gi...@apache.org>.
benkrug commented on issue #11037:
URL: https://github.com/apache/druid/issues/11037#issuecomment-808636031


   First issue was my mistake, I didn't include single quotes around the lookup table's name.  I'm trying to reproduce the second issue, and will update the ticket after that.


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] benkrug closed issue #11037: two failures with druid sql queries using LOOKUP(), one seen in 0.20.0, another seen in 0.20.1

Posted by GitBox <gi...@apache.org>.
benkrug closed issue #11037:
URL: https://github.com/apache/druid/issues/11037


   


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org