Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add read support for original files of ACID/Transactional tables #2930

Closed
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,22 +221,21 @@ public void testReadFullAcidWithOriginalFiles(boolean isPartitioned, BucketingTy
onHive().executeQuery("INSERT INTO TABLE " + tableName + hivePartitionString + " VALUES (22, 2)");
onHive().executeQuery("ALTER TABLE " + tableName + " SET " + hiveTableProperties(ACID, bucketingType));

String selectPrestoQuery = "SELECT col, fcol FROM " + tableName + " ORDER BY col";
// read with original files
assertThat(query(selectPrestoQuery)).containsOnly(row(21, 1), row(22, 2));
findepi marked this conversation as resolved.
Show resolved Hide resolved
assertThat(query("SELECT col, fcol FROM " + tableName)).containsOnly(row(21, 1), row(22, 2));
assertThat(query("SELECT col, fcol FROM " + tableName + " WHERE fcol = 1")).containsOnly(row(21, 1));

// read with original files and insert delta
onHive().executeQuery("INSERT INTO TABLE " + tableName + hivePartitionString + " VALUES (20, 3)");
assertThat(query(selectPrestoQuery)).containsOnly(row(20, 3), row(21, 1), row(22, 2));
assertThat(query("SELECT col, fcol FROM " + tableName)).containsOnly(row(20, 3), row(21, 1), row(22, 2));

// read with original files and delete delta
onHive().executeQuery("DELETE FROM " + tableName + " WHERE fcol = 2");
assertThat(query(selectPrestoQuery)).containsExactly(row(20, 3), row(21, 1));
assertThat(query("SELECT col, fcol FROM " + tableName)).containsOnly(row(20, 3), row(21, 1));

// read with original files and insert+delete delta (UPDATE)
onHive().executeQuery("UPDATE " + tableName + " SET col = 23 WHERE fcol = 1" + (isPartitioned ? " AND part_col = 2 " : ""));
assertThat(query(selectPrestoQuery)).containsExactly(row(20, 3), row(23, 1));
assertThat(query("SELECT col, fcol FROM " + tableName)).containsOnly(row(20, 3), row(23, 1));
}
finally {
onHive().executeQuery("DROP TABLE " + tableName);
Expand Down