> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# filter_by_table

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.filter_by_table"> <span className="sig-name descname"><span className="pre">filter\_by\_table</span></span><span className="sig-paren">(</span><span className="em sig-param"><span className="n"><span className="pre">table\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">view\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">''</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">column\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">source\_table\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">source\_table\_column\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">options</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">{"{"}{"}"}</span></span></span><span className="sig-paren">)</span><a href="https://github.com/kineticadb/kinetica-api-python/blob/master/gpudb/gpudb.py#L30130"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Filters objects in one table based on objects in another table. The user must specify matching column types from the two tables (i.e. the target table from which objects will be filtered and the source table based on which the filter will be created); the column names need not be the same. If a input parameter <span className="em">view\_name</span> is specified, then the filtered objects will then be put in a newly created view. The operation is synchronous, meaning that a response will not be returned until all objects are fully available in the result view. The return value contains the count (i.e. the size) of the resulting view.</p>
      <p><strong>Parameters</strong></p>

      <div className="blockquote">
        <div>
          <div className="dl">
            <div className="dt">table\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name of the table whose data will be filtered, in \[schema\_name.]table\_name format, using standard <a className="reference external" href="/content/concepts/tables/#table-name-resolution">name resolution rules</a>. Must be an existing table.</p>
            </div>

            <div className="dt">view\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>If provided, then this will be the name of the view containing the results, in \[schema\_name.]view\_name format, using standard <a className="reference external" href="/content/concepts/tables/#table-name-resolution">name resolution rules</a> and meeting <a className="reference external" href="/content/concepts/tables/#table-naming-criteria">table naming criteria</a>. Must not be an already existing table or view. The default value is ‘’.</p>
            </div>

            <div className="dt">column\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name of the column by whose value the data will be filtered from the table designated by input parameter <span className="em">table\_name</span>.</p>
            </div>

            <div className="dt">source\_table\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name of the table whose data will be compared against in the table called input parameter <span className="em">table\_name</span>, in \[schema\_name.]table\_name format, using standard <a className="reference external" href="/content/concepts/tables/#table-name-resolution">name resolution rules</a>. Must be an existing table.</p>
            </div>

            <div className="dt">source\_table\_column\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name of the column in the input parameter <span className="em">source\_table\_name</span> whose values will be used as the filter for table input parameter <span className="em">table\_name</span>. Must be a geospatial geometry column if in ‘spatial’ mode; otherwise, Must match the type of the input parameter <span className="em">column\_name</span>.</p>
            </div>

            <div className="dt">options (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Optional parameters. Allowed keys are:</p>

              <ul>
                <li>
                  <p><strong>create\_temp\_table</strong> – If <span className="em">true</span>, a unique temporary table name will be generated in the sys\_temp schema and used in place of input parameter <span className="em">view\_name</span>. This is always allowed even if the caller does not have permission to create tables. The generated name is returned in <span className="em">qualified\_view\_name</span>. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘false’.</p>
                </li>

                <li>
                  <p><strong>collection\_name</strong> – \[DEPRECATED–please specify the containing schema for the view as part of input parameter <span className="em">view\_name</span> and use <a className="reference internal" href="#gpudb.GPUdb.create_schema" title="gpudb.GPUdb.create_schema"><code className="xref py py-meth docutils literal notranslate"><span className="pre">GPUdb.create\_schema()</span></code></a> to create the schema if non-existent] Name of a schema for the newly created view. If the schema is non-existent, it will be automatically created.</p>
                </li>

                <li>
                  <p><strong>filter\_mode</strong> – String indicating the filter mode, either <span className="em">in\_table</span> or <span className="em">not\_in\_table</span>. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>in\_table</p>
                    </li>

                    <li>
                      <p>not\_in\_table</p>
                    </li>
                  </ul>

                  <p>The default value is ‘in\_table’.</p>
                </li>

                <li>
                  <p><strong>mode</strong> – Mode - should be either <span className="em">spatial</span> or <span className="em">normal</span>. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>normal</p>
                    </li>

                    <li>
                      <p>spatial</p>
                    </li>
                  </ul>

                  <p>The default value is ‘normal’.</p>
                </li>

                <li>
                  <p><strong>buffer</strong> – Buffer size, in meters. Only relevant for <span className="em">spatial</span> mode. The default value is ‘0’.</p>
                </li>

                <li>
                  <p><strong>buffer\_method</strong> – Method used to buffer polygons. Only relevant for <span className="em">spatial</span> mode. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>normal</p>
                    </li>

                    <li>
                      <p><strong>geos</strong> – Use geos 1 edge per corner algorithm.</p>
                    </li>
                  </ul>

                  <p>The default value is ‘normal’.</p>
                </li>

                <li>
                  <p><strong>max\_partition\_size</strong> – Maximum number of points in a partition. Only relevant for <span className="em">spatial</span> mode. The default value is ‘0’.</p>
                </li>

                <li>
                  <p><strong>max\_partition\_score</strong> – Maximum number of points \* edges in a partition. Only relevant for <span className="em">spatial</span> mode. The default value is ‘8000000’.</p>
                </li>

                <li>
                  <p><strong>x\_column\_name</strong> – Name of column containing x value of point being filtered in <span className="em">spatial</span> mode. The default value is ‘x’.</p>
                </li>

                <li>
                  <p><strong>y\_column\_name</strong> – Name of column containing y value of point being filtered in <span className="em">spatial</span> mode. The default value is ‘y’.</p>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>
          </div>
        </div>
      </div>

      <p><strong>Returns</strong></p>

      <div className="blockquote">
        <div>
          <p>A dict with the following entries–</p>

          <div className="dl">
            <div className="dt">count (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>The number of records in input parameter <span className="em">table\_name</span> that have input parameter <span className="em">column\_name</span> values matching input parameter <span className="em">source\_table\_column\_name</span> values in input parameter <span className="em">source\_table\_name</span>.</p>
            </div>

            <div className="dt">info (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Additional information. Allowed keys are:</p>

              <ul className="simple">
                <li>
                  <p><strong>qualified\_view\_name</strong> – The fully qualified name of the view (i.e. including the schema).</p>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
