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 1DC68200C22 for ; Tue, 7 Feb 2017 02:05:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1C319160B62; Tue, 7 Feb 2017 01:05:13 +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 622AD160B56 for ; Tue, 7 Feb 2017 02:05:12 +0100 (CET) Received: (qmail 25431 invoked by uid 500); 7 Feb 2017 01:05:11 -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 25419 invoked by uid 99); 7 Feb 2017 01:05:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2017 01:05:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9744D1849C6 for ; Tue, 7 Feb 2017 01:05:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.02 X-Spam-Level: X-Spam-Status: No, score=-0.02 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id WGYsWpfCanxY for ; Tue, 7 Feb 2017 01:05:09 +0000 (UTC) Received: from mail-pg0-f50.google.com (mail-pg0-f50.google.com [74.125.83.50]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 202F85FAF3 for ; Tue, 7 Feb 2017 01:05:09 +0000 (UTC) Received: by mail-pg0-f50.google.com with SMTP id 194so33114747pgd.2 for ; Mon, 06 Feb 2017 17:05:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Kq2hHAgjvcAda+5+5DkFWQsOaWNXXKGs49rNBF2zlIQ=; b=V8b5Ivk4tJXk2SedDuH38IDF5DJJIwYH3qARBR8MtTFYj2SljhsY/9gY+tAIn4+yLF Z9WpKOgt1jNG2sE1ZnFPdks7f/kH33oW4tjb6wbLF/pSAy4eyTDmP6HhKfIQirqnOzXj 2OgpFVr5ksjcVoudjTicaSh90+5HZn8D1QOT/O8qAUvfrcIyqB7s56+Z0JNrhLcwrBTr yNbS02sJeY6yeM3ZwIbxocBo91YyJ9i5Zuq92uaigA+PLwIoPFLu55+VjlEA+qSGQ0ex 99tKaMwyA3DU/arbOgKECM/vr2Afor9+blCqh1Iu1cc12n7lGsv+OtEBth3TS+ZJo7pA A03Q== X-Gm-Message-State: AIkVDXLULg/HcR5w1ep6hmisXpTvzYdoN+I33g4IeScTCUJ9JxaEZsVYzFSv/hZuiNj5IA== X-Received: by 10.84.175.74 with SMTP id s68mr21742629plb.155.1486429499510; Mon, 06 Feb 2017 17:04:59 -0800 (PST) Received: from [10.22.16.73] ([192.175.27.10]) by smtp.gmail.com with ESMTPSA id v186sm5433488pgv.44.2017.02.06.17.04.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Feb 2017 17:04:58 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: Null literals in AggregateReduceFunctionsRule From: Julian Hyde In-Reply-To: Date: Mon, 6 Feb 2017 17:04:57 -0800 Cc: Timo Walther Content-Transfer-Encoding: quoted-printable Message-Id: References: To: dev@calcite.apache.org X-Mailer: Apple Mail (2.3251) archived-at: Tue, 07 Feb 2017 01:05:13 -0000 Adding a cast around the null literal makes sense. I would use = =E2=80=9CrexBuilder.makeCast(type, constantNull())=E2=80=9D rather than = =E2=80=9CrexBuilder.makeNullLiteral(type.getSqlTypeName())=E2=80=9D = because there=E2=80=99s a chance that the type needs precision & scale. Can you please create a Calcite jira case and submit a pull request? And by the way, I think I see similar patterns in = AggregateExpandDistinctAggregatesRule, AggregateValuesRule and even = RexBuilder.makeOver. Julian > On Feb 2, 2017, at 12:57 AM, Anton Mushin = wrote: >=20 > Hello community, > I have worked for support standard deviation/variance functions in = Flink SQL [1] and I got exception " Type NULL is not supported. Null = values must have a supported type.".=20 > I started search root cause and found what problem come up from = AggregateReduceFunctionsRule[2]. @twalthr confirmed it after[3]. >=20 > Now I have been used WA - the copy AggregateReduceFunctionsRule inside = Flink with changes. > Could we resolve the problem some way? > I look forward to your reply. >=20 > [1] https://issues.apache.org/jira/browse/FLINK-4604# > [2] = https://issues.apache.org/jira/browse/FLINK-4604?focusedCommentId=3D156152= 80&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel= #comment-15615280 > [3] = https://issues.apache.org/jira/browse/FLINK-4604?focusedCommentId=3D156676= 97&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel= #comment-15667697 >=20 > Regards, > Anton Mushin >=20