@@ -44,14 +44,13 @@ public void appendConnectionUri(StringBuilder uri) {
44
44
}
45
45
46
46
@ BeforeClass
47
- public static void setupPostgreSQL (){
48
- database = env .getTestHelper ().createTestDatabase (Dialect .POSTGRESQL , Collections .emptyList ());;
47
+ public static void setupPostgreSQL () {
48
+ database = env .getTestHelper ().createTestDatabase (Dialect .POSTGRESQL , Collections .emptyList ());
49
+ ;
49
50
}
50
51
51
-
52
52
@ Before
53
53
public void createTestTable () {
54
-
55
54
try (Connection connection = createConnection ()) {
56
55
connection .setAutocommit (true );
57
56
if (!tableExists (connection , "TEST" )) {
@@ -63,21 +62,20 @@ public void createTestTable() {
63
62
connection .runBatch ();
64
63
}
65
64
}
66
-
67
65
}
68
66
69
67
@ Test
70
68
public void testExplainStatement () {
71
69
try (ITConnection connection = createConnection ()) {
72
70
connection .bufferedWrite (
73
71
Arrays .asList (
74
- Mutation .newInsertBuilder ("TEST" ).set ("ID" ).to (1L ).set ("NAME" ).to ("TEST-1 " ).build (),
75
- Mutation .newInsertBuilder ("TEST" ).set ("ID" ).to (2L ).set ("NAME" ).to ("TEST-2 " ).build ()));
72
+ Mutation .newInsertBuilder ("TEST" ).set ("ID" ).to (3L ).set ("NAME" ).to ("TEST-3 " ).build (),
73
+ Mutation .newInsertBuilder ("TEST" ).set ("ID" ).to (4L ).set ("NAME" ).to ("TEST-4 " ).build ()));
76
74
connection .commit ();
77
75
78
76
ResultSet resultSet =
79
77
connection .execute (Statement .of ("EXPLAIN SELECT * from TEST" )).getResultSet ();
80
- while (resultSet .next ()){
78
+ while (resultSet .next ()) {
81
79
assertNotNull (resultSet .getString ("QUERY PLAN" ));
82
80
}
83
81
assertEquals (1 , resultSet .getColumnCount ());
@@ -95,12 +93,11 @@ public void testExplainAnalyzeStatement() {
95
93
96
94
ResultSet resultSet =
97
95
connection .execute (Statement .of ("EXPLAIN ANALYZE SELECT * from TEST" )).getResultSet ();
98
- while (resultSet .next ()){
96
+ while (resultSet .next ()) {
99
97
assertNotNull (resultSet .getString ("QUERY PLAN" ));
100
98
assertNotNull (resultSet .getString ("EXECUTION STATS" ));
101
99
}
102
100
assertEquals (2 , resultSet .getColumnCount ());
103
101
}
104
102
}
105
-
106
103
}
0 commit comments