Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-199

ExampleHBase.groovy fails with HBase 0.96 due to empty column qualifier REST API incompatibility



    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.3.0
    • 0.4.0
    • ClientDSL
    • None
    • Knox 0.3.0, Sandbox 2.0 GA (HBase 0.96)


      When running the samples/ExampleHBase.groovy Knox Client DSL script, an exception is produced on the client side. This is due to an incompatibility between Knox 0.3.0 Client DSL and a change in HBase 0.96. The result is that the Knox Client DSL cannot be used to access HBase operations that involve empty column qualifiers. This only affects the Knox Client DSL. The HBase REST API can still be used via the Knox Gateway for both HBase 0.95 and 0.96.

      // This Client DSL command will fail with Knox 0.3.0 Client DSL and HBase 0.96. It will work with HBase 0.95.
      HBase.session(session).table("table1").row("row_id_1").store().column("family1", null, "fam_value1").now()

      // It may also be possible in some cases to work around this problem by adding an extra ":" to the column family parameter
      HBase.session(session).table("table1").row("row_id_1").store().column("family1:", null, "fam_value1").now()

      // This Client DSL command will work with both HBase 0.95 and HBase 0.96.
      HBase.session(session).table("table1").row("row_id_1").store().column("family1", "col1", "col_value1").now()

      The exception produced on the client side is shown below:

      Inserting data into table...
      Caught: org.apache.hadoop.gateway.shell.HadoopException: org.apache.hadoop.gateway.shell.ErrorResponse: HTTP/1.1 400 Bad Request
      org.apache.hadoop.gateway.shell.HadoopException: org.apache.hadoop.gateway.shell.ErrorResponse: HTTP/1.1 400 Bad Request
      at org.apache.hadoop.gateway.shell.AbstractRequest.now(AbstractRequest.java:72)
      at org.apache.hadoop.gateway.shell.AbstractRequest$now.call(Unknown Source)
      at org.apache.hadoop.gateway.shell.hbase.ExampleHBase.run(ExampleHBase.groovy:81)
      at org.apache.hadoop.gateway.shell.Shell.main(Shell.java:40)
      at org.apache.hadoop.gateway.launcher.Invoker.invokeMainMethod(Invoker.java:64)
      at org.apache.hadoop.gateway.launcher.Invoker.invoke(Invoker.java:37)
      at org.apache.hadoop.gateway.launcher.Command.run(Command.java:101)
      at org.apache.hadoop.gateway.launcher.Launcher.run(Launcher.java:70)
      at org.apache.hadoop.gateway.launcher.Launcher.main(Launcher.java:49)
      Caused by: org.apache.hadoop.gateway.shell.ErrorResponse: HTTP/1.1 400 Bad Request
      at org.apache.hadoop.gateway.shell.Hadoop.executeNow(Hadoop.java:107)
      at org.apache.hadoop.gateway.shell.AbstractRequest.execute(AbstractRequest.java:47)
      at org.apache.hadoop.gateway.shell.hbase.table.row.StoreRow$Request.access$400(StoreRow.java:47)
      at org.apache.hadoop.gateway.shell.hbase.table.row.StoreRow$Request$1.call(StoreRow.java:116)
      at org.apache.hadoop.gateway.shell.hbase.table.row.StoreRow$Request$1.call(StoreRow.java:77)
      at org.apache.hadoop.gateway.shell.AbstractRequest.now(AbstractRequest.java:70)
      ... 8 more


        1. KNOX-199.patch
          0.8 kB
          Vladimir Tkhir



            vtkhir@hortonworks.com Vladimir Tkhir
            kminder Kevin Minder
            0 Vote for this issue
            3 Start watching this issue