Back to Glossary Index

Schema Mapping

Translate data from one schema or structure to another to facilitate data integration.

Schema mapping definition:

Schema mapping is the process of mapping the schema of one dataset to the schema of another dataset in order to integrate or merge them. It involves mapping the fields or attributes of one dataset to the fields or attributes of another dataset, ensuring that the data types, formats, and other properties match between the two datasets. Schema mapping is a crucial step in data integration, as it enables datasets with different schemas to be combined and analyzed together.

Schema mapping example using Python:

Please note that you need to have the necessary Python libraries installed in your Python environment to run this code.

In Python, one way to perform schema mapping is by using the PySpark library. Here's an example:

# Importing the required libraries
from pyspark.sql import SparkSession
from pyspark.sql.functions import col

# Creating a SparkSession
spark = SparkSession.builder.appName("Schema Mapping Example").getOrCreate()

# Creating a sample dataframe with multiple columns
data = [("John", 25, "25000.50"), ("Smith", 30, "35000.75"), ("Jane", 28, 32000.25)]
df = spark.createDataFrame(data, ["name", "age", "salary"])

# Defining the mapping schema
mapping_schema = {
    "name": "string",
    "age": "integer",
    "salary": "double"

# Creating a new dataframe with the mapped schema
mapped_df =[col(c).cast(mapping_schema[c]).alias(c) for c in mapping_schema.keys()])

# Displaying the original and mapped dataframes
print(f"Original dataframe: {df}")
print(f"Mapped dataframe: {mapped_df}")

# Applying some transformations on the mapped dataframe
filtered_df = mapped_df.filter(mapped_df.age > 25)
grouped_df = filtered_df.groupBy("name").agg({"salary": "sum"})

# Stopping the SparkSession

This will print out the schema of each dataframe showing the new mapping:

Original dataframe: DataFrame[name: string, age: bigint, salary: string]
Mapped dataframe: DataFrame[name: string, age: int, salary: double]

Other data engineering terms related to
Data Management:


Move rarely accessed data to a low-cost, long-term storage solution to reduce costs. store data for long-term retention and compliance.


Add new data or information to an existing dataset to enhance its value. Enhance data with additional information or attributes to enrich analysis and reporting.


Create a copy of data to protect against loss or corruption.


Select, organize and annotate data to make it more useful for analysis and modeling.


Identify and remove duplicate records or entries to improve data quality.


Analyzing the number of features or attributes in the data to improve performance.


Enhance data with additional information from external sources.


Extract data from a system for use in another system or application.


Create an optimized data structure for fast search and retrieval.


combine data from different sources to create a unified view for analysis or reporting.


Store the results of expensive function calls and reusing them when the same inputs occur again.


Combine data from multiple datasets into a single dataset.


Extract useful information, patterns or insights from large volumes of data using statistics and machine learning.


Create a conceptual representation of data objects.


Track data processing metrics and system health to ensure high availability and performance.

Named Entity Recognition

Locate and classify named entities in text into pre-defined categories.


Interpret and convert data from one format to another.


Divide data into smaller subsets for improved performance.


Transform your data so it is fit-for-purpose.


Transform raw data before data analysis or machine learning modeling.


Create a copy of data for redundancy or distributed processing.


Increasing the capacity or performance of a system to handle more data or traffic.


Ensure that data in different systems or databases are in sync and up-to-date.


Check data for completeness, accuracy, and consistency.


Maintain a history of changes to data for auditing and tracking purposes.