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

# Get Table Schema

> Retrieve the structure and column details of a specific BigQuery table to understand its data format before inserting or querying data.

**Get Table Schema** retrieves the structure and column details of a specific BigQuery table to understand its data format before inserting or querying data.

***

## When to Use It

* Review table structure before importing data from other platforms
* Understand available fields before building reports or queries
* Use it as AI Tool for AI Agents to understand table structures
* Validate table structure after schema changes

***

## Inputs

| Field       | Type   | Required | Description                                   |
| ----------- | ------ | -------- | --------------------------------------------- |
| **Project** | Select | Yes      | Google BigQuery project to search in          |
| **Dataset** | Select | Yes      | BigQuery dataset containing your target table |
| **Table**   | Select | Yes      | Target BigQuery table to get schema from      |

***

## Outputs

| Output           | Description                                                  |
| ---------------- | ------------------------------------------------------------ |
| **Table Schema** | Complete schema information with column details and metadata |

***

## Credit Cost

1 credit per operation.

***

## Real-World Examples

**BigQuery AI Agent:**

```
AI Agent → List Tables → Get Table Schema → Run Query
"Allow AI to discover tables and understand their structure before querying"
```

**Data Migration Planning:**

```
Get Table Schema → Rename Fields → Insert Rows
"Review table structure before importing data from other platforms"
```

**Analytics Setup:**

```
Get Table Schema → AI Analyze Data → Write to Sheets
"Understand available fields before building reports"
```

**Schema Comparison:**

```
Get Table Schema (Prod) → Get Table Schema (Dev) → AI Analyze Data
"Compare schemas across environments for consistency"
```

***

## Understanding Schema Information

The returned data includes:

**Table Metadata:**

* Table ID, dataset ID, and project ID
* Creation time and last modified date
* Total number of rows in the table
* Table description and labels

**Column Details:**

* Column names and data types (STRING, INTEGER, FLOAT, etc.)
* Field modes (NULLABLE, REQUIRED, REPEATED)
* Column descriptions and documentation
* Nested field structures for complex data types

**Useful for:**

* Planning data imports and exports
* Understanding data structure before building queries
* Documenting table specifications for teams
* Validating data quality and consistency

***

## Best Practices

**Schema Documentation:**

* Save schema information for reference when building reports
* Export schemas to spreadsheets for team documentation
* Track schema changes over time for data governance

**Data Validation:**

* Always check schema before inserting new data
* Verify field modes (nullable/required) for data quality
* Use schema info to validate data types before insertion

**Query Optimization:**

* Understand field types to write efficient queries
* Use schema info to avoid scanning unnecessary columns
* Plan proper data type conversions and casting

***

## Tips

**Field Information:**

* Schema includes field modes (NULLABLE, REQUIRED, REPEATED) - crucial for data validation
* Column descriptions provide business context about field usage
* Nested structures show complex data relationships

**Integration Planning:**

* Use schema data to auto-generate documentation or data dictionaries
* Compare schemas between different environments or versions
* Plan column mapping for data migration projects

**Performance:**

* Schema info helps optimize query performance by understanding field types
* Use schema to identify partitioned and clustered columns
* Plan data loading strategies based on table structure

***

## FAQ

<Accordion title="What information is included in the schema output?">
  The schema includes column names, data types (STRING, INTEGER, FLOAT, etc.), field modes (nullable/required), column descriptions, and table metadata like row count and creation time.
</Accordion>

<Accordion title="Can I use this to compare schemas between tables?">
  Yes, you can run this node on multiple tables and compare the schema outputs to identify differences between environments or table versions.
</Accordion>

<Accordion title="Does this work with views as well as tables?">
  Yes, you can get schema information for both tables and views in BigQuery. Views will show the schema of the underlying query results.
</Accordion>

<Accordion title="How often should I check table schemas?">
  Check schemas when setting up new integrations, after schema changes, when troubleshooting data issues, or during regular data governance reviews.
</Accordion>

<Accordion title="Can I see partitioning and clustering information?">
  The basic schema shows field structure and types. For advanced metadata like partitioning details, you may need to run specific information schema queries.
</Accordion>

<Accordion title="What if the table has nested or repeated fields?">
  BigQuery supports complex data types. The schema will show nested structures and repeated fields with their full hierarchy and data types.
</Accordion>

<Accordion title="How do I use schema information for data migration?">
  Use the schema to understand target table structure, plan column mapping, verify data types match your source, and ensure successful data insertion.
</Accordion>
