<commit_before>## Licensed to Cloudera, Inc. under one
## or more contributor license agreements.  See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership.  Cloudera, Inc. licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License.  You may obtain a copy of the License at
##
##     http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
<%namespace name="wrappers" file="header_footer.mako" />
<%namespace name="comps" file="beeswax_components.mako" />
<%
  if is_view:
    view_or_table_noun = "View"
  else:
    view_or_table_noun = "Table"
%>
${wrappers.head("Beeswax %s Metadata: %s" % (view_or_table_noun, table.tableName), section='tables')}
<%def name="column_table(cols)">
  <div class="bw-col_table_wrapper">
    <table class="sortable" data-filters="HtmlTable" cellpadding="0" cellspacing="0">
      <thead>
        <tr>
          <th>Name</th>
          <th>Type</th>
          <th>Comment</th>
        </tr>
      </thead>
      <tbody>
        % for column in cols:
          <tr>
            <td>${ column.name }</td>
            <td>${ column.type }</td>
            <td>${ column.comment or "" }</td>
          </tr>
        % endfor
      </tbody>
    </table>
  </div>
</%def>

<div id="describe_table resizable" class="view" data-filters="SplitView">
  <div class="left_col">
    <h2>${table.tableName}</h2>
    <div class="jframe_padded">
      <dl>
        % if table.parameters.get("comment", False):
          <dt class="hue-dt_cap">Description</dt>
          <dd class="hue-dd_bottom">${ table.parameters.get("comment") }</dd>
        % endif
        <dt class="hue-dt_cap">Actions</dt>
        <dd class="hue-dd_bottom bw-actions">
          <ul>
	    % if not is_view:
	      <li class="jframe-clear" data-filters="CollapsingElements"><a class="bw-load_data collapser">Import Data</a>
                <div class="collapsible jframe-hidden">
                  <form action="${ url("beeswax.views.load_table", table=table_name) }">
                    <dl>
                      <div class="bw-dataNote">
                      Note that loading data will move data from its location into the table's storage location.
                      </div>
                      ## Any existing data will be erased!
                      <div class="bw-overwriteLabel">Overwrite existing data ? <input type="checkbox" name="overwrite" class="bw-overwriteCheckbox"/></div>
                      ##Path (on HDFS) of files to load.
                      ${comps.field(load_form["path"], title_klass='bw-pathLabel', attrs=dict(
                        klass='bw-loadPath',
                        data_filters="OverText",
                        alt='/user/data'))}
                      <div class="clearfix" data-filters="ArtButtonBar">
                        <a class="hue-choose_file" data-filters="ArtButton" 
                          data-icon-styles="{'width': 16, 'height': 16, 'top': 1, 'left': 4 }" data-chooseFor="path">Choose File</a>
                        <input type="submit" class="bw-loadSubmit" data-filters="ArtButton" value="Submit"/>
                      </div>
                      
                      % for pf in load_form.partition_columns:
                        ${comps.field(load_form[pf], render_default=True)}
                      % endfor
                      ## This table is partitioned.  Therefore,
                      ## you must specify what partition
                      ## this data corresponds to.
                    </dl>
                  </form>
                </div>
	      </li>
	    % endif
            <li class="jframe-clear"><a href="${ url("beeswax.views.read_table", table=table_name) }" class="bw-browse_data">Browse Data</a></li>
	    <li class="jframe-clear"><a href="${ url("beeswax.views.drop_table", table=table_name) }" class="bw-drop_table">Drop ${view_or_table_noun}</a></li>
	    % if not is_view:
	      <li class="jframe-clear"><a href="${hdfs_link}" target="FileBrowser" class="tip bw-location_link" data-filters="PointyTip" data-tip-direction="11" rel="${ table.sd.location }">View File Location</a></li>
	    % endif
          </ul>
        </dd>
      </dl>
    </div>
  </div>
  <div class="right_col">
    <div data-filters="Tabs">
      <ul class="toolbar tabs">
        % if top_rows is not None:
          <li><span>Sample</span></li>
        % endif
        <li><span>Columns</span></li>
        % if len(table.partitionKeys) > 0:
          <li><span>Partition Columns</span></li>
        % endif
      </ul>
      <ul class="tab_sections jframe-clear">
	## Tab 1: Column description
        <li>${column_table(table.sd.cols)}</li>
	## Tab 2: Partition info (if present)
        % if len(table.partitionKeys) > 0:
          <li><commit_msg>HUE-526. Clicking "Browse Table" on a Hive View in Beeswax launches MR job<commit_after>## Licensed to Cloudera, Inc. under one
## or more contributor license agreements.  See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership.  Cloudera, Inc. licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License.  You may obtain a copy of the License at
##
##     http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
<%namespace name="wrappers" file="header_footer.mako" />
<%namespace name="comps" file="beeswax_components.mako" />
<%
  if is_view:
    view_or_table_noun = "View"
  else:
    view_or_table_noun = "Table"
%>
${wrappers.head("Beeswax %s Metadata: %s" % (view_or_table_noun, table.tableName), section='tables')}
<%def name="column_table(cols)">
  <div class="bw-col_table_wrapper">
    <table class="sortable" data-filters="HtmlTable" cellpadding="0" cellspacing="0">
      <thead>
        <tr>
          <th>Name</th>
          <th>Type</th>
          <th>Comment</th>
        </tr>
      </thead>
      <tbody>
        % for column in cols:
          <tr>
            <td>${ column.name }</td>
            <td>${ column.type }</td>
            <td>${ column.comment or "" }</td>
          </tr>
        % endfor
      </tbody>
    </table>
  </div>
</%def>

<div id="describe_table resizable" class="view" data-filters="SplitView">
  <div class="left_col">
    <h2>${table.tableName}</h2>
    <div class="jframe_padded">
      <dl>
        % if table.parameters.get("comment", False):
          <dt class="hue-dt_cap">Description</dt>
          <dd class="hue-dd_bottom">${ table.parameters.get("comment") }</dd>
        % endif
        <dt class="hue-dt_cap">Actions</dt>
        <dd class="hue-dd_bottom bw-actions">
          <ul>
	    % if not is_view:
	      <li class="jframe-clear" data-filters="CollapsingElements"><a class="bw-load_data collapser">Import Data</a>
                <div class="collapsible jframe-hidden">
                  <form action="${ url("beeswax.views.load_table", table=table_name) }">
                    <dl>
                      <div class="bw-dataNote">
                      Note that loading data will move data from its location into the table's storage location.
                      </div>
                      ## Any existing data will be erased!
                      <div class="bw-overwriteLabel">Overwrite existing data ? <input type="checkbox" name="overwrite" class="bw-overwriteCheckbox"/></div>
                      ##Path (on HDFS) of files to load.
                      ${comps.field(load_form["path"], title_klass='bw-pathLabel', attrs=dict(
                        klass='bw-loadPath',
                        data_filters="OverText",
                        alt='/user/data'))}
                      <div class="clearfix" data-filters="ArtButtonBar">
                        <a class="hue-choose_file" data-filters="ArtButton" 
                          data-icon-styles="{'width': 16, 'height': 16, 'top': 1, 'left': 4 }" data-chooseFor="path">Choose File</a>
                        <input type="submit" class="bw-loadSubmit" data-filters="ArtButton" value="Submit"/>
                      </div>
                      
                      % for pf in load_form.partition_columns:
                        ${comps.field(load_form[pf], render_default=True)}
                      % endfor
                      ## This table is partitioned.  Therefore,
                      ## you must specify what partition
                      ## this data corresponds to.
                    </dl>
                  </form>
                </div>
	      </li>
	    % endif
            <li class="jframe-clear"><a href="${ url("beeswax.views.read_table", table=table_name) }" class="bw-browse_data">Browse Data</a></li>
	    <li class="jframe-clear"><a href="${ url("beeswax.views.drop_table", table=table_name) }" class="bw-drop_table">Drop ${view_or_table_noun}</a></li>
	    % if not is_view:
	      <li class="jframe-clear"><a href="${hdfs_link}" target="FileBrowser" class="tip bw-location_link" data-filters="PointyTip" data-tip-direction="11" rel="${ table.sd.location }">View File Location</a></li>
	    % endif
          </ul>
        </dd>
      </dl>
    </div>
  </div>
  <div class="right_col">
    <div data-filters="Tabs">
      <ul class="toolbar tabs">
        <li><span>Columns</span></li>
        % if len(table.partitionKeys) > 0:
          <li><span>Partition Columns</span></li>
        % endif
        % if top_rows is not None:
          <li><span>Sample</span></li>
        % endif
      </ul>
      <ul class="tab_sections jframe-clear">
	## Tab 1: Column description
        <li>${column_table(table.sd.cols)}</li>
	## Tab 2: Partition info (if present)
        % if len(table.partitionKeys) > 0:
          <li>
{'fraction_non_alphanumeric': 0.14511041009463724, 'fraction_numerical': 0.004110505687792754, 'mean_word_length': 2.200367084735393, 'pattern_counts': {'":': 0, '<': 203, '<?xml version=': 0, '>': 207, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '975715', 'n_tokens_mistral': 3196, 'n_tokens_neox': 3063, 'n_words': 773}