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 94018200BCC for ; Tue, 29 Nov 2016 09:11:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 929C8160B15; Tue, 29 Nov 2016 08:11:00 +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 DBDC9160B05 for ; Tue, 29 Nov 2016 09:10:59 +0100 (CET) Received: (qmail 79225 invoked by uid 500); 29 Nov 2016 08:10:59 -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 79189 invoked by uid 99); 29 Nov 2016 08:10:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Nov 2016 08:10:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6096D2C03DB for ; Tue, 29 Nov 2016 08:10:58 +0000 (UTC) Date: Tue, 29 Nov 2016 08:10:58 +0000 (UTC) From: "SAIKRISHNA (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-2223) Empty parquet file created with Limit 0 query errors out when querying MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 29 Nov 2016 08:11:00 -0000 [ https://issues.apache.org/jira/browse/DRILL-2223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15704613#comment-15704613 ] SAIKRISHNA commented on DRILL-2223: ----------------------------------- Is there any way to create empty parquet schema with zero records , for my business use case we need to create empty parquet with schema as it is creating in json with zero records. I am trying with below query getting zero records create table target.HIVE.employeeTest2911 AS SELECT * FROM cp.`employee.json` where employee_id >1157 Fragment Number of records written 0_0 0 when I try this select * from target.HIVE.employeeTest2911 getting this exception org.apache.drill.common.exceptions.UserRemoteException: VALIDATION ERROR: From line 1, column 16 to line 1, column 21: Table 'target.HIVE.employeeTest2911' not found SQL Query null [Error Id: 5ee67a9b-b3ec-4ac8-88bd-13d8428f1d48 on DataNode1:31010] Workspace structure is like this { "type": "file", "enabled": true, "connection": "hdfs://XXXXXXXXXXX:8020", "config": null, "workspaces": { "HIVE": { "location": "/user/tmp", "writable": true, "defaultInputFormat": null } }, "formats": { "parquet": { "type": "parquet" } } } Can I have solution for this,if any one has the solution to overcome this please let me know, Thanks in advance > Empty parquet file created with Limit 0 query errors out when querying > ---------------------------------------------------------------------- > > Key: DRILL-2223 > URL: https://issues.apache.org/jira/browse/DRILL-2223 > Project: Apache Drill > Issue Type: Bug > Components: Storage - Parquet > Affects Versions: 0.7.0 > Reporter: Aman Sinha > Fix For: Future > > > Doing a CTAS with limit 0 creates a 0 length parquet file which errors out during querying. This should at least write the schema information and metadata which will allow queries to run. > {code} > 0: jdbc:drill:zk=local> create table tt_nation2 as select n_nationkey, n_name, n_regionkey from cp.`tpch/nation.parquet` limit 0; > +------------+---------------------------+ > | Fragment | Number of records written | > +------------+---------------------------+ > | 0_0 | 0 | > +------------+---------------------------+ > 1 row selected (0.315 seconds) > 0: jdbc:drill:zk=local> select n_nationkey from tt_nation2; > Query failed: RuntimeException: file:/tmp/tt_nation2/0_0_0.parquet is not a Parquet file (too small) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)