Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8E7B5200B98 for ; Mon, 3 Oct 2016 17:25:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8D133160ADC; Mon, 3 Oct 2016 15:25:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D4071160ACC for ; Mon, 3 Oct 2016 17:25:23 +0200 (CEST) Received: (qmail 71054 invoked by uid 500); 3 Oct 2016 15:25:22 -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 70914 invoked by uid 99); 3 Oct 2016 15:25:22 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Oct 2016 15:25:22 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1AE432C2A6A for ; Mon, 3 Oct 2016 15:25:22 +0000 (UTC) Date: Mon, 3 Oct 2016 15:25:22 +0000 (UTC) From: "Jinfeng Ni (JIRA)" To: dev@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (DRILL-4924) Can not use case expression within an IN predicate. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 03 Oct 2016 15:25:24 -0000 [ https://issues.apache.org/jira/browse/DRILL-4924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jinfeng Ni resolved DRILL-4924. ------------------------------- Resolution: Won't Fix > Can not use case expression within an IN predicate. > --------------------------------------------------- > > Key: DRILL-4924 > URL: https://issues.apache.org/jira/browse/DRILL-4924 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Affects Versions: 1.9.0 > Reporter: Khurram Faraaz > > Can not use case expression within an IN predicate. > Drill 1.9.0 git commit ID: f3c26e34 > Similar query works on Postgres 9.3 > {noformat} > postgres=# select * from t1 where c1 in ( select case when c1=2 then 30 else c1 end); > c1 | c2 > ----+----- > 1 | 0 > 3 | 19 > -1 | 11 > 5 | 13 > 10 | 17 > 11 | -1 > 13 | 1 > 17 | 20 > 0 | 9 > 19 | 100 > (10 rows) > {noformat} > Drill 1.9.0 returns an error > {noformat} > 0: jdbc:drill:schema=dfs.tmp> select * from `emp_tbl` where id IN ( SELECT CASE WHEN id=2 THEN 30 else id end ); > Error: PARSE ERROR: Encountered ")" at line 1, column 81. > Was expecting one of: > "FROM" ... > "," ... > "AS" ... > ... > ... > ... > ... > ... > "NOT" ... > "IN" ... > "BETWEEN" ... > "LIKE" ... > "SIMILAR" ... > "=" ... > ">" ... > "<" ... > "<=" ... > ">=" ... > "<>" ... > "+" ... > "-" ... > "*" ... > "/" ... > "||" ... > "AND" ... > "OR" ... > "IS" ... > "MEMBER" ... > "SUBMULTISET" ... > "MULTISET" ... > "[" ... > SQL Query select * from `emp_tbl` where id IN ( SELECT CASE WHEN id=2 THEN 30 else id end ) > ^ > [Error Id: e6c3f120-8776-476e-8df7-7ef30f6b7307 on centos-01.qa.lab:31010] (state=,code=0) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)