Return-Path: X-Original-To: apmail-calcite-dev-archive@www.apache.org Delivered-To: apmail-calcite-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 245B418356 for ; Tue, 8 Dec 2015 02:43:23 +0000 (UTC) Received: (qmail 94029 invoked by uid 500); 8 Dec 2015 02:43:23 -0000 Delivered-To: apmail-calcite-dev-archive@calcite.apache.org Received: (qmail 93954 invoked by uid 500); 8 Dec 2015 02:43:22 -0000 Mailing-List: contact dev-help@calcite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@calcite.apache.org Delivered-To: mailing list dev@calcite.apache.org Received: (qmail 93941 invoked by uid 99); 8 Dec 2015 02:43:22 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2015 02:43:22 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 1B893C1335 for ; Tue, 8 Dec 2015 02:43:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.898 X-Spam-Level: ** X-Spam-Status: No, score=2.898 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 2-hFGCArl0m9 for ; Tue, 8 Dec 2015 02:43:20 +0000 (UTC) Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id BD1D842BA9 for ; Tue, 8 Dec 2015 02:43:19 +0000 (UTC) Received: by pfbg73 with SMTP id g73so4112328pfb.1 for ; Mon, 07 Dec 2015 18:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-type; bh=M3Rh+RLxJMXFc9v92plNFiwB4rUgOPoQ0SufxrSWKl8=; b=UEim2Xmz0pTubb4BlbKl7EY/HTYOi8gmVB+/xcywqXqkagMe5cGQEf9dCuJ8viI1oe CaR5PmRhYTdUnO5poYCtchqQiAHedP0NOsoCTPgEV5JS6CSYIq4DJREzu9t3IelC23wK Nu+z/oMVJMypz/cEk17RHFJFJKwDVdIMpa1V8n0lKPfWlBz8j7fYXm+ZzfPTa15qB+QR Ownq6LlOKqkPiYWsdo+AHvd1WXRsceUPMkkk4qbatnn00r18w3YyeDIFcjwteSD7KwOW lyYZMIOq08Rz5wbNgDWUuppeB2r4sGVuObezeLvycS2LnJMVzv20X7/6rh3EqziNyEZs QKhw== X-Received: by 10.98.11.153 with SMTP id 25mr1590088pfl.102.1449542593475; Mon, 07 Dec 2015 18:43:13 -0800 (PST) Received: from huweideMacBook-Pro.local ([103.251.128.90]) by smtp.gmail.com with ESMTPSA id 134sm773473pfa.30.2015.12.07.18.43.12 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 18:43:12 -0800 (PST) To: dev@calcite.apache.org From: DroopyHoo Subject: May be something wrong with NOT IN clause? Message-ID: <566643BE.3030105@gmail.com> Date: Tue, 8 Dec 2015 10:43:10 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------050707080801090001040109" --------------050707080801090001040109 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, I met some problem when using NOT IN clause. first I am testing Apache Kylin which depends on calcite, it throws NullPoint Exception, when NOT IN (x1, x2, x3) the error stack is: Caused by: java.lang.NullPointerException at Baz$1$1.moveNext(ANONYMOUS.java:57) at org.apache.calcite.linq4j.EnumerableDefaults.groupBy_(EnumerableDefaults.java:731) at org.apache.calcite.linq4j.EnumerableDefaults.groupBy(EnumerableDefaults.java:677) at org.apache.calcite.linq4j.DefaultEnumerable.groupBy(DefaultEnumerable.java:301) at Baz.bind(Baz.java:80) at org.apache.calcite.jdbc.CalcitePrepare$CalciteSignature.enumerable(CalcitePrepare.java:281) at org.apache.calcite.jdbc.CalciteConnectionImpl.enumerable(CalciteConnectionImpl.java:235) at org.apache.calcite.jdbc.CalciteMetaImpl.createIterable(CalciteMetaImpl.java:476) at org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:184) at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:63) at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:42) at org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:473) at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:508) at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:477) at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:109) ... 85 more then , I adjust the test case ,and found if the elements number in NOT IN clause is One , it will work, otherwise it will throw exception. finally I write a simple in-memory data adapter to test , another weird thing occurs, no exception, only the first and second elements in NOT IN clause are effective Sql statement is: SELECT t0.\"name\" dp0, t0.\"score\" m0 FROM \"TABLE1\" t0 WHERE t0.\"score\" NOT IN (88,90,89) LIMIT 20001 The result is: 89 80 80 80 80 I have tried both calcite 1.4 and 1.5 -- ------- Wei Hu --------------050707080801090001040109--