@Override protected void starting(Description description) { try { PreparedStatement s = spliceClassWatcher.prepareStatement( String.format( "insert into %s.%s values (?, ?)", CLASS_NAME, TABLE_NAME_1)); s.setInt(1, 1); s.setInt(2, 10); s.execute(); } catch (Exception e) { throw new RuntimeException(e); } finally { spliceClassWatcher.closeAll(); } }
@Override protected void starting(Description description) { try { spliceClassWatcher.setAutoCommit(true); spliceClassWatcher.executeUpdate( format( "insert into %s (i) values 1,2,3,4,5,6,7,8,9,10", spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher, spliceTableWatcher)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) values 1,2,3,4,5,6,7,8,9,10", spliceTableWatcher2)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher2, spliceTableWatcher2)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher2, spliceTableWatcher2)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher2, spliceTableWatcher2)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher2, spliceTableWatcher2)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher2, spliceTableWatcher2)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher2, spliceTableWatcher2)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) select i from %s", spliceTableWatcher2, spliceTableWatcher2)); spliceClassWatcher.executeUpdate( format( "insert into %s (i) values 1,2,3,4,5,6,7,8,9,10", spliceTableWatcher3)); spliceClassWatcher.executeUpdate( format( "insert into %s (r_regionkey, r_name) values " + "(0, 'AFRICA'), (1, 'AMERICA'), (2, 'ASIA'), (3, 'EUROPE'), (4, 'MIDDLE EAST'), " + "(5, 'AMERICA'), (6, 'AMERICA'), (7, 'AMERICA'), (8, 'AMERICA'), (9, 'AMERICA')", spliceTableRegion)); spliceClassWatcher.executeUpdate( format( "insert into %s (n_nationkey, n_name, n_regionkey) values " + "(0, 'ALGERIA', 0), " + "(1, 'ARGENTINA', 1), " + "(2, 'BRAZIL', 1), " + "(4, 'EGYPT', 4), " + "(5, 'ETHIOPIA', 0), " + "(6, 'FRANCE', 3)", spliceTableNation)); spliceClassWatcher.execute( format( "call syscs_util.COLLECT_SCHEMA_STATISTICS('%s',false)", CLASS_NAME)); } catch (Exception e) { throw new RuntimeException(e); } finally { spliceClassWatcher.closeAll(); } }