[ 
https://issues.apache.org/jira/browse/DRILL-5452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Muhammad Gelbana updated DRILL-5452:
------------------------------------
    Description: 
The following query
{code:sql}
SELECT * FROM (SELECT 'ABC' `UserID` FROM `dfs`.`path_to_parquet_file` tc LIMIT 
2147483647) `t0` INNER JOIN (SELECT 'ABC' `UserID` FROM 
`dfs`.`path_to_parquet_file` tc LIMIT 2147483647) `t1` ON (`t0`.`UserID` IS NOT 
DISTINCT FROM `t1`.`UserID`) LIMIT 2147483647{code}

Leads to the following exception

{noformat}2017-04-28 16:59:11,722 
[26fca73f-92f0-4664-4dca-88bc48265c92:foreman] INFO  
o.a.d.e.planner.sql.DrillSqlWorker - User Error Occurred
org.apache.drill.common.exceptions.UserException: UNSUPPORTED_OPERATION ERROR: 
This query cannot be planned possibly due to either a cartesian join or an 
inequality join


[Error Id: 672b4f2c-02a3-4004-af4b-279759c36c96 ]
        at 
org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543)
 ~[drill-common-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:107)
 [drill-java-exec-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:1008) 
[drill-java-exec-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:264) 
[drill-java-exec-1.9.0.jar:1.9.0]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
[na:1.8.0_121]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
[na:1.8.0_121]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Caused by: org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException: 
This query cannot be planned possibly due to either a cartesian join or an 
inequality join
        at 
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToPrel(DefaultSqlHandler.java:432)
 ~[drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:169)
 ~[drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPhysicalPlan(DrillSqlWorker.java:123)
 [drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:97)
 [drill-java-exec-1.9.0.jar:1.9.0]
        ... 5 common frames omitted
2017-04-28 16:59:11,741 [USER-rpc-event-queue] ERROR 
o.a.d.exec.server.rest.QueryWrapper - Query Failed
org.apache.drill.common.exceptions.UserRemoteException: UNSUPPORTED_OPERATION 
ERROR: This query cannot be planned possibly due to either a cartesian join or 
an inequality join


[Error Id: 672b4f2c-02a3-4004-af4b-279759c36c96 on mgelbana-incorta:31010]
        at 
org.apache.drill.exec.rpc.user.QueryResultHandler.resultArrived(QueryResultHandler.java:123)
 [drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.user.UserClient.handleReponse(UserClient.java:144) 
[drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:46)
 [drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:31)
 [drill-rpc-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.rpc.RpcBus.handle(RpcBus.java:65) 
[drill-rpc-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.rpc.RpcBus$RequestEvent.run(RpcBus.java:363) 
[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.common.SerializedExecutor$RunnableProcessor.run(SerializedExecutor.java:89)
 [drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$SameExecutor.execute(RpcBus.java:240) 
[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.common.SerializedExecutor.execute(SerializedExecutor.java:123) 
[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:274) 
[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:245) 
[drill-rpc-1.9.0.jar:1.9.0]
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
 [netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
 [netty-handler-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
 [netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
 [netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) 
[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) 
[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) 
[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
 [netty-common-4.0.27.Final.jar:4.0.27.Final]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
2017-04-28 16:59:11,744 [qtp506972944-58] ERROR 
o.a.d.e.server.rest.QueryResources - Query from Web UI Failed
org.apache.drill.common.exceptions.UserRemoteException: UNSUPPORTED_OPERATION 
ERROR: This query cannot be planned possibly due to either a cartesian join or 
an inequality join


[Error Id: 672b4f2c-02a3-4004-af4b-279759c36c96 on mgelbana-incorta:31010]
        at 
org.apache.drill.exec.rpc.user.QueryResultHandler.resultArrived(QueryResultHandler.java:123)
 ~[drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.user.UserClient.handleReponse(UserClient.java:144) 
~[drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:46)
 ~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:31)
 ~[drill-rpc-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.rpc.RpcBus.handle(RpcBus.java:65) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.rpc.RpcBus$RequestEvent.run(RpcBus.java:363) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.common.SerializedExecutor$RunnableProcessor.run(SerializedExecutor.java:89)
 ~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$SameExecutor.execute(RpcBus.java:240) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.common.SerializedExecutor.execute(SerializedExecutor.java:123) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:274) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:245) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
 ~[netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
 ~[netty-handler-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
 ~[netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
 ~[netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) 
~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) 
~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) 
~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
 ~[netty-common-4.0.27.Final.jar:4.0.27.Final]
        at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_121]{noformat}
And the following plan
{noformat}2017-04-28 16:50:25,355 
[26fca94f-d362-2a9a-32ed-da040ebc3d45:foreman] ERROR 
o.a.d.e.p.s.h.DefaultSqlHandler - Node 
[rel#166:Subset#13.PHYSICAL.SINGLETON([]).[]] could not be implemented; planner 
state:

Root: rel#166:Subset#13.PHYSICAL.SINGLETON([]).[]
Original rel:
AbstractConverter(subset=[rel#166:Subset#13.PHYSICAL.SINGLETON([]).[]], 
convention=[PHYSICAL], DrillDistributionTraitDef=[SINGLETON([])], sort=[[]]): 
rowcount = 2.147483647E9, cumulative cost = {inf}, id = 168
  DrillScreenRel(subset=[rel#165:Subset#13.LOGICAL.ANY([]).[]]): rowcount = 
2.147483647E9, cumulative cost = {2.1474836470000002E8 rows, 
2.1474836470000002E8 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 164
    DrillProjectRel(subset=[rel#163:Subset#12.LOGICAL.ANY([]).[]], UserID=[$0], 
UserID0=[$1]): rowcount = 2.147483647E9, cumulative cost = {0.0 rows, 0.0 cpu, 
0.0 io, 0.0 network, 0.0 memory}, id = 162
      DrillLimitRel(subset=[rel#161:Subset#11.LOGICAL.ANY([]).[]], 
fetch=[2147483647]): rowcount = 2.147483647E9, cumulative cost = {2.147483647E9 
rows, 8.589934588E9 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 160
        DrillJoinRel(subset=[rel#159:Subset#10.LOGICAL.ANY([]).[]], 
condition=[CAST(CASE(IS NULL($0), IS NULL($1), IS NULL($1), IS NULL($0), =($0, 
$1))):BOOLEAN NOT NULL], joinType=[inner]): rowcount = 2.147483647E9, 
cumulative cost = {4.294967294E9 rows, 0.0 cpu, 0.0 io, 0.0 network, 
1.8897856093600002E10 memory}, id = 158
          DrillLimitRel(subset=[rel#155:Subset#9.LOGICAL.ANY([]).[]], 
fetch=[2147483647]): rowcount = 2.147483647E9, cumulative cost = {2.147483647E9 
rows, 8.589934588E9 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 154
            DrillProjectRel(subset=[rel#153:Subset#8.LOGICAL.ANY([]).[]], 
UserID=['ABC']): rowcount = 10000.0, cumulative cost = {10000.0 rows, 40000.0 
cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 152
              DrillScanRel(subset=[rel#151:Subset#7.LOGICAL.ANY([]).[]], 
table=[[dfs, path_to_parquet_file]], groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
columns=[]]]): rowcount = 10000.0, cumulative cost = {10000.0 rows, 0.0 cpu, 
0.0 io, 0.0 network, 0.0 memory}, id = 85
          DrillLimitRel(subset=[rel#155:Subset#9.LOGICAL.ANY([]).[]], 
fetch=[2147483647]): rowcount = 2.147483647E9, cumulative cost = {2.147483647E9 
rows, 8.589934588E9 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 154
            DrillProjectRel(subset=[rel#153:Subset#8.LOGICAL.ANY([]).[]], 
UserID=['ABC']): rowcount = 10000.0, cumulative cost = {10000.0 rows, 40000.0 
cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 152
              DrillScanRel(subset=[rel#151:Subset#7.LOGICAL.ANY([]).[]], 
table=[[dfs, path_to_parquet_file]], groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
columns=[]]]): rowcount = 10000.0, cumulative cost = {10000.0 rows, 0.0 cpu, 
0.0 io, 0.0 network, 0.0 memory}, id = 85

Sets:
Set#7, type: RecordType()
        rel#151:Subset#7.LOGICAL.ANY([]).[], best=rel#85, 
importance=0.4782969000000001
                rel#85:DrillScanRel.LOGICAL.ANY([]).[](table=[dfs, 
path_to_parquet_file],groupscan=ParquetGroupScan [entries=[ReadEntryWithPath 
[path=file:path_to_parquet_file]], selectionRoot=file:path_to_parquet_file, 
numFiles=1, usedMetadataFile=false, columns=[]]), rowcount=10000.0, cumulative 
cost={tiny}
                
rel#211:AbstractConverter.LOGICAL.ANY([]).[](input=rel#210:Subset#7.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#214:AbstractConverter.LOGICAL.ANY([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
        rel#210:Subset#7.PHYSICAL.SINGLETON([]).[], best=rel#209, 
importance=0.4304672100000001
                
rel#212:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#209:ScanPrel.PHYSICAL.SINGLETON([]).[](groupscan=ParquetGroupScan 
[entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
columns=[]]), rowcount=10000.0, cumulative cost={10000.0 rows, 10000.0 cpu, 0.0 
io, 0.0 network, 0.0 memory}
                
rel#215:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#228:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[]),
 rowcount=10000.0, cumulative cost={20000.0 rows, 90000.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}
        rel#213:Subset#7.PHYSICAL.ANY([]).[], best=rel#209, 
importance=0.3874204890000001
                
rel#212:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#209:ScanPrel.PHYSICAL.SINGLETON([]).[](groupscan=ParquetGroupScan 
[entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
columns=[]]), rowcount=10000.0, cumulative cost={10000.0 rows, 10000.0 cpu, 0.0 
io, 0.0 network, 0.0 memory}
                
rel#215:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#216:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#217:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#210:Subset#7.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#228:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[]),
 rowcount=10000.0, cumulative cost={20000.0 rows, 90000.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}
Set#8, type: RecordType(CHAR(3) UserID)
        rel#153:Subset#8.LOGICAL.ANY([]).[], best=rel#152, importance=0.531441
                
rel#152:DrillProjectRel.LOGICAL.ANY([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],UserID='ABC'),
 rowcount=10000.0, cumulative cost={10001.0 rows, 40001.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}
                
rel#203:AbstractConverter.LOGICAL.ANY([]).[](input=rel#202:Subset#8.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#223:AbstractConverter.LOGICAL.ANY([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
        rel#202:Subset#8.PHYSICAL.SINGLETON([]).[], best=rel#218, 
importance=0.4782969000000001
                
rel#204:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#153:Subset#8.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#218:ProjectPrel.PHYSICAL.SINGLETON([]).[](input=rel#210:Subset#7.PHYSICAL.SINGLETON([]).[],UserID='ABC'),
 rowcount=10000.0, cumulative cost={20000.0 rows, 50000.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}
                
rel#224:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#241:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[]),
 rowcount=10000.0, cumulative cost={30000.0 rows, 130000.0 cpu, 0.0 io, 4.096E7 
network, 0.0 memory}
        rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[], best=rel#221, 
importance=0.4304672100000001
                
rel#225:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#153:Subset#8.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#226:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#202:Subset#8.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#221:ProjectPrel.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],UserID='ABC'),
 rowcount=10000.0, cumulative cost={20000.0 rows, 50000.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}
Set#9, type: RecordType(CHAR(3) UserID)
        rel#155:Subset#9.LOGICAL.ANY([]).[], best=rel#154, 
importance=0.5904900000000001
                
rel#154:DrillLimitRel.LOGICAL.ANY([]).[](input=rel#153:Subset#8.LOGICAL.ANY([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={2.147493648E9 rows, 8.589974589E9 
cpu, 0.0 io, 0.0 network, 0.0 memory}
                
rel#207:AbstractConverter.LOGICAL.ANY([]).[](input=rel#206:Subset#9.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#206:Subset#9.PHYSICAL.SINGLETON([]).[], best=rel#205, 
importance=0.531441
                
rel#208:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#155:Subset#9.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#205:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#202:Subset#8.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={2.147503647E9 rows, 8.589984588E9 
cpu, 0.0 io, 0.0 network, 0.0 memory}
                
rel#248:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#247:Subset#15.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={6.442470941E9 rows, 3.4359788352E10 
cpu, 0.0 io, 8.796093018112E12 network, 0.0 memory}
Set#10, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
        rel#159:Subset#10.LOGICAL.ANY([]).[], best=rel#158, importance=0.6561
                
rel#158:DrillJoinRel.LOGICAL.ANY([]).[](left=rel#155:Subset#9.LOGICAL.ANY([]).[],right=rel#155:Subset#9.LOGICAL.ANY([]).[],condition=CAST(CASE(IS
 NULL($0), IS NULL($1), IS NULL($1), IS NULL($0), =($0, $1))):BOOLEAN NOT 
NULL,joinType=inner), rowcount=2.147483647E9, cumulative cost={8.58995459E9 
rows, 1.7179949178E10 cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
                
rel#187:AbstractConverter.LOGICAL.ANY([]).[](input=rel#186:Subset#10.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#186:Subset#10.PHYSICAL.SINGLETON([]).[], best=null, 
importance=0.5904900000000001
                
rel#188:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#159:Subset#10.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
Set#11, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
        rel#161:Subset#11.LOGICAL.ANY([]).[], best=rel#160, 
importance=0.7290000000000001
                
rel#160:DrillLimitRel.LOGICAL.ANY([]).[](input=rel#159:Subset#10.LOGICAL.ANY([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={1.0737438237E10 rows, 2.5769883766E10 
cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
                
rel#175:AbstractConverter.LOGICAL.ANY([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#191:AbstractConverter.LOGICAL.ANY([]).[](input=rel#190:Subset#11.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#174:Subset#11.PHYSICAL.ANY([]).[], best=null, importance=0.6561
                
rel#176:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#192:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#190:Subset#11.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#193:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#194:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#189:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#186:Subset#10.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#195:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#190:Subset#11.PHYSICAL.SINGLETON([]).[], best=null, 
importance=0.5904900000000001
                
rel#193:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#194:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#189:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#186:Subset#10.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#195:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[]),
 rowcount=2.147483647E9, cumulative cost={inf}
Set#12, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
        rel#163:Subset#12.LOGICAL.ANY([]).[], best=rel#162, importance=0.81
                
rel#162:DrillProjectRel.LOGICAL.ANY([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],UserID=$0,UserID0=$1),
 rowcount=2.147483647E9, cumulative cost={1.0737438238E10 rows, 2.5769883767E10 
cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
                
rel#170:AbstractConverter.LOGICAL.ANY([]).[](input=rel#169:Subset#12.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#179:AbstractConverter.LOGICAL.ANY([]).[](input=rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#169:Subset#12.PHYSICAL.SINGLETON([]).[], best=null, 
importance=0.7290000000000001
                
rel#171:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#163:Subset#12.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#180:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#183:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#198:ProjectPrel.PHYSICAL.SINGLETON([]).[](input=rel#190:Subset#11.PHYSICAL.SINGLETON([]).[],UserID=$0,UserID0=$1),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[], best=null, 
importance=0.6561
                
rel#181:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#163:Subset#12.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#182:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#169:Subset#12.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#177:ProjectPrel.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],UserID=$0,UserID0=$1),
 rowcount=2.147483647E9, cumulative cost={inf}
Set#13, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
        rel#165:Subset#13.LOGICAL.ANY([]).[], best=rel#164, importance=0.9
                
rel#164:DrillScreenRel.LOGICAL.ANY([]).[](input=rel#163:Subset#12.LOGICAL.ANY([]).[]),
 rowcount=2.147483647E9, cumulative cost={1.09521866027E10 rows, 
2.59846321317E10 cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
                
rel#167:AbstractConverter.LOGICAL.ANY([]).[](input=rel#166:Subset#13.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#166:Subset#13.PHYSICAL.SINGLETON([]).[], best=null, importance=1.0
                
rel#168:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#165:Subset#13.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#172:ScreenPrel.PHYSICAL.SINGLETON([]).[](input=rel#169:Subset#12.PHYSICAL.SINGLETON([]).[]),
 rowcount=2.147483647E9, cumulative cost={inf}
Set#14, type: RecordType(CHAR(3) UserID)
        rel#245:Subset#14.PHYSICAL.RANDOM_DISTRIBUTED([]).[], best=rel#242, 
importance=0.4304672100000001
                
rel#242:LimitPrel.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={2.147503647E9 rows, 8.589984588E9 
cpu, 0.0 io, 0.0 network, 0.0 memory}
Set#15, type: RecordType(CHAR(3) UserID)
        rel#247:Subset#15.PHYSICAL.SINGLETON([]).[], best=rel#246, 
importance=0.4782969000000001
                
rel#246:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#245:Subset#14.PHYSICAL.RANDOM_DISTRIBUTED([]).[]),
 rowcount=2.147483647E9, cumulative cost={4.294987294E9 rows, 2.5769853764E10 
cpu, 0.0 io, 8.796093018112E12 network, 0.0 memory}{noformat}
When I removed the limits, the query kept running for like 30 minutes and 
didn't finish though.

  was:
The following query
{code:sql}
SELECT * FROM (SELECT 'ABC' `UserID` FROM `dfs`.`path_to_parquet_file` tc LIMIT 
2147483647) `t0` INNER JOIN (SELECT 'ABC' `UserID` FROM 
`dfs`.`path_to_parquet_file` tc LIMIT 2147483647) `t1` ON (`t0`.`UserID` IS NOT 
DISTINCT FROM `t1`.`UserID`) LIMIT 2147483647{code}

Leads to the following exception

{noformat}2017-04-28 16:59:11,722 
[26fca73f-92f0-4664-4dca-88bc48265c92:foreman] INFO  
o.a.d.e.planner.sql.DrillSqlWorker - User Error Occurred
org.apache.drill.common.exceptions.UserException: UNSUPPORTED_OPERATION ERROR: 
This query cannot be planned possibly due to either a cartesian join or an 
inequality join


[Error Id: 672b4f2c-02a3-4004-af4b-279759c36c96 ]
        at 
org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543)
 ~[drill-common-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:107)
 [drill-java-exec-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:1008) 
[drill-java-exec-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:264) 
[drill-java-exec-1.9.0.jar:1.9.0]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
[na:1.8.0_121]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
[na:1.8.0_121]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Caused by: org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException: 
This query cannot be planned possibly due to either a cartesian join or an 
inequality join
        at 
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToPrel(DefaultSqlHandler.java:432)
 ~[drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:169)
 ~[drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPhysicalPlan(DrillSqlWorker.java:123)
 [drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:97)
 [drill-java-exec-1.9.0.jar:1.9.0]
        ... 5 common frames omitted
2017-04-28 16:59:11,741 [USER-rpc-event-queue] ERROR 
o.a.d.exec.server.rest.QueryWrapper - Query Failed
org.apache.drill.common.exceptions.UserRemoteException: UNSUPPORTED_OPERATION 
ERROR: This query cannot be planned possibly due to either a cartesian join or 
an inequality join


[Error Id: 672b4f2c-02a3-4004-af4b-279759c36c96 on mgelbana-incorta:31010]
        at 
org.apache.drill.exec.rpc.user.QueryResultHandler.resultArrived(QueryResultHandler.java:123)
 [drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.user.UserClient.handleReponse(UserClient.java:144) 
[drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:46)
 [drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:31)
 [drill-rpc-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.rpc.RpcBus.handle(RpcBus.java:65) 
[drill-rpc-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.rpc.RpcBus$RequestEvent.run(RpcBus.java:363) 
[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.common.SerializedExecutor$RunnableProcessor.run(SerializedExecutor.java:89)
 [drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$SameExecutor.execute(RpcBus.java:240) 
[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.common.SerializedExecutor.execute(SerializedExecutor.java:123) 
[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:274) 
[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:245) 
[drill-rpc-1.9.0.jar:1.9.0]
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
 [netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
 [netty-handler-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
 [netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
 [netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) 
[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
 [netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) 
[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) 
[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
 [netty-common-4.0.27.Final.jar:4.0.27.Final]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
2017-04-28 16:59:11,744 [qtp506972944-58] ERROR 
o.a.d.e.server.rest.QueryResources - Query from Web UI Failed
org.apache.drill.common.exceptions.UserRemoteException: UNSUPPORTED_OPERATION 
ERROR: This query cannot be planned possibly due to either a cartesian join or 
an inequality join


[Error Id: 672b4f2c-02a3-4004-af4b-279759c36c96 on mgelbana-incorta:31010]
        at 
org.apache.drill.exec.rpc.user.QueryResultHandler.resultArrived(QueryResultHandler.java:123)
 ~[drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.user.UserClient.handleReponse(UserClient.java:144) 
~[drill-java-exec-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:46)
 ~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:31)
 ~[drill-rpc-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.rpc.RpcBus.handle(RpcBus.java:65) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at org.apache.drill.exec.rpc.RpcBus$RequestEvent.run(RpcBus.java:363) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.common.SerializedExecutor$RunnableProcessor.run(SerializedExecutor.java:89)
 ~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$SameExecutor.execute(RpcBus.java:240) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.common.SerializedExecutor.execute(SerializedExecutor.java:123) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:274) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at 
org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:245) 
~[drill-rpc-1.9.0.jar:1.9.0]
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
 ~[netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
 ~[netty-handler-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
 ~[netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
 ~[netty-codec-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) 
~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
 ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) 
~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) 
~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
 ~[netty-common-4.0.27.Final.jar:4.0.27.Final]
        at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_121]{noformat}
And the following plan
{noformat}2017-04-28 16:50:25,355 
[26fca94f-d362-2a9a-32ed-da040ebc3d45:foreman] ERROR 
o.a.d.e.p.s.h.DefaultSqlHandler - Node 
[rel#166:Subset#13.PHYSICAL.SINGLETON([]).[]] could not be implemented; planner 
state:

Root: rel#166:Subset#13.PHYSICAL.SINGLETON([]).[]
Original rel:
AbstractConverter(subset=[rel#166:Subset#13.PHYSICAL.SINGLETON([]).[]], 
convention=[PHYSICAL], DrillDistributionTraitDef=[SINGLETON([])], sort=[[]]): 
rowcount = 2.147483647E9, cumulative cost = {inf}, id = 168
  DrillScreenRel(subset=[rel#165:Subset#13.LOGICAL.ANY([]).[]]): rowcount = 
2.147483647E9, cumulative cost = {2.1474836470000002E8 rows, 
2.1474836470000002E8 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 164
    DrillProjectRel(subset=[rel#163:Subset#12.LOGICAL.ANY([]).[]], UserID=[$0], 
UserID0=[$1]): rowcount = 2.147483647E9, cumulative cost = {0.0 rows, 0.0 cpu, 
0.0 io, 0.0 network, 0.0 memory}, id = 162
      DrillLimitRel(subset=[rel#161:Subset#11.LOGICAL.ANY([]).[]], 
fetch=[2147483647]): rowcount = 2.147483647E9, cumulative cost = {2.147483647E9 
rows, 8.589934588E9 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 160
        DrillJoinRel(subset=[rel#159:Subset#10.LOGICAL.ANY([]).[]], 
condition=[CAST(CASE(IS NULL($0), IS NULL($1), IS NULL($1), IS NULL($0), =($0, 
$1))):BOOLEAN NOT NULL], joinType=[inner]): rowcount = 2.147483647E9, 
cumulative cost = {4.294967294E9 rows, 0.0 cpu, 0.0 io, 0.0 network, 
1.8897856093600002E10 memory}, id = 158
          DrillLimitRel(subset=[rel#155:Subset#9.LOGICAL.ANY([]).[]], 
fetch=[2147483647]): rowcount = 2.147483647E9, cumulative cost = {2.147483647E9 
rows, 8.589934588E9 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 154
            DrillProjectRel(subset=[rel#153:Subset#8.LOGICAL.ANY([]).[]], 
UserID=['ABC']): rowcount = 10000.0, cumulative cost = {10000.0 rows, 40000.0 
cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 152
              DrillScanRel(subset=[rel#151:Subset#7.LOGICAL.ANY([]).[]], 
table=[[dfs, path_to_parquet_file]], groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
columns=[]]]): rowcount = 10000.0, cumulative cost = {10000.0 rows, 0.0 cpu, 
0.0 io, 0.0 network, 0.0 memory}, id = 85
          DrillLimitRel(subset=[rel#155:Subset#9.LOGICAL.ANY([]).[]], 
fetch=[2147483647]): rowcount = 2.147483647E9, cumulative cost = {2.147483647E9 
rows, 8.589934588E9 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 154
            DrillProjectRel(subset=[rel#153:Subset#8.LOGICAL.ANY([]).[]], 
UserID=['ABC']): rowcount = 10000.0, cumulative cost = {10000.0 rows, 40000.0 
cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 152
              DrillScanRel(subset=[rel#151:Subset#7.LOGICAL.ANY([]).[]], 
table=[[dfs, path_to_parquet_file]], groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
columns=[]]]): rowcount = 10000.0, cumulative cost = {10000.0 rows, 0.0 cpu, 
0.0 io, 0.0 network, 0.0 memory}, id = 85

Sets:
Set#7, type: RecordType()
        rel#151:Subset#7.LOGICAL.ANY([]).[], best=rel#85, 
importance=0.4782969000000001
                rel#85:DrillScanRel.LOGICAL.ANY([]).[](table=[dfs, 
path_to_parquet_file],groupscan=ParquetGroupScan [entries=[ReadEntryWithPath 
[path=file:path_to_parquet_file]], selectionRoot=file:path_to_parquet_file, 
numFiles=1, usedMetadataFile=false, columns=[]]), rowcount=10000.0, cumulative 
cost={tiny}
                
rel#211:AbstractConverter.LOGICAL.ANY([]).[](input=rel#210:Subset#7.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#214:AbstractConverter.LOGICAL.ANY([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
        rel#210:Subset#7.PHYSICAL.SINGLETON([]).[], best=rel#209, 
importance=0.4304672100000001
                
rel#212:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#209:ScanPrel.PHYSICAL.SINGLETON([]).[](groupscan=ParquetGroupScan 
[entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
columns=[]]), rowcount=10000.0, cumulative cost={10000.0 rows, 10000.0 cpu, 0.0 
io, 0.0 network, 0.0 memory}
                
rel#215:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#228:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[]),
 rowcount=10000.0, cumulative cost={20000.0 rows, 90000.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}
        rel#213:Subset#7.PHYSICAL.ANY([]).[], best=rel#209, 
importance=0.3874204890000001
                
rel#212:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#209:ScanPrel.PHYSICAL.SINGLETON([]).[](groupscan=ParquetGroupScan 
[entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
columns=[]]), rowcount=10000.0, cumulative cost={10000.0 rows, 10000.0 cpu, 0.0 
io, 0.0 network, 0.0 memory}
                
rel#215:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#216:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#217:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#210:Subset#7.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#228:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[]),
 rowcount=10000.0, cumulative cost={20000.0 rows, 90000.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}
Set#8, type: RecordType(CHAR(3) UserID)
        rel#153:Subset#8.LOGICAL.ANY([]).[], best=rel#152, importance=0.531441
                
rel#152:DrillProjectRel.LOGICAL.ANY([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],UserID='ABC'),
 rowcount=10000.0, cumulative cost={10001.0 rows, 40001.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}
                
rel#203:AbstractConverter.LOGICAL.ANY([]).[](input=rel#202:Subset#8.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#223:AbstractConverter.LOGICAL.ANY([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
        rel#202:Subset#8.PHYSICAL.SINGLETON([]).[], best=rel#218, 
importance=0.4782969000000001
                
rel#204:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#153:Subset#8.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#218:ProjectPrel.PHYSICAL.SINGLETON([]).[](input=rel#210:Subset#7.PHYSICAL.SINGLETON([]).[],UserID='ABC'),
 rowcount=10000.0, cumulative cost={20000.0 rows, 50000.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}
                
rel#224:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#241:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[]),
 rowcount=10000.0, cumulative cost={30000.0 rows, 130000.0 cpu, 0.0 io, 4.096E7 
network, 0.0 memory}
        rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[], best=rel#221, 
importance=0.4304672100000001
                
rel#225:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#153:Subset#8.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#226:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#202:Subset#8.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
 rowcount=10000.0, cumulative cost={inf}
                
rel#221:ProjectPrel.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],UserID='ABC'),
 rowcount=10000.0, cumulative cost={20000.0 rows, 50000.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}
Set#9, type: RecordType(CHAR(3) UserID)
        rel#155:Subset#9.LOGICAL.ANY([]).[], best=rel#154, 
importance=0.5904900000000001
                
rel#154:DrillLimitRel.LOGICAL.ANY([]).[](input=rel#153:Subset#8.LOGICAL.ANY([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={2.147493648E9 rows, 8.589974589E9 
cpu, 0.0 io, 0.0 network, 0.0 memory}
                
rel#207:AbstractConverter.LOGICAL.ANY([]).[](input=rel#206:Subset#9.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#206:Subset#9.PHYSICAL.SINGLETON([]).[], best=rel#205, 
importance=0.531441
                
rel#208:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#155:Subset#9.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#205:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#202:Subset#8.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={2.147503647E9 rows, 8.589984588E9 
cpu, 0.0 io, 0.0 network, 0.0 memory}
                
rel#248:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#247:Subset#15.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={6.442470941E9 rows, 3.4359788352E10 
cpu, 0.0 io, 8.796093018112E12 network, 0.0 memory}
Set#10, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
        rel#159:Subset#10.LOGICAL.ANY([]).[], best=rel#158, importance=0.6561
                
rel#158:DrillJoinRel.LOGICAL.ANY([]).[](left=rel#155:Subset#9.LOGICAL.ANY([]).[],right=rel#155:Subset#9.LOGICAL.ANY([]).[],condition=CAST(CASE(IS
 NULL($0), IS NULL($1), IS NULL($1), IS NULL($0), =($0, $1))):BOOLEAN NOT 
NULL,joinType=inner), rowcount=2.147483647E9, cumulative cost={8.58995459E9 
rows, 1.7179949178E10 cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
                
rel#187:AbstractConverter.LOGICAL.ANY([]).[](input=rel#186:Subset#10.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#186:Subset#10.PHYSICAL.SINGLETON([]).[], best=null, 
importance=0.5904900000000001
                
rel#188:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#159:Subset#10.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
Set#11, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
        rel#161:Subset#11.LOGICAL.ANY([]).[], best=rel#160, 
importance=0.7290000000000001
                
rel#160:DrillLimitRel.LOGICAL.ANY([]).[](input=rel#159:Subset#10.LOGICAL.ANY([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={1.0737438237E10 rows, 2.5769883766E10 
cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
                
rel#175:AbstractConverter.LOGICAL.ANY([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#191:AbstractConverter.LOGICAL.ANY([]).[](input=rel#190:Subset#11.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#174:Subset#11.PHYSICAL.ANY([]).[], best=null, importance=0.6561
                
rel#176:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#192:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#190:Subset#11.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#193:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#194:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#189:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#186:Subset#10.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#195:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#190:Subset#11.PHYSICAL.SINGLETON([]).[], best=null, 
importance=0.5904900000000001
                
rel#193:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#194:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#189:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#186:Subset#10.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#195:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[]),
 rowcount=2.147483647E9, cumulative cost={inf}
Set#12, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
        rel#163:Subset#12.LOGICAL.ANY([]).[], best=rel#162, importance=0.81
                
rel#162:DrillProjectRel.LOGICAL.ANY([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],UserID=$0,UserID0=$1),
 rowcount=2.147483647E9, cumulative cost={1.0737438238E10 rows, 2.5769883767E10 
cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
                
rel#170:AbstractConverter.LOGICAL.ANY([]).[](input=rel#169:Subset#12.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#179:AbstractConverter.LOGICAL.ANY([]).[](input=rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#169:Subset#12.PHYSICAL.SINGLETON([]).[], best=null, 
importance=0.7290000000000001
                
rel#171:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#163:Subset#12.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#180:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#183:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#198:ProjectPrel.PHYSICAL.SINGLETON([]).[](input=rel#190:Subset#11.PHYSICAL.SINGLETON([]).[],UserID=$0,UserID0=$1),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[], best=null, 
importance=0.6561
                
rel#181:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#163:Subset#12.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#182:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#169:Subset#12.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#177:ProjectPrel.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],UserID=$0,UserID0=$1),
 rowcount=2.147483647E9, cumulative cost={inf}
Set#13, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
        rel#165:Subset#13.LOGICAL.ANY([]).[], best=rel#164, importance=0.9
                
rel#164:DrillScreenRel.LOGICAL.ANY([]).[](input=rel#163:Subset#12.LOGICAL.ANY([]).[]),
 rowcount=2.147483647E9, cumulative cost={1.09521866027E10 rows, 
2.59846321317E10 cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
                
rel#167:AbstractConverter.LOGICAL.ANY([]).[](input=rel#166:Subset#13.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
        rel#166:Subset#13.PHYSICAL.SINGLETON([]).[], best=null, importance=1.0
                
rel#168:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#165:Subset#13.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
 rowcount=2.147483647E9, cumulative cost={inf}
                
rel#172:ScreenPrel.PHYSICAL.SINGLETON([]).[](input=rel#169:Subset#12.PHYSICAL.SINGLETON([]).[]),
 rowcount=2.147483647E9, cumulative cost={inf}
Set#14, type: RecordType(CHAR(3) UserID)
        rel#245:Subset#14.PHYSICAL.RANDOM_DISTRIBUTED([]).[], best=rel#242, 
importance=0.4304672100000001
                
rel#242:LimitPrel.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[],fetch=2147483647),
 rowcount=2.147483647E9, cumulative cost={2.147503647E9 rows, 8.589984588E9 
cpu, 0.0 io, 0.0 network, 0.0 memory}
Set#15, type: RecordType(CHAR(3) UserID)
        rel#247:Subset#15.PHYSICAL.SINGLETON([]).[], best=rel#246, 
importance=0.4782969000000001
                
rel#246:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#245:Subset#14.PHYSICAL.RANDOM_DISTRIBUTED([]).[]),
 rowcount=2.147483647E9, cumulative cost={4.294987294E9 rows, 2.5769853764E10 
cpu, 0.0 io, 8.796093018112E12 network, 0.0 memory}{noformat}


> Join query cannot be planned although all joins are enabled and 
> "planner.enable_nljoin_for_scalar_only" is disabled
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-5452
>                 URL: https://issues.apache.org/jira/browse/DRILL-5452
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.9.0, 1.10.0
>            Reporter: Muhammad Gelbana
>
> The following query
> {code:sql}
> SELECT * FROM (SELECT 'ABC' `UserID` FROM `dfs`.`path_to_parquet_file` tc 
> LIMIT 2147483647) `t0` INNER JOIN (SELECT 'ABC' `UserID` FROM 
> `dfs`.`path_to_parquet_file` tc LIMIT 2147483647) `t1` ON (`t0`.`UserID` IS 
> NOT DISTINCT FROM `t1`.`UserID`) LIMIT 2147483647{code}
> Leads to the following exception
> {noformat}2017-04-28 16:59:11,722 
> [26fca73f-92f0-4664-4dca-88bc48265c92:foreman] INFO  
> o.a.d.e.planner.sql.DrillSqlWorker - User Error Occurred
> org.apache.drill.common.exceptions.UserException: UNSUPPORTED_OPERATION 
> ERROR: This query cannot be planned possibly due to either a cartesian join 
> or an inequality join
> [Error Id: 672b4f2c-02a3-4004-af4b-279759c36c96 ]
>       at 
> org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543)
>  ~[drill-common-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:107)
>  [drill-java-exec-1.9.0.jar:1.9.0]
>       at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:1008) 
> [drill-java-exec-1.9.0.jar:1.9.0]
>       at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:264) 
> [drill-java-exec-1.9.0.jar:1.9.0]
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  [na:1.8.0_121]
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  [na:1.8.0_121]
>       at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
> Caused by: 
> org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException: This 
> query cannot be planned possibly due to either a cartesian join or an 
> inequality join
>       at 
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToPrel(DefaultSqlHandler.java:432)
>  ~[drill-java-exec-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:169)
>  ~[drill-java-exec-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.getPhysicalPlan(DrillSqlWorker.java:123)
>  [drill-java-exec-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:97)
>  [drill-java-exec-1.9.0.jar:1.9.0]
>       ... 5 common frames omitted
> 2017-04-28 16:59:11,741 [USER-rpc-event-queue] ERROR 
> o.a.d.exec.server.rest.QueryWrapper - Query Failed
> org.apache.drill.common.exceptions.UserRemoteException: UNSUPPORTED_OPERATION 
> ERROR: This query cannot be planned possibly due to either a cartesian join 
> or an inequality join
> [Error Id: 672b4f2c-02a3-4004-af4b-279759c36c96 on mgelbana-incorta:31010]
>       at 
> org.apache.drill.exec.rpc.user.QueryResultHandler.resultArrived(QueryResultHandler.java:123)
>  [drill-java-exec-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.user.UserClient.handleReponse(UserClient.java:144) 
> [drill-java-exec-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:46)
>  [drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:31)
>  [drill-rpc-1.9.0.jar:1.9.0]
>       at org.apache.drill.exec.rpc.RpcBus.handle(RpcBus.java:65) 
> [drill-rpc-1.9.0.jar:1.9.0]
>       at org.apache.drill.exec.rpc.RpcBus$RequestEvent.run(RpcBus.java:363) 
> [drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.common.SerializedExecutor$RunnableProcessor.run(SerializedExecutor.java:89)
>  [drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.RpcBus$SameExecutor.execute(RpcBus.java:240) 
> [drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.common.SerializedExecutor.execute(SerializedExecutor.java:123)
>  [drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:274) 
> [drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:245) 
> [drill-rpc-1.9.0.jar:1.9.0]
>       at 
> io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
>  [netty-codec-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
>  [netty-handler-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
>  [netty-codec-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
>  [netty-codec-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) 
> [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
>  [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) 
> [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) 
> [netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
>  [netty-common-4.0.27.Final.jar:4.0.27.Final]
>       at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
> 2017-04-28 16:59:11,744 [qtp506972944-58] ERROR 
> o.a.d.e.server.rest.QueryResources - Query from Web UI Failed
> org.apache.drill.common.exceptions.UserRemoteException: UNSUPPORTED_OPERATION 
> ERROR: This query cannot be planned possibly due to either a cartesian join 
> or an inequality join
> [Error Id: 672b4f2c-02a3-4004-af4b-279759c36c96 on mgelbana-incorta:31010]
>       at 
> org.apache.drill.exec.rpc.user.QueryResultHandler.resultArrived(QueryResultHandler.java:123)
>  ~[drill-java-exec-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.user.UserClient.handleReponse(UserClient.java:144) 
> ~[drill-java-exec-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:46)
>  ~[drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:31)
>  ~[drill-rpc-1.9.0.jar:1.9.0]
>       at org.apache.drill.exec.rpc.RpcBus.handle(RpcBus.java:65) 
> ~[drill-rpc-1.9.0.jar:1.9.0]
>       at org.apache.drill.exec.rpc.RpcBus$RequestEvent.run(RpcBus.java:363) 
> ~[drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.common.SerializedExecutor$RunnableProcessor.run(SerializedExecutor.java:89)
>  ~[drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.RpcBus$SameExecutor.execute(RpcBus.java:240) 
> ~[drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.common.SerializedExecutor.execute(SerializedExecutor.java:123)
>  ~[drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:274) 
> ~[drill-rpc-1.9.0.jar:1.9.0]
>       at 
> org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:245) 
> ~[drill-rpc-1.9.0.jar:1.9.0]
>       at 
> io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
>  ~[netty-codec-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
>  ~[netty-handler-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
>  ~[netty-codec-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
>  ~[netty-codec-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) 
> ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
>  ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) 
> ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) 
> ~[netty-transport-4.0.27.Final.jar:4.0.27.Final]
>       at 
> io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
>  ~[netty-common-4.0.27.Final.jar:4.0.27.Final]
>       at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_121]{noformat}
> And the following plan
> {noformat}2017-04-28 16:50:25,355 
> [26fca94f-d362-2a9a-32ed-da040ebc3d45:foreman] ERROR 
> o.a.d.e.p.s.h.DefaultSqlHandler - Node 
> [rel#166:Subset#13.PHYSICAL.SINGLETON([]).[]] could not be implemented; 
> planner state:
> Root: rel#166:Subset#13.PHYSICAL.SINGLETON([]).[]
> Original rel:
> AbstractConverter(subset=[rel#166:Subset#13.PHYSICAL.SINGLETON([]).[]], 
> convention=[PHYSICAL], DrillDistributionTraitDef=[SINGLETON([])], sort=[[]]): 
> rowcount = 2.147483647E9, cumulative cost = {inf}, id = 168
>   DrillScreenRel(subset=[rel#165:Subset#13.LOGICAL.ANY([]).[]]): rowcount = 
> 2.147483647E9, cumulative cost = {2.1474836470000002E8 rows, 
> 2.1474836470000002E8 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 164
>     DrillProjectRel(subset=[rel#163:Subset#12.LOGICAL.ANY([]).[]], 
> UserID=[$0], UserID0=[$1]): rowcount = 2.147483647E9, cumulative cost = {0.0 
> rows, 0.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 162
>       DrillLimitRel(subset=[rel#161:Subset#11.LOGICAL.ANY([]).[]], 
> fetch=[2147483647]): rowcount = 2.147483647E9, cumulative cost = 
> {2.147483647E9 rows, 8.589934588E9 cpu, 0.0 io, 0.0 network, 0.0 memory}, id 
> = 160
>         DrillJoinRel(subset=[rel#159:Subset#10.LOGICAL.ANY([]).[]], 
> condition=[CAST(CASE(IS NULL($0), IS NULL($1), IS NULL($1), IS NULL($0), 
> =($0, $1))):BOOLEAN NOT NULL], joinType=[inner]): rowcount = 2.147483647E9, 
> cumulative cost = {4.294967294E9 rows, 0.0 cpu, 0.0 io, 0.0 network, 
> 1.8897856093600002E10 memory}, id = 158
>           DrillLimitRel(subset=[rel#155:Subset#9.LOGICAL.ANY([]).[]], 
> fetch=[2147483647]): rowcount = 2.147483647E9, cumulative cost = 
> {2.147483647E9 rows, 8.589934588E9 cpu, 0.0 io, 0.0 network, 0.0 memory}, id 
> = 154
>             DrillProjectRel(subset=[rel#153:Subset#8.LOGICAL.ANY([]).[]], 
> UserID=['ABC']): rowcount = 10000.0, cumulative cost = {10000.0 rows, 40000.0 
> cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 152
>               DrillScanRel(subset=[rel#151:Subset#7.LOGICAL.ANY([]).[]], 
> table=[[dfs, path_to_parquet_file]], groupscan=[ParquetGroupScan 
> [entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
> selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
> columns=[]]]): rowcount = 10000.0, cumulative cost = {10000.0 rows, 0.0 cpu, 
> 0.0 io, 0.0 network, 0.0 memory}, id = 85
>           DrillLimitRel(subset=[rel#155:Subset#9.LOGICAL.ANY([]).[]], 
> fetch=[2147483647]): rowcount = 2.147483647E9, cumulative cost = 
> {2.147483647E9 rows, 8.589934588E9 cpu, 0.0 io, 0.0 network, 0.0 memory}, id 
> = 154
>             DrillProjectRel(subset=[rel#153:Subset#8.LOGICAL.ANY([]).[]], 
> UserID=['ABC']): rowcount = 10000.0, cumulative cost = {10000.0 rows, 40000.0 
> cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 152
>               DrillScanRel(subset=[rel#151:Subset#7.LOGICAL.ANY([]).[]], 
> table=[[dfs, path_to_parquet_file]], groupscan=[ParquetGroupScan 
> [entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
> selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
> columns=[]]]): rowcount = 10000.0, cumulative cost = {10000.0 rows, 0.0 cpu, 
> 0.0 io, 0.0 network, 0.0 memory}, id = 85
> Sets:
> Set#7, type: RecordType()
>       rel#151:Subset#7.LOGICAL.ANY([]).[], best=rel#85, 
> importance=0.4782969000000001
>               rel#85:DrillScanRel.LOGICAL.ANY([]).[](table=[dfs, 
> path_to_parquet_file],groupscan=ParquetGroupScan [entries=[ReadEntryWithPath 
> [path=file:path_to_parquet_file]], selectionRoot=file:path_to_parquet_file, 
> numFiles=1, usedMetadataFile=false, columns=[]]), rowcount=10000.0, 
> cumulative cost={tiny}
>               
> rel#211:AbstractConverter.LOGICAL.ANY([]).[](input=rel#210:Subset#7.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#214:AbstractConverter.LOGICAL.ANY([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>       rel#210:Subset#7.PHYSICAL.SINGLETON([]).[], best=rel#209, 
> importance=0.4304672100000001
>               
> rel#212:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#209:ScanPrel.PHYSICAL.SINGLETON([]).[](groupscan=ParquetGroupScan 
> [entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
> selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
> columns=[]]), rowcount=10000.0, cumulative cost={10000.0 rows, 10000.0 cpu, 
> 0.0 io, 0.0 network, 0.0 memory}
>               
> rel#215:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#228:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[]),
>  rowcount=10000.0, cumulative cost={20000.0 rows, 90000.0 cpu, 0.0 io, 0.0 
> network, 0.0 memory}
>       rel#213:Subset#7.PHYSICAL.ANY([]).[], best=rel#209, 
> importance=0.3874204890000001
>               
> rel#212:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#209:ScanPrel.PHYSICAL.SINGLETON([]).[](groupscan=ParquetGroupScan 
> [entries=[ReadEntryWithPath [path=file:path_to_parquet_file]], 
> selectionRoot=file:path_to_parquet_file, numFiles=1, usedMetadataFile=false, 
> columns=[]]), rowcount=10000.0, cumulative cost={10000.0 rows, 10000.0 cpu, 
> 0.0 io, 0.0 network, 0.0 memory}
>               
> rel#215:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#216:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#217:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#210:Subset#7.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#228:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[]),
>  rowcount=10000.0, cumulative cost={20000.0 rows, 90000.0 cpu, 0.0 io, 0.0 
> network, 0.0 memory}
> Set#8, type: RecordType(CHAR(3) UserID)
>       rel#153:Subset#8.LOGICAL.ANY([]).[], best=rel#152, importance=0.531441
>               
> rel#152:DrillProjectRel.LOGICAL.ANY([]).[](input=rel#151:Subset#7.LOGICAL.ANY([]).[],UserID='ABC'),
>  rowcount=10000.0, cumulative cost={10001.0 rows, 40001.0 cpu, 0.0 io, 0.0 
> network, 0.0 memory}
>               
> rel#203:AbstractConverter.LOGICAL.ANY([]).[](input=rel#202:Subset#8.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#223:AbstractConverter.LOGICAL.ANY([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>       rel#202:Subset#8.PHYSICAL.SINGLETON([]).[], best=rel#218, 
> importance=0.4782969000000001
>               
> rel#204:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#153:Subset#8.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#218:ProjectPrel.PHYSICAL.SINGLETON([]).[](input=rel#210:Subset#7.PHYSICAL.SINGLETON([]).[],UserID='ABC'),
>  rowcount=10000.0, cumulative cost={20000.0 rows, 50000.0 cpu, 0.0 io, 0.0 
> network, 0.0 memory}
>               
> rel#224:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#241:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[]),
>  rowcount=10000.0, cumulative cost={30000.0 rows, 130000.0 cpu, 0.0 io, 
> 4.096E7 network, 0.0 memory}
>       rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[], best=rel#221, 
> importance=0.4304672100000001
>               
> rel#225:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#153:Subset#8.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#226:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#202:Subset#8.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
>  rowcount=10000.0, cumulative cost={inf}
>               
> rel#221:ProjectPrel.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#213:Subset#7.PHYSICAL.ANY([]).[],UserID='ABC'),
>  rowcount=10000.0, cumulative cost={20000.0 rows, 50000.0 cpu, 0.0 io, 0.0 
> network, 0.0 memory}
> Set#9, type: RecordType(CHAR(3) UserID)
>       rel#155:Subset#9.LOGICAL.ANY([]).[], best=rel#154, 
> importance=0.5904900000000001
>               
> rel#154:DrillLimitRel.LOGICAL.ANY([]).[](input=rel#153:Subset#8.LOGICAL.ANY([]).[],fetch=2147483647),
>  rowcount=2.147483647E9, cumulative cost={2.147493648E9 rows, 8.589974589E9 
> cpu, 0.0 io, 0.0 network, 0.0 memory}
>               
> rel#207:AbstractConverter.LOGICAL.ANY([]).[](input=rel#206:Subset#9.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>       rel#206:Subset#9.PHYSICAL.SINGLETON([]).[], best=rel#205, 
> importance=0.531441
>               
> rel#208:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#155:Subset#9.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#205:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#202:Subset#8.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
>  rowcount=2.147483647E9, cumulative cost={2.147503647E9 rows, 8.589984588E9 
> cpu, 0.0 io, 0.0 network, 0.0 memory}
>               
> rel#248:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#247:Subset#15.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
>  rowcount=2.147483647E9, cumulative cost={6.442470941E9 rows, 3.4359788352E10 
> cpu, 0.0 io, 8.796093018112E12 network, 0.0 memory}
> Set#10, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
>       rel#159:Subset#10.LOGICAL.ANY([]).[], best=rel#158, importance=0.6561
>               
> rel#158:DrillJoinRel.LOGICAL.ANY([]).[](left=rel#155:Subset#9.LOGICAL.ANY([]).[],right=rel#155:Subset#9.LOGICAL.ANY([]).[],condition=CAST(CASE(IS
>  NULL($0), IS NULL($1), IS NULL($1), IS NULL($0), =($0, $1))):BOOLEAN NOT 
> NULL,joinType=inner), rowcount=2.147483647E9, cumulative cost={8.58995459E9 
> rows, 1.7179949178E10 cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
>               
> rel#187:AbstractConverter.LOGICAL.ANY([]).[](input=rel#186:Subset#10.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>       rel#186:Subset#10.PHYSICAL.SINGLETON([]).[], best=null, 
> importance=0.5904900000000001
>               
> rel#188:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#159:Subset#10.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
> Set#11, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
>       rel#161:Subset#11.LOGICAL.ANY([]).[], best=rel#160, 
> importance=0.7290000000000001
>               
> rel#160:DrillLimitRel.LOGICAL.ANY([]).[](input=rel#159:Subset#10.LOGICAL.ANY([]).[],fetch=2147483647),
>  rowcount=2.147483647E9, cumulative cost={1.0737438237E10 rows, 
> 2.5769883766E10 cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
>               
> rel#175:AbstractConverter.LOGICAL.ANY([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#191:AbstractConverter.LOGICAL.ANY([]).[](input=rel#190:Subset#11.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>       rel#174:Subset#11.PHYSICAL.ANY([]).[], best=null, importance=0.6561
>               
> rel#176:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#192:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#190:Subset#11.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#193:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#194:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#189:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#186:Subset#10.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#195:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>       rel#190:Subset#11.PHYSICAL.SINGLETON([]).[], best=null, 
> importance=0.5904900000000001
>               
> rel#193:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#194:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#189:LimitPrel.PHYSICAL.SINGLETON([]).[](input=rel#186:Subset#10.PHYSICAL.SINGLETON([]).[],fetch=2147483647),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#195:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
> Set#12, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
>       rel#163:Subset#12.LOGICAL.ANY([]).[], best=rel#162, importance=0.81
>               
> rel#162:DrillProjectRel.LOGICAL.ANY([]).[](input=rel#161:Subset#11.LOGICAL.ANY([]).[],UserID=$0,UserID0=$1),
>  rowcount=2.147483647E9, cumulative cost={1.0737438238E10 rows, 
> 2.5769883767E10 cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
>               
> rel#170:AbstractConverter.LOGICAL.ANY([]).[](input=rel#169:Subset#12.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#179:AbstractConverter.LOGICAL.ANY([]).[](input=rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>       rel#169:Subset#12.PHYSICAL.SINGLETON([]).[], best=null, 
> importance=0.7290000000000001
>               
> rel#171:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#163:Subset#12.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#180:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#183:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#198:ProjectPrel.PHYSICAL.SINGLETON([]).[](input=rel#190:Subset#11.PHYSICAL.SINGLETON([]).[],UserID=$0,UserID0=$1),
>  rowcount=2.147483647E9, cumulative cost={inf}
>       rel#178:Subset#12.PHYSICAL.RANDOM_DISTRIBUTED([]).[], best=null, 
> importance=0.6561
>               
> rel#181:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#163:Subset#12.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#182:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#169:Subset#12.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#177:ProjectPrel.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#174:Subset#11.PHYSICAL.ANY([]).[],UserID=$0,UserID0=$1),
>  rowcount=2.147483647E9, cumulative cost={inf}
> Set#13, type: RecordType(CHAR(3) UserID, CHAR(3) UserID0)
>       rel#165:Subset#13.LOGICAL.ANY([]).[], best=rel#164, importance=0.9
>               
> rel#164:DrillScreenRel.LOGICAL.ANY([]).[](input=rel#163:Subset#12.LOGICAL.ANY([]).[]),
>  rowcount=2.147483647E9, cumulative cost={1.09521866027E10 rows, 
> 2.59846321317E10 cpu, 0.0 io, 0.0 network, 1.8897856093600002E10 memory}
>               
> rel#167:AbstractConverter.LOGICAL.ANY([]).[](input=rel#166:Subset#13.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>       rel#166:Subset#13.PHYSICAL.SINGLETON([]).[], best=null, importance=1.0
>               
> rel#168:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#165:Subset#13.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
>               
> rel#172:ScreenPrel.PHYSICAL.SINGLETON([]).[](input=rel#169:Subset#12.PHYSICAL.SINGLETON([]).[]),
>  rowcount=2.147483647E9, cumulative cost={inf}
> Set#14, type: RecordType(CHAR(3) UserID)
>       rel#245:Subset#14.PHYSICAL.RANDOM_DISTRIBUTED([]).[], best=rel#242, 
> importance=0.4304672100000001
>               
> rel#242:LimitPrel.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#222:Subset#8.PHYSICAL.RANDOM_DISTRIBUTED([]).[],fetch=2147483647),
>  rowcount=2.147483647E9, cumulative cost={2.147503647E9 rows, 8.589984588E9 
> cpu, 0.0 io, 0.0 network, 0.0 memory}
> Set#15, type: RecordType(CHAR(3) UserID)
>       rel#247:Subset#15.PHYSICAL.SINGLETON([]).[], best=rel#246, 
> importance=0.4782969000000001
>               
> rel#246:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#245:Subset#14.PHYSICAL.RANDOM_DISTRIBUTED([]).[]),
>  rowcount=2.147483647E9, cumulative cost={4.294987294E9 rows, 2.5769853764E10 
> cpu, 0.0 io, 8.796093018112E12 network, 0.0 memory}{noformat}
> When I removed the limits, the query kept running for like 30 minutes and 
> didn't finish though.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to