Skip to content

Commit 256f156

Browse files
committed
Fix checkstyle violations
1 parent e0fcc34 commit 256f156

File tree

28 files changed

+143
-134
lines changed

28 files changed

+143
-134
lines changed

core/trino-main/src/test/java/io/trino/operator/window/WindowAssertions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public final class WindowAssertions
9494
) AS orders (orderkey, orderstatus, orderdate)
9595
""";
9696

97-
private WindowAssertions() { }
97+
private WindowAssertions() {}
9898

9999
public static void assertWindowQuery(@Language("SQL") String sql, MaterializedResult expected, QueryRunner queryRunner)
100100
{

core/trino-main/src/test/java/io/trino/sql/planner/optimizations/TestAdaptivePartitioning.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,6 @@ public void testSkipBroadcastSubtree()
218218
true);
219219
}
220220

221-
222-
223221
private Session getSession()
224222
{
225223
return Session.builder(getPlanTester().getDefaultSession())

core/trino-main/src/test/java/io/trino/sql/planner/optimizations/TestColocatedJoin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void testColocatedJoinWhenNumberOfBucketsInTableScanIsNotSufficient()
123123
WHERE
124124
orders.column_a = t.column_a
125125
AND orders.column_b = t.column_b
126-
""",
126+
""",
127127
prepareSession(20, colocatedJoinEnabled),
128128
anyTree(
129129
anyTree(

core/trino-main/src/test/java/io/trino/sql/query/TestIssue23787.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ WITH t(a, b) AS (
3535
WHEN a = 2 OR b THEN 'b'
3636
ELSE 'c'
3737
END = 'b'
38-
FROM t
38+
FROM t
3939
"""))
4040
.matches("VALUES false");
4141
}

core/trino-main/src/test/java/io/trino/sql/query/TestJoin.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,18 +317,18 @@ void testFilterThatMayFail()
317317
assertThat(assertions.query(
318318
"""
319319
WITH
320-
t(x,y) AS (
321-
VALUES
320+
t(x,y) AS (
321+
VALUES
322322
('a', '1'),
323323
('b', 'x'),
324324
(null, 'y')
325-
),
326-
u(x,y) AS (
327-
VALUES
325+
),
326+
u(x,y) AS (
327+
VALUES
328328
('a', '1'),
329329
('c', 'x'),
330330
(null, 'y')
331-
)
331+
)
332332
SELECT *
333333
FROM t JOIN u ON t.x = u.x
334334
WHERE CAST(t.y AS int) = 1
@@ -341,8 +341,8 @@ WHERE CAST(t.y AS int) = 1
341341
a(k, v) AS (VALUES if(random() >= 0, (1, CAST('10' AS varchar)))),
342342
b(k, v) AS (VALUES if(random() >= 0, (1, CAST('foo' AS varchar)))),
343343
t AS (
344-
SELECT k, CAST(v AS BIGINT) v1, v
345-
FROM a)
344+
SELECT k, CAST(v AS BIGINT) v1, v
345+
FROM a)
346346
SELECT t.k, b.k
347347
FROM t JOIN b ON t.k = b.k AND t.v1 = 10 AND t.v = b.v
348348
"""))

core/trino-main/src/test/java/io/trino/sql/query/TestRandom.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,23 @@ public void test()
4040
assertThat(assertions.query(
4141
"""
4242
WITH t(a, b) AS (SELECT random(), random())
43-
SELECT a = b
43+
SELECT a = b
4444
FROM t
4545
"""))
4646
.matches("VALUES false");
4747

4848
assertThat(assertions.query(
4949
"""
5050
WITH t(a, b) AS (VALUES (random(), random()))
51-
SELECT a = b
51+
SELECT a = b
5252
FROM t
5353
"""))
5454
.matches("VALUES false");
5555

5656
assertThat(assertions.query(
5757
"""
5858
WITH t(a, b) AS (SELECT transform(array[1], x -> random())[1], transform(array[1], x -> random())[1])
59-
SELECT a = b
59+
SELECT a = b
6060
FROM t
6161
"""))
6262
.matches("VALUES false");

core/trino-parser/src/test/java/io/trino/sql/parser/TestSqlParser.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -868,18 +868,18 @@ public void testIntersect()
868868
assertStatement("SELECT 123 INTERSECT DISTINCT CORRESPONDING SELECT 123 INTERSECT ALL CORRESPONDING SELECT 123",
869869
query(new Intersect(
870870
ImmutableList.of(
871-
new Intersect(ImmutableList.of(createSelect123(), createSelect123()), true, Optional.of(new Corresponding(location(1 ,1), List.of()))),
871+
new Intersect(ImmutableList.of(createSelect123(), createSelect123()), true, Optional.of(new Corresponding(location(1, 1), List.of()))),
872872
createSelect123()),
873873
false,
874-
Optional.of(new Corresponding(location(1 ,1), List.of())))));
874+
Optional.of(new Corresponding(location(1, 1), List.of())))));
875875

876876
assertStatement("SELECT 123 INTERSECT DISTINCT CORRESPONDING BY (x) SELECT 123 INTERSECT ALL CORRESPONDING SELECT 123",
877877
query(new Intersect(
878878
ImmutableList.of(
879-
new Intersect(ImmutableList.of(createSelect123(), createSelect123()), true, Optional.of(new Corresponding(location(1 ,1), List.of(identifier("x"))))),
879+
new Intersect(ImmutableList.of(createSelect123(), createSelect123()), true, Optional.of(new Corresponding(location(1, 1), List.of(identifier("x"))))),
880880
createSelect123()),
881881
false,
882-
Optional.of(new Corresponding(location(1 ,1), List.of())))));
882+
Optional.of(new Corresponding(location(1, 1), List.of())))));
883883
}
884884

885885
@Test
@@ -896,18 +896,18 @@ public void testUnion()
896896
assertStatement("SELECT 123 UNION DISTINCT CORRESPONDING SELECT 123 UNION ALL CORRESPONDING SELECT 123",
897897
query(new Union(
898898
ImmutableList.of(
899-
new Union(ImmutableList.of(createSelect123(), createSelect123()), true, Optional.of(new Corresponding(location(1 ,1), List.of()))),
899+
new Union(ImmutableList.of(createSelect123(), createSelect123()), true, Optional.of(new Corresponding(location(1, 1), List.of()))),
900900
createSelect123()),
901901
false,
902-
Optional.of(new Corresponding(location(1 ,1), List.of())))));
902+
Optional.of(new Corresponding(location(1, 1), List.of())))));
903903

904904
assertStatement("SELECT 123 UNION DISTINCT CORRESPONDING BY (x) SELECT 123 UNION ALL CORRESPONDING SELECT 123",
905905
query(new Union(
906906
ImmutableList.of(
907-
new Union(ImmutableList.of(createSelect123(), createSelect123()), true, Optional.of(new Corresponding(location(1 ,1), List.of(identifier("x"))))),
907+
new Union(ImmutableList.of(createSelect123(), createSelect123()), true, Optional.of(new Corresponding(location(1, 1), List.of(identifier("x"))))),
908908
createSelect123()),
909909
false,
910-
Optional.of(new Corresponding(location(1 ,1), List.of())))));
910+
Optional.of(new Corresponding(location(1, 1), List.of())))));
911911
}
912912

913913
@Test
@@ -924,18 +924,18 @@ public void testExcept()
924924
assertStatement("SELECT 123 EXCEPT DISTINCT CORRESPONDING SELECT 123 EXCEPT ALL CORRESPONDING SELECT 123",
925925
query(new Except(
926926
location(1, 1),
927-
new Except(location(1, 1), createSelect123(), createSelect123(), true, Optional.of(new Corresponding(location(1 ,1), List.of()))),
927+
new Except(location(1, 1), createSelect123(), createSelect123(), true, Optional.of(new Corresponding(location(1, 1), List.of()))),
928928
createSelect123(),
929929
false,
930-
Optional.of(new Corresponding(location(1 ,1), List.of())))));
930+
Optional.of(new Corresponding(location(1, 1), List.of())))));
931931

932932
assertStatement("SELECT 123 EXCEPT DISTINCT CORRESPONDING BY (x) SELECT 123 EXCEPT ALL CORRESPONDING SELECT 123",
933933
query(new Except(
934934
location(1, 1),
935-
new Except(location(1, 1), createSelect123(), createSelect123(), true, Optional.of(new Corresponding(location(1 ,1), List.of(identifier("x"))))),
935+
new Except(location(1, 1), createSelect123(), createSelect123(), true, Optional.of(new Corresponding(location(1, 1), List.of(identifier("x"))))),
936936
createSelect123(),
937937
false,
938-
Optional.of(new Corresponding(location(1 ,1), List.of())))));
938+
Optional.of(new Corresponding(location(1, 1), List.of())))));
939939
}
940940

941941
private static QuerySpecification createSelect123()
@@ -3519,22 +3519,23 @@ THEN INSERT (part, qty) VALUES (c.part, c.qty)
35193519
ON true
35203520
WHEN MATCHED
35213521
THEN DELETE
3522-
""")).isEqualTo(new Merge(
3523-
location,
3524-
new AliasedRelation(
3525-
new Table(
3526-
location(1, 1),
3527-
QualifiedName.of(List.of(new Identifier(location(1, 12), "inventory", false))),
3528-
Optional.of(new Identifier(location(1, 24), "dev", false))),
3529-
new Identifier(location(1, 31), "i", false),
3530-
null),
3531-
new AliasedRelation(
3532-
location(2, 9),
3533-
new Table(location(2, 9), QualifiedName.of(List.of(new Identifier(location(2, 9), "changes", false)))),
3534-
new Identifier(location(2, 20), "c", false),
3535-
null),
3536-
new BooleanLiteral(location(3, 6), "true"),
3537-
ImmutableList.of(new MergeDelete(location(4, 1), Optional.empty()))));
3522+
"""))
3523+
.isEqualTo(new Merge(
3524+
location,
3525+
new AliasedRelation(
3526+
new Table(
3527+
location(1, 1),
3528+
QualifiedName.of(List.of(new Identifier(location(1, 12), "inventory", false))),
3529+
Optional.of(new Identifier(location(1, 24), "dev", false))),
3530+
new Identifier(location(1, 31), "i", false),
3531+
null),
3532+
new AliasedRelation(
3533+
location(2, 9),
3534+
new Table(location(2, 9), QualifiedName.of(List.of(new Identifier(location(2, 9), "changes", false)))),
3535+
new Identifier(location(2, 20), "c", false),
3536+
null),
3537+
new BooleanLiteral(location(3, 6), "true"),
3538+
ImmutableList.of(new MergeDelete(location(4, 1), Optional.empty()))));
35383539
}
35393540

35403541
@Test
@@ -6706,7 +6707,6 @@ public void testListagg()
67066707
new BooleanLiteral(location(1, 1), "true"),
67076708
new StringLiteral(location(1, 1), "..."),
67086709
new BooleanLiteral(location(1, 1), "false"))));
6709-
67106710
}
67116711

67126712
@Test
@@ -7139,7 +7139,7 @@ public void testSessionProperty()
71397139
Optional.empty(),
71407140
new QuerySpecification(
71417141
location(4, 1),
7142-
new Select(location(4, 1), false, ImmutableList.of(new SingleColumn(location(4, 8), new LongLiteral(location(4, 8),"1"), Optional.empty()))),
7142+
new Select(location(4, 1), false, ImmutableList.of(new SingleColumn(location(4, 8), new LongLiteral(location(4, 8), "1"), Optional.empty()))),
71437143
Optional.empty(),
71447144
Optional.empty(),
71457145
Optional.empty(),
@@ -7163,7 +7163,7 @@ public void testInvalidQueryScoped()
71637163

71647164
// Session after function
71657165
assertStatementIsInvalid("WITH FUNCTION abc() RETURNS int RETURN 42, SESSION query_max_memory = '1GB' SELECT 1")
7166-
.withMessage("line 1:44: mismatched input 'SESSION'. Expecting: 'FUNCTION'");
7166+
.withMessage("line 1:44: mismatched input 'SESSION'. Expecting: 'FUNCTION'");
71677167

71687168
// Session after function
71697169
assertStatementIsInvalid("WITH SESSION query_max_memory = '1GB', FUNCTION abc() RETURNS int RETURN 42, SESSION query_max_total_memory = '1GB' SELECT 1")
@@ -7203,7 +7203,7 @@ FUNCTION foo()
72037203
Optional.empty(),
72047204
new QuerySpecification(
72057205
location(7, 1),
7206-
new Select(location(7, 1), false, ImmutableList.of(new SingleColumn(location(7, 8), new LongLiteral(location(7, 8),"1"), Optional.empty()))),
7206+
new Select(location(7, 1), false, ImmutableList.of(new SingleColumn(location(7, 8), new LongLiteral(location(7, 8), "1"), Optional.empty()))),
72077207
Optional.empty(),
72087208
Optional.empty(),
72097209
Optional.empty(),

lib/trino-hive-formats/src/test/java/io/trino/hive/formats/esri/TestEsriDeserializer.java

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ public void testDeserializeSimpleFeature()
112112
}
113113

114114
@Test
115-
public void testDeserializeNullValues() throws IOException
115+
public void testDeserializeNullValues()
116+
throws IOException
116117
{
117118
String json = """
118119
{
@@ -235,7 +236,8 @@ public void testUnsupportedAttributeTypes()
235236
}
236237

237238
@Test
238-
public void testDeserializeMissingColumns() throws IOException
239+
public void testDeserializeMissingColumns()
240+
throws IOException
239241
{
240242
String json = """
241243
{
@@ -262,7 +264,9 @@ public void testDeserializeInvalidJson()
262264
}
263265

264266
@Test
265-
public void testDeserializeDateFormats() throws IOException {
267+
public void testDeserializeDateFormats()
268+
throws IOException
269+
{
266270
// Test valid epoch milliseconds (as number)
267271
String jsonEpoch = """
268272
{
@@ -320,7 +324,9 @@ public void testDeserializeDateFormats() throws IOException {
320324
}
321325

322326
@Test
323-
public void testDeserializeTimestampFormats() throws IOException {
327+
public void testDeserializeTimestampFormats()
328+
throws IOException
329+
{
324330
String[] validTimestampFormats = {
325331
"2025-03-03 00:00:00.000", // with leading zeros
326332
"2025-03-03 00:00:00",
@@ -387,7 +393,9 @@ public void testDeserializeTimestampFormats() throws IOException {
387393
}
388394

389395
@Test
390-
public void testDeserializeInvalidDateFormat() throws IOException {
396+
public void testDeserializeInvalidDateFormat()
397+
throws IOException
398+
{
391399
String json = """
392400
{
393401
"attributes": {
@@ -402,7 +410,9 @@ public void testDeserializeInvalidDateFormat() throws IOException {
402410
}
403411

404412
@Test
405-
public void testDeserializeInvalidTimestampFormat() throws IOException {
413+
public void testDeserializeInvalidTimestampFormat()
414+
throws IOException
415+
{
406416
String json = """
407417
{
408418
"attributes": {
@@ -417,7 +427,9 @@ public void testDeserializeInvalidTimestampFormat() throws IOException {
417427
}
418428

419429
@Test
420-
public void testDeserializeDateOutOfRange() throws IOException {
430+
public void testDeserializeDateOutOfRange()
431+
throws IOException
432+
{
421433
String json = """
422434
{
423435
"attributes": {
@@ -595,7 +607,8 @@ private static Page parse(String json)
595607
}
596608

597609
private static Page parse(String json, List<Column> columns)
598-
throws IOException {
610+
throws IOException
611+
{
599612
JsonParser jsonParser = JSON_FACTORY.createParser(json);
600613
assertThat(jsonParser.nextToken()).isEqualTo(START_OBJECT);
601614

plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/BaseJdbcConnectorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,7 @@ public void testDeleteWithVarcharEqualityPredicate()
19301930
{
19311931
skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE) && hasBehavior(SUPPORTS_ROW_LEVEL_DELETE));
19321932
// TODO (https://github.com/trinodb/trino/issues/5901) Use longer table name once Oracle version is updated
1933-
try (TestTable table = createTestTableForWrites( "test_delete_varchar", "(col varchar(1), pk INT)", ImmutableList.of("'a', 1", "'A', 2", "null, 3"), "pk")) {
1933+
try (TestTable table = createTestTableForWrites("test_delete_varchar", "(col varchar(1), pk INT)", ImmutableList.of("'a', 1", "'A', 2", "null, 3"), "pk")) {
19341934
if (!hasBehavior(SUPPORTS_PREDICATE_PUSHDOWN_WITH_VARCHAR_EQUALITY) && !hasBehavior(SUPPORTS_ROW_LEVEL_UPDATE)) {
19351935
assertQueryFails("DELETE FROM " + table.getName() + " WHERE col = 'A'", MODIFYING_ROWS_MESSAGE);
19361936
return;

plugin/trino-bigquery/src/test/java/io/trino/plugin/bigquery/BaseBigQueryConnectorTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ public void testExecuteProcedureWithInvalidQuery()
12331233
@Test
12341234
public void testLimitPushdownWithExternalTable()
12351235
{
1236-
String externalTableName = TEST_SCHEMA + ".region_external_table_" + randomNameSuffix();
1236+
String externalTableName = TEST_SCHEMA + ".region_external_table_" + randomNameSuffix();
12371237
onBigQuery("CREATE EXTERNAL TABLE " + externalTableName + " OPTIONS (format = 'CSV', uris = ['gs://" + gcpStorageBucket + "/tpch/tiny/region.csv'])");
12381238
try {
12391239
assertLimitPushdownOnRegionTable(getSession(), externalTableName);
@@ -1262,7 +1262,7 @@ public void testLimitPushdownWithView()
12621262
@Test
12631263
public void testLimitPushdownWithMaterializedView()
12641264
{
1265-
String mvName = TEST_SCHEMA + ".region_mv_" + randomNameSuffix();
1265+
String mvName = TEST_SCHEMA + ".region_mv_" + randomNameSuffix();
12661266
onBigQuery("CREATE MATERIALIZED VIEW " + mvName + " AS SELECT * FROM tpch.region");
12671267
try {
12681268
// materialized view with materialization uses storage api, with storage api limit pushdown is not supported
@@ -1531,5 +1531,4 @@ private void onBigQuery(@Language("SQL") String sql)
15311531
{
15321532
bigQuerySqlExecutor.execute(sql);
15331533
}
1534-
15351534
}

0 commit comments

Comments
 (0)