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 3C63F179C4 for ; Tue, 20 Oct 2015 22:03:28 +0000 (UTC) Received: (qmail 87073 invoked by uid 500); 20 Oct 2015 22:03:28 -0000 Delivered-To: apmail-drill-dev-archive@drill.apache.org Received: (qmail 86953 invoked by uid 500); 20 Oct 2015 22:03:27 -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 86902 invoked by uid 99); 20 Oct 2015 22:03:27 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2015 22:03:27 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id BCCD22C1F5E for ; Tue, 20 Oct 2015 22:03:27 +0000 (UTC) Date: Tue, 20 Oct 2015 22:03:27 +0000 (UTC) From: "Victoria Markman (JIRA)" To: dev@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (DRILL-2687) TINYINT/SMALLINT's clean not-implemented-yet messages are missing or late for views 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-2687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Victoria Markman resolved DRILL-2687. ------------------------------------- Resolution: Fixed > TINYINT/SMALLINT's clean not-implemented-yet messages are missing or late for views > ------------------------------------------------------------------------------------ > > Key: DRILL-2687 > URL: https://issues.apache.org/jira/browse/DRILL-2687 > Project: Apache Drill > Issue Type: Bug > Components: SQL Parser > Reporter: Daniel Barclay (Drill) > Fix For: 1.4.0 > > > The checks to detect uses of TINYINT and SMALLINT and directly report that they are not implemented yet doesn't seem to cover view creation: > 1. Some cases report a very unclean error: > {noformat} > 0: jdbc:drill:zk=local> USE dfs.tmp; > +------------+------------+ > | ok | summary | > +------------+------------+ > | true | Default schema changed to 'dfs.tmp' | > +------------+------------+ > 1 row selected (0.02 seconds) > 0: jdbc:drill:zk=local> CREATE OR REPLACE VIEW TempView AS SELECT CAST('1' AS SMALLINT) FROM INFORMATION_SCHEMA.CATALOGS; > +------------+------------+ > | ok | summary | > +------------+------------+ > | true | View 'TempView' replaced successfully in 'dfs.tmp' schema | > +------------+------------+ > 1 row selected (0.027 seconds) > 0: jdbc:drill:zk=local> SELECT * FROM TempView; > Exception in thread "2ae0be1b-df9a-a7f8-132e-917d4bd51eaa:frag:0:0" java.lang.RuntimeException: Error closing fragment context. > at org.apache.drill.exec.work.fragment.FragmentExecutor.closeOutResources(FragmentExecutor.java:224) > at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:187) > at org.apache.drill.common.SelfCleaningRunnable.run(SelfCleaningRunnable.java:38) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.RuntimeException: cast function for type SMALLINT is not defined > at org.apache.drill.common.expression.fn.CastFunctions.getCastFunc(CastFunctions.java:101) > at org.apache.drill.exec.expr.ExpressionTreeMaterializer$MaterializeVisitor.visitCastExpression(ExpressionTreeMaterializer.java:547) > at org.apache.drill.exec.expr.ExpressionTreeMaterializer$MaterializeVisitor.visitCastExpression(ExpressionTreeMaterializer.java:187) > at org.apache.drill.common.expression.CastExpression.accept(CastExpression.java:43) > at org.apache.drill.exec.expr.ExpressionTreeMaterializer.materialize(ExpressionTreeMaterializer.java:103) > at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.setupNewSchema(ProjectRecordBatch.java:393) > at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:78) > at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:134) > at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:142) > at org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:118) > at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:68) > at org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext(ScreenCreator.java:96) > at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:58) > at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:163) > ... 4 more > Query failed: RemoteRpcException: Failure while running fragment., cast function for type SMALLINT is not defined [ f2543aac-aaef-4090-89f7-32746efa4242 on dev-linux2:31013 ] > [ f2543aac-aaef-4090-89f7-32746efa4242 on dev-linux2:31013 ] > Error: exception while executing query: Failure while executing query. (state=,code=0) > 0: jdbc:drill:zk=local> > 0: jdbc:drill:zk=local> > {noformat} > 2. Other cases report a less messy but still non-specific error: > {noformat} > 0: jdbc:drill:zk=local> > 0: jdbc:drill:zk=local> USE dfs.tmp; > +------------+------------+ > | ok | summary | > +------------+------------+ > | true | Default schema changed to 'dfs.tmp' | > +------------+------------+ > 1 row selected (0.036 seconds) > 0: jdbc:drill:zk=local> CREATE OR REPLACE VIEW TempView AS SELECT CAST(1 AS SMALLINT) FROM INFORMATION_SCHEMA.CATALOGS; > +------------+------------+ > | ok | summary | > +------------+------------+ > | true | View 'TempView' replaced successfully in 'dfs.tmp' schema | > +------------+------------+ > 1 row selected (0.043 seconds) > 0: jdbc:drill:zk=local> SELECT * FROM TempView; > Query failed: UnsupportedOperationException: Unable to convert the value of 1 and type SMALLINT to a Drill constant expression. > Error: exception while executing query: Failure while executing query. (state=,code=0) > 0: jdbc:drill:zk=local> > 0: jdbc:drill:zk=local> > 0: jdbc:drill:zk=local> > 0: jdbc:drill:zk=local> > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)