Create a Google Cloud Storage Read Component
This guide walks you through creating a Read Component that ingests data from Google Cloud Storage (GCS).
Prerequisites​
Create a new Component​
Begin from your workspace Super Graph view. Follow these steps to create your component:
- Using the Component Form
- Using the Files Panel
- Double-click the Flow where you want to create your component
- Right-click anywhere in the Flow Graph
- Hover over Create Component, then over Read in the expanded menu, and click From Scratch
- Complete the form with these details:
- Select your Flow
- Enter a descriptive Component Name like
read_sales
- Select YAML as your file type
- Open the files panel in the top left corner
- Navigate to and select your desired Flow
- Right-click on the components directory and choose New file
- Name your file with a descriptive name like
read_sales.yaml
and press enter
Create your Google Cloud Storage Read Component​
Structure your Google Cloud Storage Read Component following this pattern:
- Reference your GCS connection: Specify which GCS connection to read from
- Add the
gcs
key: Configure the specific GCS settingspath
: Specify the path within the bucket to read frominclude
: Define file patterns to include specific files
- Add the parser configuration: Specify file format and parsing options
- Additional configuration options: Include any GCS-specific settings
Example​
read_gcs.yaml
component:
read:
connection: read_gcs_lake
gcs:
path: listing/partitioned/year=20
include:
- glob: "**/year=2024/month=0*/**/*.csv"
parser:
csv:
sep: "|"
has_header: true
date_format: "%Y/%m/%d"
timestamp_format: '%Y-%m-%d %H:%M:%S'
This example shows how to:
- Read from a partitioned directory structure in your GCS bucket
- Filter files using glob patterns to target specific partitions (2024 data from months starting with '0')
- Configure a custom CSV parser with pipe delimiter
- Specify date and timestamp formats for proper parsing
For a complete list of configuration options and advanced settings, see this reference guide.
🎉 Congratulations! You successfully created a Google Cloud Storage Read Component in Ascend.