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

# Multi Table Input

export const ComponentMetadata = ({warehouses, unsupportedWarehouses = [], componentType, connectionInputs, connectionOutputs}) => {
  const allWarehouses = [...warehouses.map(w => ({
    name: w,
    supported: true
  })), ...unsupportedWarehouses.map(w => ({
    name: w,
    supported: false
  }))];
  return <div style={{
    background: 'var(--colors-background-light, #f9fafb)',
    border: '1px solid var(--colors-border-default, #e5e7eb)',
    borderRadius: '12px',
    padding: '20px 28px',
    marginBottom: '28px',
    boxShadow: '0 1px 4px rgba(0,0,0,0.10)'
  }}>
      <table style={{
    width: '100%',
    borderCollapse: 'collapse'
  }}>
        <tbody>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle',
    width: '180px'
  }}>Project Availability</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>
              <div style={{
    display: 'flex',
    flexWrap: 'wrap',
    gap: '8px'
  }}>
                {allWarehouses.map((w, i) => <span key={i} style={{
    background: w.supported ? '#dcfce7' : '#fee2e2',
    color: w.supported ? '#15803d' : '#b91c1c',
    border: `1px solid ${w.supported ? '#bbf7d0' : '#fca5a5'}`,
    borderRadius: '9999px',
    padding: '3px 12px',
    fontSize: '0.85rem',
    fontWeight: '500',
    whiteSpace: 'nowrap'
  }}>
                    {w.name} {w.supported ? '✅' : '❌'}
                  </span>)}
              </div>
            </td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Component Type</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{componentType}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Inputs</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{connectionInputs}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Outputs</td>
            <td style={{
    verticalAlign: 'middle'
  }}>{connectionOutputs}</td>
          </tr>
        </tbody>
      </table>
    </div>;
};

<ComponentMetadata warehouses={["Snowflake", "Amazon Redshift"]} unsupportedWarehouses={["Databricks", "BigQuery"]} componentType="Transformation" connectionInputs="None" connectionOutputs="Unlimited" />

The **Multi Table Input** transformation component lets you select columns from across multiple tables in your cloud data warehouse, and combines them into a single dataset.

The component:

1. Examines all tables in the specified database schema and selects those whose names match a user-specified pattern. For example, tables called "Budgets\_2012", "Budget\_2013", and so on, would be selected with a pattern of `Budget%_20%`.
2. Selects user-specified columns from each of the selected tables. The matching tables need to have common column names, so that the same columns can be selected from each table and combined into a single dataset.
3. Outputs the dataset for use by the pipeline's downstream components.

Multi Table Input is similar to [Table Input](/docs/components/table-input), but operates over a range of similar tables rather than a single specified table.

### Use case

The Multi Table Input component is used to consolidate data from multiple similar tables. Some common uses for this include:

* Consolidating historical data from multiple yearly tables. Combine multiple identical tables that are partitioned by year into a single dataset for analysis and reporting.
* Comparing or joining data across multiple similar tables. Load similar data from multiple tables, allowing further transformations such as [aggregations](/docs/components/aggregate) to be performed.

***

## Properties

<Tabs>
  <Tab title="Snowflake">
    <ResponseField name="Name" type="string" required>
      A human-readable name for the component.
    </ResponseField>

    {/* <!-- param-start:[database] | warehouses: [snowflake] --> */}

    <ResponseField name="Database" type="drop-down" required>
      The Snowflake database. The special value `[Environment Default]` uses the database defined in the environment. Read [Databases, Tables and Views - Overview](https://docs.snowflake.com/en/guides-overview-db) to learn more.
    </ResponseField>

    {/* <!-- param-start:[schema] | warehouses: [snowflake] --> */}

    <ResponseField name="Schema" type="drop-down" required>
      The Snowflake schema. The special value `[Environment Default]` uses the schema defined in the environment. Read [Database, Schema, and Share DDL](https://docs.snowflake.com/en/sql-reference/ddl-database.html) to learn more.
    </ResponseField>

    {/* <!-- param-start:[patternType] | warehouses: [snowflake] --> */}

    <ResponseField name="Pattern Type" type="drop-down" required>
      * **ILike:** The available tables are filtered using a case-insensitive SQL syntax pattern. Read [Snowflake ILike documentation](https://docs.snowflake.com/en/sql-reference/functions/ilike.html).
      * **Like:** The available tables are filtered using a case-sensitive SQL syntax pattern. Read [Snowflake Like documentation](https://docs.snowflake.com/en/sql-reference/functions/like.html).
      * **Regex:** The available tables are filtered using a POSIX EXE Regular Expression comparison. Read [Snowflake Rlike documentation](https://docs.snowflake.com/en/sql-reference/functions/rlike.html).
    </ResponseField>

    {/* <!-- param-start:[pattern] | warehouses: [snowflake] --> */}

    <ResponseField name="Pattern" type="string" required>
      The pattern to match available tables to. The pattern syntax depends upon the chosen **Pattern Type**.
    </ResponseField>

    {/* <!-- param-start:[castTypes] | warehouses: [snowflake] --> */}

    <ResponseField name="Cast Types" type="boolean" required>
      * **True:** If the same-named column from multiple tables has a different data type, attempt to cast to a common type.
      * **False:** If the same-named column from multiple tables has a different data type, it is reported as an error. This is the default setting.
    </ResponseField>

    {/* <!-- param-start:[addSourceTable] | warehouses: [snowflake] --> */}

    <ResponseField name="Add Source Table" type="boolean" required>
      When True, {maia} adds a column, "source\_table", containing the input table name that was matched to provide this row.
    </ResponseField>

    {/* <!-- param-start:[columns] | warehouses: [snowflake] --> */}

    <ResponseField name="Columns" type="dual listbox" required>
      The available columns are generated by first scanning the available tables, and then providing all columns from any of the inputs. It is expected that the tables matching the pattern are fairly similar and share many columns. Move columns from left to right to include in the input.
    </ResponseField>
  </Tab>

  <Tab title="Amazon Redshift">
    <ResponseField name="Name" type="string" required>
      A human-readable name for the component.
    </ResponseField>

    {/* <!-- param-start:[databaseRs] | warehouses: [redshift] --> */}

    <ResponseField name="Database" type="drop-down">
      Cross-query two databases. Specify a separate database to the one selected in the connection (that uses the environment default database). For more information, read [Querying data across databases](https://docs.aws.amazon.com/redshift/latest/dg/cross-database-overview.html). There are limitations as to whether an additional database can be queried. For more information, read [Considerations and Limitations](https://docs.aws.amazon.com/redshift/latest/dg/cross-database_usage.html). These limitations will prevent cross database connections, and any deviation from the environment default database will fail.

      <Note>
        * You will need to be connected to either an RA3 or Serverless Redshift cluster type for a cross database connection to work.
        * On RA3 or Serverless Redshift clusters, you will also need the necessary permissions to view schemas and tables outside of your environment's default database.
      </Note>
    </ResponseField>

    {/* <!-- param-start:[schema] | warehouses: [redshift] --> */}

    <ResponseField name="Schema" type="drop-down" required>
      Select the table schema. The special value `[Environment Default]` uses the schema defined in the environment. For more information on using multiple schemas, read [Schemas](https://docs.aws.amazon.com/redshift/latest/dg/r_Schemas_and_tables.html).
    </ResponseField>

    {/* <!-- param-start:[patternType] | warehouses: [redshift] --> */}

    <ResponseField name="Pattern Type" type="drop-down" required>
      * **Like:** The available tables are filtered using a case-sensitive SQL syntax pattern. Read [Redshift Like documentation](http://docs.aws.amazon.com/redshift/latest/dg/r_patternmatching_condition_like.html).
      * **Regex:** The available tables are filtered using a POSIX EXE Regular Expression comparison. Read [Redshift Regular Expression documentation](http://docs.aws.amazon.com/redshift/latest/dg/pattern-matching-conditions-posix.html).
      * **Similar To:** The available tables are filtered using an SQL Similar To comparison. Read [Redshift Similar To documentation](http://docs.aws.amazon.com/redshift/latest/dg/pattern-matching-conditions-similar-to.html).
    </ResponseField>

    {/* <!-- param-start:[pattern] | warehouses: [redshift] --> */}

    <ResponseField name="Pattern" type="string" required>
      The pattern to match available tables to. The pattern syntax depends upon the chosen **Pattern Type**.
    </ResponseField>

    {/* <!-- param-start:[castTypes] | warehouses: [redshift] --> */}

    <ResponseField name="Cast Types" type="boolean" required>
      * **True:** If the same-named column from multiple tables has a different data type, attempt to cast to a common type.
      * **False:** If the same-named column from multiple tables has a different data type, it is reported as an error. This is the default setting.
    </ResponseField>

    {/* <!-- param-start:[addSourceTable] | warehouses: [redshift] --> */}

    <ResponseField name="Add Source Table" type="boolean" required>
      When True, {maia} adds a column, "source\_table", containing the input table name that was matched to provide this row.
    </ResponseField>

    {/* <!-- param-start:[columns] | warehouses: [redshift] --> */}

    <ResponseField name="Columns" type="dual listbox" required>
      The available columns are generated by first scanning the available tables, and then providing all columns from any of the inputs. It is expected that the tables matching the pattern are fairly similar and share many columns. Move columns from left to right to include in the input.
    </ResponseField>

    {/* <!-- param-start:[trimColumns] | warehouses: [redshift] --> */}

    <ResponseField name="Trim Columns" type="drop-down" required>
      Wraps the column names in a BTRIM function, which will strip out all the leading and trailing spaces.

      To learn more, read the [Amazon Redshift documentation](http://docs.aws.amazon.com/redshift/latest/dg/r_BTRIM.html).
    </ResponseField>
  </Tab>
</Tabs>
