Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-18125

HBase shell disregards spaces at the end of a split key in a split file

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      When converting row keys to a printable string representation, Bytes class considers SPACE as a printable character, so it prints it out as it is. So, it's quite possible that a row key has a space at the end.

      When specifying split points in a file, the row keys are not quoted and the shell wrapper "admin.rb" strips any whitespace off the row keys:

       File.foreach(splits_file) do |line|
                  arg[SPLITS].push(line.strip())
                end
      

      The correct approach is to use "chomp()" instead of "strip()" to just strip off carriage returns and newlines. We should assume that the hbase user is either using split points printed out by hbase itself (which will not have tabs) or is diligent enough to not use tabs at the end of a split point.
      What's worse is that it goes undetected and will result in undesirable split points.

      Attachments

        1. HBASE-18125.patch
          0.9 kB
          Xi Chen

        Activity

          People

            chenxi Xi Chen
            ashu210890 Ashu Pachauri
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: