Return-Path: X-Original-To: apmail-drill-issues-archive@minotaur.apache.org Delivered-To: apmail-drill-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6313018A84 for ; Tue, 10 Nov 2015 20:04:11 +0000 (UTC) Received: (qmail 85600 invoked by uid 500); 10 Nov 2015 20:04:11 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 85535 invoked by uid 500); 10 Nov 2015 20:04:11 -0000 Mailing-List: contact issues-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 issues@drill.apache.org Received: (qmail 85481 invoked by uid 99); 10 Nov 2015 20:04:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2015 20:04:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 17FE82C1F61 for ; Tue, 10 Nov 2015 20:04:11 +0000 (UTC) Date: Tue, 10 Nov 2015 20:04:11 +0000 (UTC) From: "Krystal (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DRILL-4062) SUM function does not work against interval data type from csv or json files 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-4062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Krystal updated DRILL-4062: --------------------------- Labels: interval (was: ) > SUM function does not work against interval data type from csv or json files > ---------------------------------------------------------------------------- > > Key: DRILL-4062 > URL: https://issues.apache.org/jira/browse/DRILL-4062 > Project: Apache Drill > Issue Type: Bug > Components: Functions - Drill > Reporter: Krystal > Labels: interval > > I have a csv table with the following interval year data: > select columns[1] from `interval_data.csv`; > +---------+ > | EXPR$0 | > +---------+ > | P12Y | > | P152Y | > | P-152Y | > | P5Y | > | P10Y | > | P0Y | > | P-50Y | > | P12Y | > | P152Y | > +---------+ > I got an exception when trying to use the SUM function against the data: > select sum(cast(columns[1] as interval year)) from `interval_data.csv`; > Error: VALIDATION ERROR: From line 1, column 8 to line 1, column 45: Cannot apply 'SUM' to arguments of type 'SUM()'. Supported form(s): 'SUM()' > Same error is encountered for same data from JSON file. > This works for interval data from parquet file: > ./parquet-schema ../interval_data.parquet > message root { > optional int32 c_row; > optional fixed_len_byte_array(12) c_interval_year; > optional fixed_len_byte_array(12) c_interval_month; > optional fixed_len_byte_array(12) c_interval_day; > optional fixed_len_byte_array(12) c_interval_hour; > optional fixed_len_byte_array(12) c_interval_minute; > optional fixed_len_byte_array(12) c_interval_second; > optional binary c_interval (UTF8); > optional int32 c_time; > optional int32 c_date; > optional int64 c_timestamp; > } > select sum(c_interval_year) from `interval_data.parquet`; > +---------+ > | EXPR$0 | > +---------+ > | P1692M | > +---------+ -- This message was sent by Atlassian JIRA (v6.3.4#6332)