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 4C45F186B5 for ; Mon, 24 Aug 2015 14:44:46 +0000 (UTC) Received: (qmail 9579 invoked by uid 500); 24 Aug 2015 14:44:46 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 9551 invoked by uid 500); 24 Aug 2015 14:44:46 -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 9541 invoked by uid 99); 24 Aug 2015 14:44:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Aug 2015 14:44:46 +0000 Date: Mon, 24 Aug 2015 14:44:46 +0000 (UTC) From: "Paul Mogren (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-3698) Expose Show Files Command As SQL for sorting/filtering 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-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14709394#comment-14709394 ] Paul Mogren commented on DRILL-3698: ------------------------------------ +1 for providing table-like access via INFORMATION_SCHEMA as mentioned on the mailing list. > Expose Show Files Command As SQL for sorting/filtering > ------------------------------------------------------ > > Key: DRILL-3698 > URL: https://issues.apache.org/jira/browse/DRILL-3698 > Project: Apache Drill > Issue Type: Improvement > Components: SQL Parser > Affects Versions: Future > Environment: All > Reporter: John Omernik > Assignee: Aman Sinha > Labels: features > Fix For: Future > > > When using drill, I had a workspace setup, and I found myself using the show files command often to find my directories etc. The thing is, the return of show files is not ordered. And when looking at file system data there are many possible ways to order the results for efficiency as a user. > Consider the ls command in unix; the ability to specify different sorting is built in there. I checked out http://drill.apache.org/docs/show-files-command/ as well as tried the "obvious" show files order by name and that didn't work nor did I see how I could in the documentation. > Based on a mailing list discussion there is no way to do that currently in Drill, hence this JIRA I think just adding ORDER BY SQL methodology would be perfect here, you have 8 fields (seen below) and ordering by any one of them, or group of them, with ASC/DESC just like standard SQL order by would be a huge win. > I suppose one could potentially ask for WHERE clause (filtering)too, and maybe a select (which fieldsto display) however I am more concerned with the order, but if I had to implement all there I could see examples below: > (All Three, select, where, and order) (I.e. after "Files" if the token isn't WHERE or ORDER then check for the fields, if it's not a valid field list error) > SHOW FILES name, accessTime WHERE name like '%.csv' ORDER BY name; > (Where clause and order, note the token after FILES is WHERE) > SHOW FILES WHERE name like '%.csv' ORDER BY length ASC, name DESC; > (Only Order, ORDER Is the first token after FILES) > SHOW FILES ORDER BY length ASC, name DESC > I don't think we have to grant full SQL functionality here (i.e. aggregates), just the ability to display various fields, filter on criteria, and ordering. If you wanted to get fancy, I suppose you could take the table and make it a full on table, i.e. take the results make it a quick inmemory table and then utilize the whole drill stack on it. Lots of options. I just wanted to get this down in an email/JIRA as it was something I found myself wishing I had over and over during data exploration. > Fields Currently Returned: > |name| isDirectory|isFile|length|owner group|permissions|accessTime|modificationTime| -- This message was sent by Atlassian JIRA (v6.3.4#6332)