Skip to content

Commit d849a98

Browse files
committed
Remove deprecated constructors from ColumnMetadata
1 parent 95bca6c commit d849a98

File tree

3 files changed

+5
-46
lines changed

3 files changed

+5
-46
lines changed

core/trino-main/src/test/java/io/trino/sql/analyzer/TestAnalyzer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5346,7 +5346,7 @@ public void setup()
53465346
new ConnectorTableMetadata(table3, ImmutableList.of(
53475347
new ColumnMetadata("a", BIGINT),
53485348
new ColumnMetadata("b", BIGINT),
5349-
new ColumnMetadata("x", BIGINT, null, true))),
5349+
ColumnMetadata.builder().setName("x").setType(BIGINT).setHidden(true).build())),
53505350
false));
53515351

53525352
// table in different catalog
@@ -5361,7 +5361,7 @@ public void setup()
53615361
inSetupTransaction(session -> metadata.createTable(session, TPCH_CATALOG,
53625362
new ConnectorTableMetadata(table5, ImmutableList.of(
53635363
new ColumnMetadata("a", BIGINT),
5364-
new ColumnMetadata("b", BIGINT, null, true))),
5364+
ColumnMetadata.builder().setName("b").setType(BIGINT).setHidden(true).build())),
53655365
false));
53665366

53675367
// table with a varchar column

core/trino-spi/src/main/java/io/trino/spi/connector/ColumnMetadata.java

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -43,47 +43,7 @@ public ColumnMetadata(String name, Type type)
4343
this(name, type, true, null, null, false, emptyMap());
4444
}
4545

46-
/**
47-
* @deprecated Use {@link #builder()} instead.
48-
*/
49-
@Deprecated
50-
public ColumnMetadata(String name, Type type, String comment)
51-
{
52-
this(name, type, true, comment, null, false, emptyMap());
53-
}
54-
55-
/**
56-
* @deprecated Use {@link #builder()} instead.
57-
*/
58-
@Deprecated
59-
public ColumnMetadata(String name, Type type, String comment, boolean hidden)
60-
{
61-
this(name, type, true, comment, null, hidden, emptyMap());
62-
}
63-
64-
/**
65-
* @deprecated Use {@link #builder()} instead.
66-
*/
67-
@Deprecated
68-
public ColumnMetadata(String name, Type type, String comment, String extraInfo, boolean hidden)
69-
{
70-
this(name, type, true, comment, extraInfo, hidden, emptyMap());
71-
}
72-
73-
/**
74-
* @deprecated Use {@link #builder()} instead.
75-
*/
76-
@Deprecated
77-
public ColumnMetadata(String name, Type type, String comment, String extraInfo, boolean hidden, Map<String, Object> properties)
78-
{
79-
this(name, type, true, comment, extraInfo, hidden, properties);
80-
}
81-
82-
/**
83-
* @deprecated Use {@link #builder()} instead.
84-
*/
85-
@Deprecated
86-
public ColumnMetadata(String name, Type type, boolean nullable, String comment, String extraInfo, boolean hidden, Map<String, Object> properties)
46+
private ColumnMetadata(String name, Type type, boolean nullable, String comment, String extraInfo, boolean hidden, Map<String, Object> properties)
8747
{
8848
checkNotEmpty(name, "name");
8949
requireNonNull(type, "type is null");

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import static io.trino.spi.type.VarcharType.createVarcharType;
4949
import static io.trino.testing.TestingConnectorSession.SESSION;
5050
import static io.trino.testing.assertions.TrinoExceptionAssert.assertTrinoExceptionThrownBy;
51-
import static java.util.Collections.emptyMap;
5251
import static org.assertj.core.api.Assertions.assertThat;
5352
import static org.assertj.core.api.Assertions.assertThatThrownBy;
5453
import static org.testng.Assert.assertEquals;
@@ -122,7 +121,7 @@ public void getTableMetadata()
122121
ConnectorTableMetadata tableMetadata = metadata.getTableMetadata(SESSION, tableHandle);
123122
assertEquals(tableMetadata.getTable(), new SchemaTableName("example", "numbers"));
124123
assertEquals(tableMetadata.getColumns(), ImmutableList.of(
125-
new ColumnMetadata("text", VARCHAR, false, null, null, false, emptyMap()), // primary key is not null in H2
124+
ColumnMetadata.builder().setName("text").setType(VARCHAR).setNullable(false).build(), // primary key is not null in H2
126125
new ColumnMetadata("text_short", createVarcharType(32)),
127126
new ColumnMetadata("value", BIGINT)));
128127

@@ -131,7 +130,7 @@ public void getTableMetadata()
131130
ConnectorTableMetadata specialTableMetadata = metadata.getTableMetadata(SESSION, specialTableHandle);
132131
assertEquals(specialTableMetadata.getTable(), new SchemaTableName("exa_ple", "num_ers"));
133132
assertEquals(specialTableMetadata.getColumns(), ImmutableList.of(
134-
new ColumnMetadata("te_t", VARCHAR, false, null, null, false, emptyMap()), // primary key is not null in H2
133+
ColumnMetadata.builder().setName("te_t").setType(VARCHAR).setNullable(false).build(), // primary key is not null in H2
135134
new ColumnMetadata("va%ue", BIGINT)));
136135

137136
// unknown tables should produce null

0 commit comments

Comments
 (0)