Skip to content
Merged
Changes from all commits
Commits
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 @@ -62,10 +62,8 @@ protected SqlExecutor onRemoteDatabase()
return sqlServer::execute;
}

@Flaky(issue = "fn_dblog() returns information only about the active portion of the transaction log, therefore it is flaky", match = ".*")
@Test
public void testCreateTableAsSelectWriteBulkiness()
throws SQLException
{
testCreateTableAsSelectWriteBulkiness(true, true);
testCreateTableAsSelectWriteBulkiness(true, false);
Expand All @@ -74,7 +72,6 @@ public void testCreateTableAsSelectWriteBulkiness()
}

private void testCreateTableAsSelectWriteBulkiness(boolean bulkCopyForWrite, boolean bulkCopyLock)
throws SQLException
{
String table = "bulk_copy_ctas_" + randomNameSuffix();
Session session = Session.builder(getSession())
Expand All @@ -86,12 +83,6 @@ private void testCreateTableAsSelectWriteBulkiness(boolean bulkCopyForWrite, boo
assertQuerySucceeds(session, format("CREATE TABLE %s as SELECT * FROM tpch.tiny.customer", table));
assertQuery("SELECT * FROM " + table, "SELECT * FROM customer");

// check whether minimal logging was applied.
// Unlike fully logged operations, which use the transaction log to keep track of every row change,
// minimally logged operations keep track of extent allocations and meta-data changes only.
assertThat(getTableOperationsCount("LOP_INSERT_ROWS", table))
.isEqualTo(bulkCopyForWrite && bulkCopyLock ? 0 : 1500);

// check that there are no locks remaining on the target table after bulk copy
assertQuery("SELECT count(*) FROM " + table, "SELECT count(*) FROM customer");
assertUpdate(format("INSERT INTO %s SELECT * FROM tpch.tiny.customer LIMIT 1", table), 1);
Expand Down