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 EBC4B11A23 for ; Mon, 21 Jul 2014 23:03:02 +0000 (UTC) Received: (qmail 23714 invoked by uid 500); 21 Jul 2014 23:03:02 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 23689 invoked by uid 500); 21 Jul 2014 23:03:02 -0000 Mailing-List: contact issues-help@drill.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.incubator.apache.org Delivered-To: mailing list issues@drill.incubator.apache.org Received: (qmail 23680 invoked by uid 99); 21 Jul 2014 23:03:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2014 23:03:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 21 Jul 2014 23:03:04 +0000 Received: (qmail 21885 invoked by uid 99); 21 Jul 2014 23:02:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2014 23:02:38 +0000 Date: Mon, 21 Jul 2014 23:02:38 +0000 (UTC) From: "Krystal (JIRA)" To: issues@drill.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (DRILL-1165) Cast a varchar timestamp into date fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Krystal created DRILL-1165: ------------------------------ Summary: Cast a varchar timestamp into date fails Key: DRILL-1165 URL: https://issues.apache.org/jira/browse/DRILL-1165 Project: Apache Drill Issue Type: Bug Components: Functions - Drill Reporter: Krystal git.commit.id.abbrev=e5c2da0 I have the following varchar data casted as timestamp: 0: jdbc:drill:schema=dfs> select cast(create_time as timestamp) from student where student_id=15; +------------+ | EXPR$0 | +------------+ | 2014-11-12 12:38:15.0 | I can cast the varchar data to a date: 0: jdbc:drill:schema=dfs> select cast(create_time as date) from student where student_id=15; +------------+ | EXPR$0 | +------------+ | 2014-11-12 | +------------+ However, it fails when I tried to cast it to a time: 0: jdbc:drill:schema=dfs> select cast(create_time as time) from student where student_id=15; message: "Failure while running fragment. < IllegalArgumentException:[ Invalid format: "2014-11-12 12:38:15" is malformed at "14-11-12 12:38:15" ]" If it works for date, it should work for time. This query returned the time portion of the string when executed from postgres. -- This message was sent by Atlassian JIRA (v6.2#6252)