HBase
  1. HBase
  2. HBASE-2171

Alter statement in the hbase shell doesn't match documentation.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.2, 0.20.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      linux
      java -version
      java version "1.6.0_16"
      Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
      Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

      Description

      The documentation claims this should work. Perhaps this jira could be a starting point for a more detailed explanation of alter

      HBASE SHELL COMMANDS:
      alter Alter column family schema; pass table name and a dictionary
      specifying new column family schema. Dictionaries are described
      below in the GENERAL NOTES section. Dictionary must include name
      of column family to alter. For example,

      To change or add the 'f1' column family in table 't1' from defaults
      to instead keep a maximum of 5 cell VERSIONS, do:
      hbase> alter 't1',

      {NAME => 'f1', VERSIONS => 5}

      To delete the 'f1' column family in table 't1', do:
      hbase> alter 't1', {NAME => 'f1', METHOD => 'delete'}

      You can also change table-scope attributes like MAX_FILESIZE
      MEMSTORE_FLUSHSIZE and READONLY.

      For example, to change the max size of a family to 128MB, do:
      hbase> alter 't1', {METHOD => 'table_att', MAX_FILESIZE => '134217728'}
      ....
      ase Shell; enter 'help<RETURN>' for list of supported commands.
      Version: 0.20.3, r902334, Mon Jan 25 13:13:08 PST 2010
      hbase(main):001:0> drop 't3'
      0 row(s) in 0.0060 seconds
      0 row(s) in 0.0050 seconds
      0 row(s) in 0.1560 seconds
      hbase(main):002:0> create 't3'
      0 row(s) in 2.1050 seconds
      hbase(main):003:0> disable 't3'
      0 row(s) in 2.0980 seconds
      hbase(main):004:0> alter 't3', {NAME => 'f1', VERSIONS => 5}

      NativeException: java.lang.NullPointerException: null

        Activity

        Alex Newman created issue -
        Alex Newman made changes -
        Field Original Value New Value
        Environment linux
        hbase(main):005:0> [anewman@fqlstagea01:~ ]java -version
        java version "1.6.0_16"
        Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
        Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
        linux
        java -version
        java version "1.6.0_16"
        Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
        Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
        stack made changes -
        Assignee Alex Newman [ posix4e ]
        Hide
        Alex Newman added a comment -

        This is fixed now
        call methods.

        hbase(main):015:0> alter 't1',

        {NAME=>'f1', VERSIONS=>5}

        Updating all regions with the new schema...
        0/1 regions updated.
        1/1 regions updated.
        Done.
        0 row(s) in 2.0810 seconds

        hbase(main):016:0>

        Show
        Alex Newman added a comment - This is fixed now call methods. hbase(main):015:0> alter 't1', {NAME=>'f1', VERSIONS=>5} Updating all regions with the new schema... 0/1 regions updated. 1/1 regions updated. Done. 0 row(s) in 2.0810 seconds hbase(main):016:0>
        Alex Newman made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1633d 20h 44m 1 Alex Newman 19/Jul/14 01:01

          People

          • Assignee:
            Alex Newman
            Reporter:
            Alex Newman
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development