
Explanation:
The correct answer is B. Here's why:
_commit_version set to 0._commit_version to 1._commit_version to 2._commit_version to 3._commit_version to 4.max(_commit_version) is 4. The max(version) is '6.2.0' because the table_changes function includes both the original and updated values for updated records, with '6.2.0' being the original value before the update.Ultimate access to all questions.
What is the correct output when the following set of commands is executed in Databricks?
CREATE TABLE versions (software STRING, version STRING) TBLPROPERTIES (delta.enableChangeDataFeed = true);
INSERT INTO versions VALUES (‘IDE’, ‘6.2.0’);
UPDATE versions SET version = ‘5.1.0’ WHERE software = ‘IDE’;
INSERT INTO versions VALUES (‘IDE-1’, ‘1.3.0’);
DELETE FROM versions WHERE version = ‘1.3.0’;
SELECT max(_commit_version), max(version) FROM table_changes(‘versions’, 2);
CREATE TABLE versions (software STRING, version STRING) TBLPROPERTIES (delta.enableChangeDataFeed = true);
INSERT INTO versions VALUES (‘IDE’, ‘6.2.0’);
UPDATE versions SET version = ‘5.1.0’ WHERE software = ‘IDE’;
INSERT INTO versions VALUES (‘IDE-1’, ‘1.3.0’);
DELETE FROM versions WHERE version = ‘1.3.0’;
SELECT max(_commit_version), max(version) FROM table_changes(‘versions’, 2);
A
+-----------------------+---------------+
| max(_commit_version) | max(version) |
+-----------------------+---------------+
| 3 | 6.2.0 |
+-----------------------+---------------+
+-----------------------+---------------+
| max(_commit_version) | max(version) |
+-----------------------+---------------+
| 3 | 6.2.0 |
+-----------------------+---------------+
B
+-----------------------+---------------+
| max(_commit_version) | max(version) |
+-----------------------+---------------+
| 4 | 6.2.0 |
+-----------------------+---------------+
+-----------------------+---------------+
| max(_commit_version) | max(version) |
+-----------------------+---------------+
| 4 | 6.2.0 |
+-----------------------+---------------+
C
+-----------------------+---------------+
| max(_commit_version) | max(version) |
+-----------------------+---------------+
| 4 | 5.1.0 |
+-----------------------+---------------+
+-----------------------+---------------+
| max(_commit_version) | max(version) |
+-----------------------+---------------+
| 4 | 5.1.0 |
+-----------------------+---------------+
D
+-----------------------+---------------+
| D91873(_commit_version) | max(version) |
+-----------------------+---------------+
| 3 | 1.3.0 |
+-----------------------+---------------+
+-----------------------+---------------+
| D91873(_commit_version) | max(version) |
+-----------------------+---------------+
| 3 | 1.3.0 |
+-----------------------+---------------+
E
+-----------------------+---------------+
| max(_commit_version) | max(version) |
+-----------------------+---------------+
| 3 | 5.1.0 |
+-----------------------+---------------+
+-----------------------+---------------+
| max(_commit_version) | max(version) |
+-----------------------+---------------+
| 3 | 5.1.0 |
+-----------------------+---------------+
No comments yet.