title: HBASE shell script that fails using ARGV
body: <p>I am running the following HBASE shell script that fails, and I can't figure out why:</p>
  
  <pre><code>import org.apache.hadoop.hbase.filter.CompareFilter
  import org.apache.hadoop.hbase.filter.SubstringComparator
  a = ARGV[0]
  myscan="'dcqa_event_agg', {FILTER =&gt; org.apache.hadoop.hbase.filter.RowFilter.new(CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new('" + a + "'))}" + "\n"
  scan myscan
  exit
  </code></pre>
  
  <p>The dcqa_event_agg row exists. When I run the command:</p>
  
  <pre><code>hbase shell filtertest.rb 2013
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>ERROR: Unknown table 'dcqa_event_agg', {FILTER =&gt; org.apache.hadoop.hbase.filter.RowFilter.new(CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new('2013'))}
  </code></pre>
  
  <p>When I run the script directly in the HBASE shell, it works fine. Any ideas?</p>
  
  <p>I added some debugging to the shell script:</p>
  
  <pre><code>import org.apache.hadoop.hbase.filter.CompareFilter
  import org.apache.hadoop.hbase.filter.SubstringComparator
  a = ARGV[0]
  myscan="'dcqa_event_agg', {FILTER =&gt; org.apache.hadoop.hbase.filter.RowFilter.new(CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new('" + a + "'))}"
  print myscan + "\n"
  print "scan " + myscan + "\n"
  scan myscan
  exit
  </code></pre>
  
  <p>this is the output:</p>
  
  <pre><code>[test ~]$ hbase shell filtertest.rb 2013
  13/08/23 18:08:44 WARN conf.Configuration: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
  'dcqa_event_agg', {FILTER =&gt; org.apache.hadoop.hbase.filter.RowFilter.new(CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new('2013'))}
  scan 'dcqa_event_agg', {FILTER =&gt; org.apache.hadoop.hbase.filter.RowFilter.new(CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new('2013'))}
  ERROR: Unknown table 'dcqa_event_agg', {FILTER =&gt; org.apache.hadoop.hbase.filter.RowFilter.new(CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new('2013'))}!
  </code></pre>
  
  <p>Removing the quotes didn't fix it.</p>
  
  <p>If I run the commands in the hbase shell environment:</p>
  
  <pre><code>import org.apache.hadoop.hbase.filter.CompareFilter
  import org.apache.hadoop.hbase.filter.SubstringComparator
  scan 'dcqa_event_agg', {FILTER =&gt; org.apache.hadoop.hbase.filter.RowFilter.new(CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new('2013'))}
  </code></pre>
  
  <p>I don't get the error.</p>