title: asterisk or percentage sign in impala
body: <blockquote>
    <p>The percentage sign (%) is used as the "everything" wildcard instead of an asterisk. It will match zero or more characters.</p>
  </blockquote>
  
  <p>As <a href="https://stackoverflow.com/a/720896/8625228">@onedaywhen</a> said, the two have same function. </p>
  
  <p>But in impala, I find they only work in different specific situation.</p>
  
  <h1>show tables like ' '</h1>
  
  <p>Suppose in my database <code>opd</code>, there are there table, </p>
  
  <ul>
  <li><code>opd.haha</code></li>
  <li><code>opd.haha1</code></li>
  <li><code>opd.abc</code></li>
  </ul>
  
  <p>input: </p>
  
  <pre><code>show tables like 'haha*'
  </code></pre>
  
  <p>output: </p>
  
  <pre><code>opd.haha
  opd.haha1
  </code></pre>
  
  <p>input: </p>
  
  <pre><code>show tables like 'haha%'
  </code></pre>
  
  <p>output: </p>
  
  <pre><code>Done. 0 results.
  </code></pre>
  
  <h1>select ... like</h1>
  
  <pre><code>select 'haha' like 'ha%' -- true
  select 'haha' like 'ha*' -- false
  select 'haha' like 'ha__' -- true
  select 'haha' like 'haha%' -- true
  </code></pre>
  
  <p>My question is that </p>
  
  <p>To summarise, </p>
  
  <ul>
  <li>asterisk sign only works in show tables clause, and</li>
  <li>percentage sign only works in select clause</li>
  </ul>
  
  <p>Is this comment right?</p>