ExamGecko
Home Home / Snowflake / DEA-C01

Snowflake DEA-C01 Practice Test - Questions Answers

Question list
Search
Search

List of questions

Search

Streams cannot be created to query change data on which of the following objects? [Select All that Apply]

A.
Standard tables, including shared tables.
A.
Standard tables, including shared tables.
Answers
B.
Views, including secure views
B.
Views, including secure views
Answers
C.
Directory tables
C.
Directory tables
Answers
D.
Query Log Tables
D.
Query Log Tables
Answers
E.
External tables
E.
External tables
Answers
Suggested answer: D

Explanation:

Streams supports all the listed objects except Query Log tables.

Tasks may optionally use table streams to provide a convenient way to continuously process new or changed dat a. A task can transform new or changed rows that a stream surfaces. Each time a task is scheduled to run, it can verify whether a stream contains change data for a table and either consume the change data or skip the current run if no change data exists. Which System Function can be used by Data engineer to verify whether a stream contains changed data for a table?

A.
SYSTEM$STREAM_HAS_CHANGE_DATA
A.
SYSTEM$STREAM_HAS_CHANGE_DATA
Answers
B.
SYSTEM$STREAM_CDC_DATA
B.
SYSTEM$STREAM_CDC_DATA
Answers
C.
SYSTEM$STREAM_HAS_DATA
C.
SYSTEM$STREAM_HAS_DATA
Answers
D.
SYSTEM$STREAM_DELTA_DATA
D.
SYSTEM$STREAM_DELTA_DATA
Answers
Suggested answer: C

Explanation:

SYSTEM$STREAM_HAS_DATA Indicates whether a specified stream contains change data capture (CDC) records.

A.
+--------------------------------------------------------------+
A.
+--------------------------------------------------------------+
Answers
B.
| SYSTEM$CLUSTERING_INFORMATION('SF_DATA', '(COL1, COL3)') |
B.
| SYSTEM$CLUSTERING_INFORMATION('SF_DATA', '(COL1, COL3)') |
Answers
C.
|--------------------------------------------------------------|
C.
|--------------------------------------------------------------|
Answers
D.
| { |
D.
| { |
Answers
E.
| "cluster_by_keys" : "(COL1, COL3)", |
E.
| "cluster_by_keys" : "(COL1, COL3)", |
Answers
F.
| "total_partition_count" : 1156, |
F.
| "total_partition_count" : 1156, |
Answers
G.
| "total_constant_partition_count" : 0, |
G.
| "total_constant_partition_count" : 0, |
Answers
H.
| "average_overlaps" : 117.5484, |
H.
| "average_overlaps" : 117.5484, |
Answers
I.
| "average_depth" : 64.0701, |10. | "partition_depth_histogram" : { |11. | "00000" : 0, |12. | "00001" : 0, |13. | "00002" : 3, |14. | "00003" : 3, |15. | "00004" : 4, |16. | "00005" : 6, |17. | "00006" : 3, |18. | "00007" : 5, |19. | "00008" : 10, |20. | "00009" : 5, |21. | "00010" : 7, |22. | "00011" : 6, |23. | "00012" : 8, |24. | "00013" : 8, |25. | "00014" : 9, |26. | "00015" : 8, |27. | "00016" : 6, |28. | "00032" : 98, |29. | "00064" : 269, |30. | "00128" : 698 |31. | } |32. | } |33. +--------------------------------------------------------------+The Above example indicates that the SF_DATA table is not well-clustered for which of following valid reasons?
I.
| "average_depth" : 64.0701, |10. | "partition_depth_histogram" : { |11. | "00000" : 0, |12. | "00001" : 0, |13. | "00002" : 3, |14. | "00003" : 3, |15. | "00004" : 4, |16. | "00005" : 6, |17. | "00006" : 3, |18. | "00007" : 5, |19. | "00008" : 10, |20. | "00009" : 5, |21. | "00010" : 7, |22. | "00011" : 6, |23. | "00012" : 8, |24. | "00013" : 8, |25. | "00014" : 9, |26. | "00015" : 8, |27. | "00016" : 6, |28. | "00032" : 98, |29. | "00064" : 269, |30. | "00128" : 698 |31. | } |32. | } |33. +--------------------------------------------------------------+The Above example indicates that the SF_DATA table is not well-clustered for which of following valid reasons?
Answers
J.
Zero (0) constant micro-partitions out of 1156 total micro-partitions.
J.
Zero (0) constant micro-partitions out of 1156 total micro-partitions.
Answers
K.
High average of overlapping micro-partitions.
K.
High average of overlapping micro-partitions.
Answers
L.
High average of overlap depth across micro-partitions.
L.
High average of overlap depth across micro-partitions.
Answers
M.
Most of the micro-partitions are grouped at the lower-end of the histogram, with the majority of micro-partitions having an overlap depth between 64 and 128.
M.
Most of the micro-partitions are grouped at the lower-end of the histogram, with the majority of micro-partitions having an overlap depth between 64 and 128.
Answers
N.
ALL of the above
N.
ALL of the above
Answers
Suggested answer: E

Mark a Data Engineer, looking to implement streams on local views & want to use change tracking metadata for one of its Data Loading use case. Please select the incorrect understanding points of Mark with respect to usage of Streams on Views?

A.
For streams on views, change tracking must be enabled explicitly for the view and un-derlying tables to add the hidden columns to these tables.
A.
For streams on views, change tracking must be enabled explicitly for the view and un-derlying tables to add the hidden columns to these tables.
Answers
B.
The CDC records returned when querying a stream rely on a combination of the offset stored in the stream and the change tracking metadata stored in the table.
B.
The CDC records returned when querying a stream rely on a combination of the offset stored in the stream and the change tracking metadata stored in the table.
Answers
C.
Views with GROUP BY & LIMIT Clause are supported by Snowflake.
C.
Views with GROUP BY & LIMIT Clause are supported by Snowflake.
Answers
D.
As an alternative to streams, Snowflake supports querying change tracking metadata for views using the CHANGES clause for SELECT statements.
D.
As an alternative to streams, Snowflake supports querying change tracking metadata for views using the CHANGES clause for SELECT statements.
Answers
E.
Enabling change tracking adds a pair of hidden columns to the table and begins storing change tracking metadata. The values in these hidden CDC data columns provide the input for the stream metadata columns. The columns consume a small amount of stor-age.
E.
Enabling change tracking adds a pair of hidden columns to the table and begins storing change tracking metadata. The values in these hidden CDC data columns provide the input for the stream metadata columns. The columns consume a small amount of stor-age.
Answers
Suggested answer: C

Explanation:

A stream object records data manipulation language (DML) changes made to tables, including inserts, updates, and deletes, as well as metadata about each change, so that actions can be taken using the changed data. This process is referred to as change data capture (CDC). An individual table stream tracks the changes made to rows in a source table. A table stream (also referred to as simply a "stream") makes a "change table" available of what changed, at the row level, between two transactional points of time in a table. This allows querying and consuming a sequence of change records in a transactional fashion.

Streams can be created to query change data on the following objects:

· Standard tables, including shared tables.

· Views, including secure views · Directory tables · External tables

When created, a stream logically takes an initial snapshot of every row in the source object (e.g. table, external table, or the underlying tables for a view) by initializing a point in time (called an offset) as the current transactional version of the object. The change tracking system utilized by the stream then records information about the DML changes after this snapshot was taken. Change records provide the state of a row before and after the change. Change information mirrors the column structure of the tracked source object and includes additional metadata columns that describe each change event.

Note that a stream itself does not contain any table data. A stream only stores an offset for the source object and returns CDC records by leveraging the versioning history for the source object.

When the first stream for a table is created, a pair of hidden columns are added to the source table and begin storing change tracking metadata. These columns consume a small amount of storage. The CDC records returned when querying a stream rely on a combination of the offset stored in the stream and the change tracking metadata stored in the table. Note that for streams on views, change tracking must be enabled explicitly for the view and underlying tables to add the hidden columns to these tables.

Streams on views support both local views and views shared using Snowflake Secure Data Sharing, including secure views. Currently, streams cannot track changes in materialized views.

Views with the following operations are not yet supported:

· GROUP BY clauses · QUALIFY clauses · Subqueries not in the FROM clause · Correlated subqueries · LIMIT clauses Change Tracking:

Change tracking must be enabled in the underlying tables.

Prior to creating a stream on a view, you must enable change tracking on the underlying tables for the view.

Set the CHANGE_TRACKING parameter when creating a view (using CREATE VIEW) or later (using ALTER VIEW).

As an alternative to streams, Snowflake supports querying change tracking metadata for tables or views using the CHANGES clause for SELECT statements. The CHANGES clause enables query-ing change tracking metadata between two points in time without having to create a stream with an explicit transactional offset.

To advance the offset of a stream to the current table version without consuming the change data in a DML operation, which of the following operations can be done by Data Engineer? [Select 2]

A.
using the CREATE OR REPLACE STREAM syntax, Recreate the STREAM
A.
using the CREATE OR REPLACE STREAM syntax, Recreate the STREAM
Answers
B.
Insert the current change data into a temporary table. In the INSERT statement, query the stream but include a WHERE clause that filters out all of the change data (e.g. WHERE 0 = 1).
B.
Insert the current change data into a temporary table. In the INSERT statement, query the stream but include a WHERE clause that filters out all of the change data (e.g. WHERE 0 = 1).
Answers
C.
A stream advances the offset only when it is used in a DML transaction, so none of the options works without consuming the change data of table.
C.
A stream advances the offset only when it is used in a DML transaction, so none of the options works without consuming the change data of table.
Answers
D.
Delete the offset using STREAM properties SYSTEM$RESET_OFFSET( <stream_id> )
D.
Delete the offset using STREAM properties SYSTEM$RESET_OFFSET( <stream_id> )
Answers
Suggested answer: A, B

Explanation:

When created, a stream logically takes an initial snapshot of every row in the source object (e.g. table, external table, or the underlying tables for a view) by initializing a point in time (called an offset) as the current transactional version of the object. The change tracking system utilized by the stream then records information about the DML changes after this snapshot was taken. Change records provide the state of a row before and after the change. Change information mirrors the column structure of the tracked source object and includes additional metadata columns that describe each change event.

Note that a stream itself does not contain any table data. A stream only stores an offset for the source object and returns CDC records by leveraging the versioning history for the source object.

A new table version is created whenever a transaction that includes one or more DML statements is committed to the table.

In the transaction history for a table, a stream offset is located between two table versions. Querying a stream returns the changes caused by transactions committed after the offset and at or before the current time.

Multiple queries can independently consume the same change data from a stream without changing the offset. A stream advances the offset only when it is used in a DML transaction. This behavior applies to both explicit and autocommit transactions. (By default, when a DML statement is execut-ed, an autocommit transaction is implicitly started and the transaction is committed at the completion of the statement. This behavior is controlled with the AUTOCOMMIT parameter.) Querying a stream alone does not advance its offset, even within an explicit transaction; the stream contents must be consumed in a DML statement.

To advance the offset of a stream to the current table version without consuming the change data in a DML operation, complete either of the following actions:

· Recreate the stream (using the CREATE OR REPLACE STREAM syntax).

Insert the current change data into a temporary table. In the INSERT statement, query the stream but include a WHERE clause that filters out all of the change data (e.g. WHERE 0 = 1).

Data Engineer is performing below steps in sequence while working on Stream s1 created on table t1.

Step 1: Begin transaction.

Step 2: Query stream s1 on table t1.

Step 3: Update rows in table t1.

Step 4: Query stream s1.

Step 5: Commit transaction.

Step 6: Begin transaction.

Step 7: Query stream s1.

Mark the Incorrect Operational statements:

A.
For Step 2, The stream returns the change data capture records between the current position to the Transaction 1 start time. If the stream is used in a DML statement, the stream is then locked to avoid changes by concurrent transactions.
A.
For Step 2, The stream returns the change data capture records between the current position to the Transaction 1 start time. If the stream is used in a DML statement, the stream is then locked to avoid changes by concurrent transactions.
Answers
B.
For Step 4, Returns the CDC data records by streams with updated rows happened in the Step 3 because Streams works in Repeated committed mode in which statements see any changes made by previous statements executed within the same transaction, even though those changes are not yet committed.
B.
For Step 4, Returns the CDC data records by streams with updated rows happened in the Step 3 because Streams works in Repeated committed mode in which statements see any changes made by previous statements executed within the same transaction, even though those changes are not yet committed.
Answers
C.
For Step 5, If the stream was consumed in DML statements within the transaction, the stream position advances to the transaction start time.
C.
For Step 5, If the stream was consumed in DML statements within the transaction, the stream position advances to the transaction start time.
Answers
D.
For Step 7, Results do include table changes committed by Transaction 1.
D.
For Step 7, Results do include table changes committed by Transaction 1.
Answers
E.
if Transaction 2 had begun before Transaction 1 was committed, queries to the stream would have returned a snapshot of the stream from the position of the stream to the be-ginning time of Transaction 2 and would not see any changes committed by Transac-tion 1.
E.
if Transaction 2 had begun before Transaction 1 was committed, queries to the stream would have returned a snapshot of the stream from the position of the stream to the be-ginning time of Transaction 2 and would not see any changes committed by Transac-tion 1.
Answers
Suggested answer: B

Explanation:

Streams support repeatable read isolation. In repeatable read mode, multiple SQL statements within a transaction see the same set of records in a stream. This differs from the read committed mode supported for tables, in which statements see any changes made by previous statements executed within the same transaction, even though those changes are not yet committed.

The delta records returned by streams in a transaction is the range from the current position of the stream until the transaction start time. The stream position advances to the transaction start time if the transaction commits; otherwise, it stays at the same position.

Within Transaction 1, all queries to stream s1 see the same set of records. DML changes to table t1 are recorded to the stream only when the transaction is committed.

In Transaction 2, queries to the stream see the changes recorded to the table in Transaction 1. Note that if Transaction 2 had begun before Transaction 1 was committed, queries to the stream would have returned a snapshot of the stream from the position of the stream to the beginning time of Transaction 2 and would not see any changes committed by Transaction 1.

Streams record the differences between two offsets. If a row is added and then updated in the current offset, what will be the value of METADATA^^SUPDATE Columns in this scenario?

A.
TRUE
A.
TRUE
Answers
B.
FALSE
B.
FALSE
Answers
C.
UPDATE
C.
UPDATE
Answers
D.
INSERT
D.
INSERT
Answers
Suggested answer: B

Explanation:

Stream Columns

A stream stores an offset for the source object and not any actual table columns or data. When queried, a stream accesses and returns the historic data in the same shape as the source object (i.e. the same column names and ordering) with the following additional columns:

METADATA$ACTION Indicates the DML operation (INSERT, DELETE) recorded.

METADATA^^SUPDATE Indicates whether the operation was part of an UPDATE statement. Updates to rows in the source object are represented as a pair of DELETE and INSERT records in the stream with a metadata column METADATA^^SUPDATE values set to TRUE.

METADATA$ROW_ID Specifies the unique and immutable ID for the row, which can be used to track changes to specific rows over time.

Note that streams record the differences between two offsets. If a row is added and then updated in the current offset, the delta change is a new row. The METADATA^^SUPDATE row records a FALSE value.

Mark the Incorrect Statements with respect to types of streams supported by Snowflake?

A.
Standard streams cannot retrieve update data for geospatial data.
A.
Standard streams cannot retrieve update data for geospatial data.
Answers
B.
An append-only stream returns the appended rows only and therefore can be much more performant than a standard stream for extract, load, transform (ELT).
B.
An append-only stream returns the appended rows only and therefore can be much more performant than a standard stream for extract, load, transform (ELT).
Answers
C.
Insert-only Stream supported on external tables only.
C.
Insert-only Stream supported on external tables only.
Answers
D.
An insert-only stream tracks row inserts & Delete ops only
D.
An insert-only stream tracks row inserts & Delete ops only
Answers
Suggested answer: D

Explanation:

Standard Stream:

Supported for streams on tables, directory tables, or views. A standard (i.e. delta) stream tracks all

DML changes to the source object, including inserts, updates, and deletes (including table truncates).

This stream type performs a join on inserted and deleted rows in the change set to provide the row level delta. As a net effect, for example, a row that is inserted and then deleted between two transactional points of time in a table is removed in the delta (i.e. is not returned when the stream is queried).

Append-only Stream:

Supported for streams on standard tables, directory tables, or views. An append-only stream tracks row inserts only. Update and delete operations (including table truncates) are not recorded. For example, if 10 rows are inserted into a table and then 5 of those rows are deleted before the offset for an append-only stream is advanced, the stream records 10 rows.

An append-only stream returns the appended rows only and therefore can be much more performant than a standard stream for extract, load, transform (ELT) and similar scenarios that depend exclu-sively on row inserts. For example, a source table can be truncated immediately after the rows in an append-only stream are consumed, and the record deletions do not contribute to the overhead the next time the stream is queried or consumed.

Insert-only Stream:

Supported for streams on external tables only. An insert-only stream tracks row inserts only; they do not record delete operations that remove rows from an inserted set (i.e. no-ops). For example, inbetween any two offsets, if File1 is removed from the cloud storage location referenced by the external table, and File2 is added, the stream returns records for the rows in File2 only. Unlike when tracking CDC data for standard tables, Snowflake cannot access the historical records for files in cloud storage.

Stuart, a Lead Data Engineer in MACRO Data Company created streams on set of External tables. He has been asked to extend the data retention period of the stream for 90 days, which parameter he can utilize to enable this extension?

A.
MAX_DATA_EXTENSION_TIME_IN_DAYS
A.
MAX_DATA_EXTENSION_TIME_IN_DAYS
Answers
B.
DATA_RETENTION_TIME_IN_DAYS
B.
DATA_RETENTION_TIME_IN_DAYS
Answers
C.
DATA_EXTENSION_TIME_IN_DAYS
C.
DATA_EXTENSION_TIME_IN_DAYS
Answers
D.
None of the above
D.
None of the above
Answers
Suggested answer: D

Explanation:

External tables do not have data retention period applicable.

Good to Understand other Options available.

DATA_RETENTION_TIME_IN_DAYS Type: Object (for databases, schemas, and tables) — Can be set for Account » Database » Schema » Table

Description: Number of days for which Snowflake retains historical data for performing Time Trav-el actions (SELECT, CLONE, UNDROP) on the object. A value of 0 effectively disables Time Travel for the specified database, schema, or table.

Values:

0 or 1 (for Standard Edition)

0 to 90 (for Enterprise Edition or higher)

Default:

1

MAX_DATA_EXTENSION_TIME_IN_DAYS

Type: Object (for databases, schemas, and tables) — Can be set for Account » Database » Schema »

Table

Description: Maximum number of days for which Snowflake can extend the data retention period for tables to prevent streams on the tables from becoming stale. By default, if the DATA_ RETENTION_TIME_IN_DAYS setting for a source table is less than 14 days, and a stream has not been consumed, Snowflake temporarily extends this period to the stream's offset, up to a maximum of 14 days, regardless of the Snowflake Edition for your account. The MAX_DATA_EXTENSION_TIME_IN_DAYS parameter enables you to limit this automatic ex-tension period to control storage costs for data retention or for compliance reasons.

This parameter can be set at the account, database, schema, and table levels. Note that setting the parameter at the account or schema level only affects tables for which the parameter has not already been explicitly set at a lower level (e.g. at the table level by the table owner). A value of 0 effective-ly disables the automatic extension for the specified database, schema, or table.

Values:

0 to 90 (i.e. 90 days) — a value of 0 disables the automatic extension of the data retention period. To increase the maximum value for tables in your account, Client needs to contact Snowflake Sup-port.

Default: 14

Ron, Snowflake Developer needs to capture change data (insert only) on the source views, for that he follows the below steps:

Enable change tracking on the source views & its underlying tables.

Inserted the data via Scripts scheduled with the help of Tasks.

then simply run the below Select statements.

A.
select *
A.
select *
Answers
B.
from test_table
B.
from test_table
Answers
C.
changes(information => append_only)
C.
changes(information => append_only)
Answers
D.
at(timestamp => (select current_timestamp()));Select the Correct Query Execution Output option below:
D.
at(timestamp => (select current_timestamp()));Select the Correct Query Execution Output option below:
Answers
E.
Developer missed to create stream on the source table which can further query to cap-ture DML records.
E.
Developer missed to create stream on the source table which can further query to cap-ture DML records.
Answers
F.
Select query will fail with error: 'SQL compilation error-Incorrect Keyword "Chang-es()" found'
F.
Select query will fail with error: 'SQL compilation error-Incorrect Keyword "Chang-es()" found'
Answers
G.
No Error reported, select command gives Changed records with Metadata columns as change tracking enabled on the Source views & its underlying tables.
G.
No Error reported, select command gives Changed records with Metadata columns as change tracking enabled on the Source views & its underlying tables.
Answers
H.
Select statement complied but gives erroneous results.
H.
Select statement complied but gives erroneous results.
Answers
Suggested answer: C

Explanation:

As an alternative to streams, Snowflake supports querying change tracking metadata for tables or views using the CHANGES clause for SELECT statements. The CHANGES clause enables query-ing change tracking metadata between two points in time without having to create a stream with an explicit transactional offset.

To Know more about Snowflake CHANGES clause, please refer the mentioned link:

https://docs.snowflake.com/en/sql-reference/constructs/changes

Total 130 questions
Go to page: of 13