nerdexam
Snowflake

DEA-C02 · Question #85

A Data Engineer is setting up a data processing pipeline in Snowflake. The pipeline needs to process PDF files that are uploaded to a stage with a directory table enabled. The data must be extracted f

The correct answer is D. Create a stream on the directory table to track changes and use the stream to trigger a task to. Creating a stream on the directory table (D) is correct because Snowflake streams are designed to capture change data (CDC) on tables - including directory tables - allowing you to detect newly-added files. Pairing the stream with a task gives you an event-driven, serverless trig

Snowflake Scripting and Tasks

Question

A Data Engineer is setting up a data processing pipeline in Snowflake. The pipeline needs to process PDF files that are uploaded to a stage with a directory table enabled. The data must be extracted from the files, and then the processed data will be loaded into a table. What should be done to ensure that the pipeline will automatically process any newly-added PDF files?

Options

  • AConfigure Snowpipe to automatically load the PDF data directly into the table without the need for
  • BImplement a custom Python script to continuously scan the stage and process any newly-created
  • CUse a materialized view to monitor the directory table for changes and trigger the processing task
  • DCreate a stream on the directory table to track changes and use the stream to trigger a task to

How the community answered

(36 responses)
  • A
    8% (3)
  • B
    3% (1)
  • C
    11% (4)
  • D
    78% (28)

Explanation

Creating a stream on the directory table (D) is correct because Snowflake streams are designed to capture change data (CDC) on tables - including directory tables - allowing you to detect newly-added files. Pairing the stream with a task gives you an event-driven, serverless trigger that automatically processes those new PDF files without manual intervention, which is exactly the pattern Snowflake recommends for this use case.

Why the others are wrong:

  • A (Snowpipe): Snowpipe is designed to auto-ingest structured/semi-structured data directly into tables, not to process raw binary files like PDFs; it can't extract content from PDFs.
  • B (Custom Python script): While technically possible, continuously polling a stage with a script is inefficient, requires external infrastructure, and is not a native Snowflake solution - defeating the purpose of building inside Snowflake.
  • C (Materialized view): Materialized views are for pre-computing query results; they cannot monitor for file changes or trigger processing tasks - that's not what they're built for.

Memory tip: Think "Stream + Task = Event-Driven Pipeline" in Snowflake. Whenever you see "automatically process new data," the answer almost always involves a stream (to detect changes) and a task (to act on them). Directory tables are just a special table - and streams work on them the same way.

Topics

#Streams#Tasks#Directory Tables#Automated Pipelines

Community Discussion

No community discussion yet for this question.

Full DEA-C02 Practice