Return-Path: X-Original-To: apmail-drill-dev-archive@www.apache.org Delivered-To: apmail-drill-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CA08B17F4D for ; Fri, 6 Mar 2015 18:17:39 +0000 (UTC) Received: (qmail 55539 invoked by uid 500); 6 Mar 2015 18:17:38 -0000 Delivered-To: apmail-drill-dev-archive@drill.apache.org Received: (qmail 55425 invoked by uid 500); 6 Mar 2015 18:17:38 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 55150 invoked by uid 99); 6 Mar 2015 18:17:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Mar 2015 18:17:38 +0000 Date: Fri, 6 Mar 2015 18:17:38 +0000 (UTC) From: "Victoria Markman (JIRA)" To: dev@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (DRILL-2396) Query with IS [NOT] DISTINCT FROM in join filter fails during execution if planner.slice_target=1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Victoria Markman created DRILL-2396: --------------------------------------- Summary: Query with IS [NOT] DISTINCT FROM in join filter fails during execution if planner.slice_target=1 Key: DRILL-2396 URL: https://issues.apache.org/jira/browse/DRILL-2396 Project: Apache Drill Issue Type: Bug Components: Execution - Flow Reporter: Victoria Markman Assignee: Chris Westin -- Works {code} select count(*) from j1 inner join j2 ON (j1.c_integer = j2.c_integer) where j1.c_bigint IS NOT DISTINCT FROM j2.c_bigint; {code} -- Explain plan {code} 00-01 StreamAgg(group=[{}], EXPR$0=[COUNT()]) 00-02 Project($f0=[0]) 00-03 SelectionVectorRemover 00-04 Filter(condition=[CAST(CASE(IS NULL($1), IS NULL($3), IS NULL($3), IS NULL($1), =($1, $3))):BOOLEAN NOT NULL]) 00-05 HashJoin(condition=[=($0, $2)], joinType=[inner]) 00-07 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/joins/j1]], selectionRoot=/joins/j1, numFiles=1, columns=[`c_integer`, `c_bigint`]]]) 00-06 Project(c_integer0=[$0], c_bigint0=[$1]) 00-08 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/joins/j2]], selectionRoot=/joins/j2, numFiles=1, columns=[`c_integer`, `c_bigint`]]]) {code} Fails during execution if you set : alter system set `planner.slice_target` = 1; {code} 0: jdbc:drill:schema=dfs> select . . . . . . . . . . . . > count(*) . . . . . . . . . . . . > from j1 inner join j2 ON . . . . . . . . . . . . > (j1.c_integer = j2.c_integer) . . . . . . . . . . . . > where . . . . . . . . . . . . > j1.c_bigint IS NOT DISTINCT FROM j2.c_bigint; Query failed: RemoteRpcException: Failure while trying to start remote fragment, Expression has syntax error! line 1:196:no viable alternative at input 'BIT' [ b916d1b0-7cfa-48ad-b5dd-2aadf955857c on atsqa4-133.qa.lab:31010 ] {code} Explain plan: {code} 00-01 StreamAgg(group=[{}], EXPR$0=[$SUM0($0)]) 00-02 UnionExchange 01-01 StreamAgg(group=[{}], EXPR$0=[COUNT()]) 01-02 Project($f0=[0]) 01-03 SelectionVectorRemover 01-04 Filter(condition=[CAST(CASE(IS NULL($1), IS NULL($3), IS NULL($3), IS NULL($1), =($1, $3))):BOOLEAN NOT NULL]) 01-05 HashJoin(condition=[=($0, $2)], joinType=[inner]) 01-07 HashToRandomExchange(dist0=[[$0]]) 02-01 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/joins/j1]], selectionRoot=/joins/j1, numFiles=1, columns=[`c_integer`, `c_bigint`]]]) 01-06 Project(c_integer0=[$0], c_bigint0=[$1]) 01-08 HashToRandomExchange(dist0=[[$0]]) 03-01 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/joins/j2]], selectionRoot=/joins/j2, numFiles=1, columns=[`c_integer`, `c_bigint`]]]) {code} -- If you remove join, query works correctly {code} 0: jdbc:drill:schema=dfs> select count(*) from j1 where c_bigint is not distinct from c_integer; +------------+ | EXPR$0 | +------------+ | 10000 | +------------+ 1 row selected (0.137 seconds) {code} Explain plan: {code} 00-01 StreamAgg(group=[{}], EXPR$0=[$SUM0($0)]) 00-02 StreamAgg(group=[{}], EXPR$0=[COUNT()]) 00-03 Project($f0=[0]) 00-04 SelectionVectorRemover 00-05 Filter(condition=[CAST(CASE(IS NULL($0), IS NULL($1), IS NULL($1), IS NULL($0), =($0, $1))):BOOLEAN NOT NULL]) 00-06 Project(c_bigint=[$1], c_integer=[$0]) 00-07 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/joins/j1]], selectionRoot=/joins/j1, numFiles=1, columns=[`c_bigint`, `c_integer`]]]) {code} drillbit.log {code} 2015-03-06 18:11:14,455 [BitServer-5] ERROR o.a.d.exec.rpc.control.ControlServer - Error 6e9b6998-d020-456f-822c-32a5ff2e764b: Failure while trying to start remote fragment org.apache.drill.exec.rpc.UserRpcException: org.apache.drill.common.exceptions.ExpressionParsingException: Expression has syntax error! line 1:196:no viable alternative at input 'BIT' at org.apache.drill.exec.work.batch.ControlHandlerImpl.startNewRemoteFragment(ControlHandlerImpl.java:139) ~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT] at org.apache.drill.exec.work.batch.ControlHandlerImpl.handle(ControlHandlerImpl.java:99) ~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT] at org.apache.drill.exec.rpc.control.ControlServer.handle(ControlServer.java:60) ~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT] at org.apache.drill.exec.rpc.control.ControlServer.handle(ControlServer.java:38) ~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT] at org.apache.drill.exec.rpc.RpcBus.handle(RpcBus.java:58) ~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT] at org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:194) [drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT] at org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:173) [drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) [netty-codec-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-codec-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:161) [netty-codec-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-transport-4.0.24.Final.jar:4.0.24.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-common-4.0.24.Final.jar:4.0.24.Final] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71] {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)