Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-8267

Exposing hbase cell latest timestamp through hbase columns mappings to hive columns.

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Patch Available
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.14.0
    • Fix Version/s: None
    • Component/s: HBase Handler
    • Labels:
      None

      Description

      Previous attempts HIVE-2781 (not accepted), HIVE-2828 (broken and proposed with restricted feature).
      The feature is to have hbase cell latest timestamp accessible in hive query, by mapping the cell timestamp with a hive column, using mapping format like

      :timestamp:cf:[optional qualifier or qualifier prefix]

      The hive create table statement would be like

      For mapping a cell latest timestamp.

      CREATE TABLE hive_hbase_table (key STRING, col1 STRING, col1_ts BIGINT)
      STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
      WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf:qualifier, :timestamp:cf:qualifier")
      TBLPROPERTIES ("hbase.table.name" = "hbase_table");
      

      For mapping a column family latest timestamp.

      CREATE TABLE hive_hbase_table (key STRING, valuemap MAP<STRING, STRING>, timestampmap MAP<STRING, BIGINT>)
      STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
      WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf:,:timestamp:cf:")
      TBLPROPERTIES ("hbase.table.name" = "hbase_table");
      

      Providing default cell value

      CREATE TABLE hive_hbase_table(key int, value string, value_timestamp bigint)
      STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
      WITH SERDEPROPERTIES ("hbase.columns.mapping" = "cf:qualifier, :timestamp:cf:qualifier",
                            "hbase.put.default.cell.value" = "default value")
      TBLPROPERTIES ("hbase.table.name" = "hbase_table");
      

        Attachments

        1. HIVE-8267.0.patch
          105 kB
          Muhammad Ehsan ul Haque

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ehsan Muhammad Ehsan ul Haque
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: