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 E555710C89 for ; Sun, 4 Jan 2015 21:11:33 +0000 (UTC) Received: (qmail 51698 invoked by uid 500); 4 Jan 2015 21:11:34 -0000 Delivered-To: apmail-drill-dev-archive@drill.apache.org Received: (qmail 51631 invoked by uid 500); 4 Jan 2015 21:11:34 -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 51583 invoked by uid 99); 4 Jan 2015 21:11:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jan 2015 21:11:34 +0000 Date: Sun, 4 Jan 2015 21:11:34 +0000 (UTC) From: "Jacques Nadeau (JIRA)" To: dev@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (DRILL-1450) Window function when window definition does not have order by clause would hit assertion error. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DRILL-1450?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Nadeau resolved DRILL-1450. ----------------------------------- Resolution: Won't Fix This will be fixed once other items are fixed. In meantime, we need to disable window functionality. > Window function when window definition does not have order by clause would hit assertion error. > ------------------------------------------------------------------------------------------------ > > Key: DRILL-1450 > URL: https://issues.apache.org/jira/browse/DRILL-1450 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Reporter: Jinfeng Ni > > This query will hit as > Q1: > select sum(position_id) over w from cp.`employee.json` window w as ( partition by position_id) > Stack trace: > java.lang.AssertionError > at org.eigenbase.sql.validate.SqlValidatorUtil.lookup(SqlValidatorUtil.java:242) ~[optiq-core-0.9-drill-r3.jar:na] > at org.eigenbase.sql.SqlIdentifier.getMonotonicity(SqlIdentifier.java:261) ~[optiq-core-0.9-drill-r3.jar:na] > at org.eigenbase.sql.validate.SelectScope.getMonotonicity(SelectScope.java:149) ~[optiq-core-0.9-drill-r3.jar:na] > at org.eigenbase.sql.SqlWindow.isTableSorted(SqlWindow.java:340) ~[optiq-core-0.9-drill-r3.jar:na] > at org.eigenbase.sql.SqlWindow.validate(SqlWindow.java:561) ~[optiq-core-0.9-drill-r3.jar:na] > The cause of this issue is the star column in schema-less system. Drill currently will by default add "*" to a schema-less table. In optiq, * would be expanded to a list of regular columns if table is schema-aware, but does not expand for schema-less table (That's the behavior starting from optiq 0.9-drill-r2). That would cause issue in some optiq code logic, since it does not expect * ( should already be expanded). > For Q1, we could remove the logic of adding * by default to schema-less table, and it would work fine. However, if the query explicitly ask for *, then still, run into similar problem: > Q2: > select *, sum(position_id) over w from cp.`employee.json` window w as ( partition by position_id) > Therefore, the fix had better to be in Optiq. > -- This message was sent by Atlassian JIRA (v6.3.4#6332)