Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Duplicate
    • Affects Version/s: 0.18.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      The bash completion script in src/contrib/bash-tab-completion/hadoop.sh doesn't quite work the way you'd expect it to against 18.3 (and I assume anything afterwards, since the author claimed compatibility with 16-20).

      It doesn't complete things like you'd expect against HDFS, and it doesn't have job-id completion.

      1. HADOOP-6310.patch
        4 kB
        Paul Huff
      2. HADOOP-6310.patch.1
        6 kB
        Sean Mackrory

        Issue Links

          Activity

          Paul Huff created issue -
          Hide
          Paul Huff added a comment -

          This patch makes hdfs tab completion work, makes the bash completion work for hadoop being anywhere on $PATH and adds job completion to tab completion for currently running jobs.

          Show
          Paul Huff added a comment - This patch makes hdfs tab completion work, makes the bash completion work for hadoop being anywhere on $PATH and adds job completion to tab completion for currently running jobs.
          Paul Huff made changes -
          Field Original Value New Value
          Attachment HADOOP-6310.patch [ 12421945 ]
          Hide
          Paul Huff added a comment -

          Whoops. I didn't even notice the priority field. This is definitely trivial.

          Show
          Paul Huff added a comment - Whoops. I didn't even notice the priority field. This is definitely trivial.
          Paul Huff made changes -
          Priority Major [ 3 ] Trivial [ 5 ]
          Hide
          Sean Mackrory added a comment -

          After HADOOP-8795 I discovered other problems and this ticket. The 'hadoop' executable has changed even more since Paul proposed his patch, so I've made some additional changes to get it all working. I found that some of the utilities used have very different versions across the major distros and this caused some problems. I'd love it if this could get committed to trunk, but I'd love it even more if anybody would be willing to source this on their system and let me know if they still find any issues when trying to auto-complete. I have:

          *Removed auto-completion of commands that have been deprecated and/or removed entirely.
          *Changed RegEx's and other parameters to play nice with the versions of utilities I tested with.

          Also, the script originally parsed the built-in documentation to decide if each parameter would be a local path or a remote path. With some commands it is no longer trivial to determine which parameter is which, so I combine the results from the local and distributed file systems. If there are multiple results that will get listed, I append "(dfs)" or "(local)", but this addition should never make it into the actual completion of what the user types.

          My only lingering concern (other than compatibility with additional versions of BASH, AWK, etc...) is that sometimes querying HDFS can take a second or two. It might make for a better user experience if the query timed out after a second or so the terminal doesn't freeze up every time they hit 'tab', but overall I think it would be worse, so I've left it as-is. Any thoughts on that?

          Show
          Sean Mackrory added a comment - After HADOOP-8795 I discovered other problems and this ticket. The 'hadoop' executable has changed even more since Paul proposed his patch, so I've made some additional changes to get it all working. I found that some of the utilities used have very different versions across the major distros and this caused some problems. I'd love it if this could get committed to trunk, but I'd love it even more if anybody would be willing to source this on their system and let me know if they still find any issues when trying to auto-complete. I have: *Removed auto-completion of commands that have been deprecated and/or removed entirely. *Changed RegEx's and other parameters to play nice with the versions of utilities I tested with. Also, the script originally parsed the built-in documentation to decide if each parameter would be a local path or a remote path. With some commands it is no longer trivial to determine which parameter is which, so I combine the results from the local and distributed file systems. If there are multiple results that will get listed, I append "(dfs)" or "(local)", but this addition should never make it into the actual completion of what the user types. My only lingering concern (other than compatibility with additional versions of BASH, AWK, etc...) is that sometimes querying HDFS can take a second or two. It might make for a better user experience if the query timed out after a second or so the terminal doesn't freeze up every time they hit 'tab', but overall I think it would be worse, so I've left it as-is. Any thoughts on that?
          Sean Mackrory made changes -
          Attachment HADOOP-6310.patch.1 [ 12549732 ]
          Hide
          Aaron T. Myers added a comment -

          Thanks a lot for posting this patch, Sean, and sorry for the delay in reviewing it.

          The patch still applies cleanly, but could you perhaps check if it needs any updates since you originally posted it given that there may have been other changes in the Hadoop scripts since you posted this? If it still looks good to you, I can take care of reviewing/committing it.

          Show
          Aaron T. Myers added a comment - Thanks a lot for posting this patch, Sean, and sorry for the delay in reviewing it. The patch still applies cleanly, but could you perhaps check if it needs any updates since you originally posted it given that there may have been other changes in the Hadoop scripts since you posted this? If it still looks good to you, I can take care of reviewing/committing it.
          Aaron T. Myers made changes -
          Assignee Sean Mackrory [ mackrorysd ]
          Aaron T. Myers made changes -
          Target Version/s 2.5.0 [ 12326263 ]
          Karthik Kambatla (Inactive) made changes -
          Target Version/s 2.5.0 [ 12326263 ] 2.6.0 [ 12327179 ]
          Jim Hester made changes -
          Link This issue is related to HADOOP-10998 [ HADOOP-10998 ]
          Allen Wittenauer made changes -
          Link This issue is related to HADOOP-10998 [ HADOOP-10998 ]
          Hide
          Allen Wittenauer added a comment -

          Closing this as a dupe of HADOOP-10998. See commit comment there.

          Show
          Allen Wittenauer added a comment - Closing this as a dupe of HADOOP-10998 . See commit comment there.
          Allen Wittenauer made changes -
          Link This issue is duplicated by HADOOP-10998 [ HADOOP-10998 ]
          Allen Wittenauer made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]

            People

            • Assignee:
              Sean Mackrory
              Reporter:
              Paul Huff
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development