title: Set row TTL at HBase
body: <p>I'm trying to set a TTL to a row at Hbase. I can't set the TTL to the column family because the table already exists and I can't change that.</p>
  
  <p>What I tried is to use <a href="https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Put.html#setTTL%28long%29" rel="nofollow">setTTL</a> function in the Put operation. But it seems that is not working because information is still there when I make a scan operation to the table even if the time has past. </p>
  
  <p>If I put a negative value in the function, I don't have any data in the table and I think that that would make sense because I'm using a negative ttl, hence the data is not being stored at all...</p>
  
  <p>1) Do you think that I'm using the proper function?</p>
  
  <p>2) Is there a way to see this information (the TTL value for a row) in HBase? </p>
  
  <p><strong>Edit:</strong>
  Here is the output of a <em>describe</em> command (please remind that I can't change TTL value of the column family):</p>
  
  <pre><code>hbase(main):010:0&gt; describe "Snapshot"
  Table Snapshot is ENABLED
  Snapshot, {CONFIGURATION =&gt; {'KeyPrefixRegionSplitPolicy.prefix_length' =&gt; '8', 'SPLIT_POLICY' =&gt; 'org.apache.hadoop.hbase.regionserver.KeyPrefixRegionSplitPolicy'}}
  COLUMN FAMILIES DESCRIPTION
  {NAME =&gt; 'metadata', DATA_BLOCK_ENCODING =&gt; 'NONE', BLOOMFILTER =&gt; 'ROW', REPLICATION_SCOPE =&gt; '0', VERSIONS =&gt; '1', COMPRESSION =&gt; 'GZ', MIN_VERSIONS =&gt; '0', TTL =&gt; 'FOREVER', KEEP_DELETED_CELLS =&gt; 'FALSE', BLOCKSIZE =&gt; '65536', IN_MEMORY =&gt; 'false', BLOCKCACHE =&gt; 'true'}
  {NAME =&gt; 'sample', DATA_BLOCK_ENCODING =&gt; 'NONE', BLOOMFILTER =&gt; 'ROW', REPLICATION_SCOPE =&gt; '0', VERSIONS =&gt; '1', COMPRESSION =&gt; 'GZ', MIN_VERSIONS =&gt; '0', TTL =&gt; 'FOREVER', KEEP_DELETED_CELLS =&gt; 'FALSE', BLOCKSIZE =&gt; '65536', IN_MEMORY =&gt; 'false', BLOCKCACHE =&gt; 'true'}
  </code></pre>
  
  <p><strong>Edit2:</strong> I think I probably have encountered a bug or something strange with HBase version 1.0.0 because TTL is working as expected in most of the cases. But if I set it and before it expires, I force a split in the table, I've found that the TTL won't work anymore. It's like the Cell TTL value is not being maintained in the Split process. I found that it wasn't working for me before because my TTL was aprox. 1 day and I was having some split events in that period of time.</p>
  
  <p>I will verify this behavior in other versions and let you know if I find something new.</p>