[jira] [Commented] (DRILL-3894) Directory functions (MaxDir, MinDir ..) should have optional filename parameter
[ https://issues.apache.org/jira/browse/DRILL-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15269191#comment-15269191 ] ASF GitHub Bot commented on DRILL-3894: --- Github user asfgit closed the pull request at: https://github.com/apache/drill/pull/467 > Directory functions (MaxDir, MinDir ..) should have optional filename > parameter > --- > > Key: DRILL-3894 > URL: https://issues.apache.org/jira/browse/DRILL-3894 > Project: Apache Drill > Issue Type: Improvement > Components: Functions - Drill >Affects Versions: 1.2.0 >Reporter: Neeraja >Assignee: Vitalii Diravka > > https://drill.apache.org/docs/query-directory-functions/ > The directory functions documented above should provide ability to have > second parameter(file name) as optional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DRILL-3894) Directory functions (MaxDir, MinDir ..) should have optional filename parameter
[ https://issues.apache.org/jira/browse/DRILL-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15267069#comment-15267069 ] ASF GitHub Bot commented on DRILL-3894: --- Github user parthchandra commented on the pull request: https://github.com/apache/drill/pull/467#issuecomment-216307896 Looks good. +1 > Directory functions (MaxDir, MinDir ..) should have optional filename > parameter > --- > > Key: DRILL-3894 > URL: https://issues.apache.org/jira/browse/DRILL-3894 > Project: Apache Drill > Issue Type: Improvement > Components: Functions - Drill >Affects Versions: 1.2.0 >Reporter: Neeraja >Assignee: Vitalii Diravka > > https://drill.apache.org/docs/query-directory-functions/ > The directory functions documented above should provide ability to have > second parameter(file name) as optional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DRILL-3894) Directory functions (MaxDir, MinDir ..) should have optional filename parameter
[ https://issues.apache.org/jira/browse/DRILL-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15262390#comment-15262390 ] ASF GitHub Bot commented on DRILL-3894: --- Github user vdiravka commented on the pull request: https://github.com/apache/drill/pull/467#issuecomment-215476544 I used the same approach like in lpad .. functions. You can use Query Directory Functions with filename param or without it. And for code cleaning I've replaced `MaxDirOnePar` with `MaxDir`, `MaxDirTwoPar` with `MaxDirTwoArg` like in the lpad functions and I've replaced `parameterAmount==2` label with `functionClassName?ends_with("TwoArg")`. Also I've added UTest for new Query Directory Functions implementations. > Directory functions (MaxDir, MinDir ..) should have optional filename > parameter > --- > > Key: DRILL-3894 > URL: https://issues.apache.org/jira/browse/DRILL-3894 > Project: Apache Drill > Issue Type: Improvement > Components: Functions - Drill >Affects Versions: 1.2.0 >Reporter: Neeraja >Assignee: Vitalii Diravka > > https://drill.apache.org/docs/query-directory-functions/ > The directory functions documented above should provide ability to have > second parameter(file name) as optional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DRILL-3894) Directory functions (MaxDir, MinDir ..) should have optional filename parameter
[ https://issues.apache.org/jira/browse/DRILL-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15260832#comment-15260832 ] ASF GitHub Bot commented on DRILL-3894: --- Github user parthchandra commented on the pull request: https://github.com/apache/drill/pull/467#issuecomment-215210057 I think the preferred way is to have multiple implementations: one with filename as a param and one without (instead of having the parameterAmount label). Take a look at some other implementations (say, lpad, or rpad). Also, schema is misspelt in the error message. > Directory functions (MaxDir, MinDir ..) should have optional filename > parameter > --- > > Key: DRILL-3894 > URL: https://issues.apache.org/jira/browse/DRILL-3894 > Project: Apache Drill > Issue Type: Improvement > Components: Functions - Drill >Affects Versions: 1.2.0 >Reporter: Neeraja >Assignee: Vitalii Diravka > > https://drill.apache.org/docs/query-directory-functions/ > The directory functions documented above should provide ability to have > second parameter(file name) as optional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DRILL-3894) Directory functions (MaxDir, MinDir ..) should have optional filename parameter
[ https://issues.apache.org/jira/browse/DRILL-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15227995#comment-15227995 ] ASF GitHub Bot commented on DRILL-3894: --- GitHub user vdiravka opened a pull request: https://github.com/apache/drill/pull/467 DRILL-3894: Upgrade functions MaxDir, MinDir... Optional filename parameter Functions MaxDir, MinDir, iMaxDir, iMinDir with one (schema) parameter were added. You can merge this pull request into a Git repository by running: $ git pull https://github.com/vdiravka/drill DRILL-3894 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/drill/pull/467.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #467 commit 966d76a06f82dcb265849b90bcff8ce8a770f4ec Author: Vitalii Diravka Date: 2016-04-05T15:07:29Z DRILL-3894: Upgrade functions MaxDir, MinDir... Optional filename parameter - added functions MaxDir, MinDir, iMaxDir, iMinDir with one (schema) parameter. > Directory functions (MaxDir, MinDir ..) should have optional filename > parameter > --- > > Key: DRILL-3894 > URL: https://issues.apache.org/jira/browse/DRILL-3894 > Project: Apache Drill > Issue Type: Improvement > Components: Functions - Drill >Affects Versions: 1.2.0 >Reporter: Neeraja >Assignee: Vitalii Diravka > > https://drill.apache.org/docs/query-directory-functions/ > The directory functions documented above should provide ability to have > second parameter(file name) as optional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DRILL-3894) Directory functions (MaxDir, MinDir ..) should have optional filename parameter
[ https://issues.apache.org/jira/browse/DRILL-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15226155#comment-15226155 ] Vitalii Diravka commented on DRILL-3894: [~tdunning] I have implemented your approach into a new functions with one parameter. https://github.com/vdiravka/drill/commit/966d76a06f82dcb265849b90bcff8ce8a770f4ec > Directory functions (MaxDir, MinDir ..) should have optional filename > parameter > --- > > Key: DRILL-3894 > URL: https://issues.apache.org/jira/browse/DRILL-3894 > Project: Apache Drill > Issue Type: Improvement > Components: Functions - Drill >Affects Versions: 1.2.0 >Reporter: Neeraja >Assignee: Vitalii Diravka > > https://drill.apache.org/docs/query-directory-functions/ > The directory functions documented above should provide ability to have > second parameter(file name) as optional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DRILL-3894) Directory functions (MaxDir, MinDir ..) should have optional filename parameter
[ https://issues.apache.org/jira/browse/DRILL-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14943954#comment-14943954 ] Ted Dunning commented on DRILL-3894: Actually, I just tested a bit with this. I agree that this is a valid request, but there is actually a trivial (but not necessarily obvious work-around). TLDR: Just use '.' as the table name. I created a workspace zoom under my home directory as the directory zoom. >From my home directory, I can use {{MAXDIR}} as expected: {code} 0: jdbc:drill:> select count(*) from dfs.tdunning.zoom; +-+ | EXPR$0 | +-+ | 600 | +-+ 1 row selected (0.378 seconds) 0: jdbc:drill:> select count(*) from dfs.tdunning.zoom where dir0 = MAXDIR('dfs.tdunning', 'zoom'); +-+ | EXPR$0 | +-+ | 200 | +-+ 1 row selected (0.799 seconds) {code} So that all works. If I try to touch the zoom work-space, I immediately have some issues because a workspace isn't a table. {code} 0: jdbc:drill:> select count(*) from dfs.zoom; Error: PARSE ERROR: From line 1, column 22 to line 1, column 24: Table 'dfs.zoom' not found {code} Using the hack of {{`.`}} as a table resolves this, however: {code} 0: jdbc:drill:> select count(*) from dfs.zoom.`.`; +-+ | EXPR$0 | +-+ | 600 | +-+ 1 row selected (0.336 seconds) 0: jdbc:drill:> select count(*) from dfs.zoom.`.` where dir0 = maxdir('dfs.zoom', '.'); +-+ | EXPR$0 | +-+ | 200 | +-+ 1 row selected (0.777 seconds) 0: jdbc:drill:> {code} > Directory functions (MaxDir, MinDir ..) should have optional filename > parameter > --- > > Key: DRILL-3894 > URL: https://issues.apache.org/jira/browse/DRILL-3894 > Project: Apache Drill > Issue Type: Improvement > Components: Functions - Drill >Affects Versions: 1.2.0 >Reporter: Neeraja > > https://drill.apache.org/docs/query-directory-functions/ > The directory functions documented above should provide ability to have > second parameter(file name) as optional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)