Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -14,7 +14,6 @@
package io.trino.plugin.jdbc;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Joiner;
import io.trino.spi.connector.ColumnHandle;
Expand Down Expand Up @@ -109,12 +108,6 @@ public Optional<String> getComment()
return comment;
}

@JsonIgnore
public boolean isSynthetic()
{
return expression.isPresent();
}

public ColumnMetadata getColumnMetadata()
{
return ColumnMetadata.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
public class JdbcMetadata
implements ConnectorMetadata
{
private static final String SYNTHETIC_COLUMN_NAME_PREFIX = "_presto_generated_";
private static final String SYNTHETIC_COLUMN_NAME_PREFIX = "_pfgnrtd_";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tf...?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lo... ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_trino_generated_?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh makes sense :P

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣


private final JdbcClient jdbcClient;
private final boolean allowDropTable;
Expand Down Expand Up @@ -436,7 +436,6 @@ public ConnectorInsertTableHandle beginInsert(ConnectorSession session, Connecto
verify(!((JdbcTableHandle) tableHandle).isSynthetic(), "Not a table reference: %s", tableHandle);
List<JdbcColumnHandle> columnHandles = columns.stream()
.map(JdbcColumnHandle.class::cast)
.peek(columnHandle -> verify(!columnHandle.isSynthetic(), "Not a column reference: %s", columnHandle))
.collect(toImmutableList());
JdbcOutputTableHandle handle = jdbcClient.beginInsertTable(session, (JdbcTableHandle) tableHandle, columnHandles);
setRollback(() -> jdbcClient.rollbackCreateTable(session, handle));
Expand All @@ -463,7 +462,6 @@ public void setColumnComment(ConnectorSession session, ConnectorTableHandle tabl
JdbcTableHandle tableHandle = (JdbcTableHandle) table;
JdbcColumnHandle columnHandle = (JdbcColumnHandle) column;
verify(!tableHandle.isSynthetic(), "Not a table reference: %s", tableHandle);
verify(!columnHandle.isSynthetic(), "Not a column reference: %s", columnHandle);
jdbcClient.setColumnComment(session, tableHandle, columnHandle, comment);
}

Expand All @@ -481,7 +479,6 @@ public void dropColumn(ConnectorSession session, ConnectorTableHandle table, Col
JdbcTableHandle tableHandle = (JdbcTableHandle) table;
JdbcColumnHandle columnHandle = (JdbcColumnHandle) column;
verify(!tableHandle.isSynthetic(), "Not a table reference: %s", tableHandle);
verify(!columnHandle.isSynthetic(), "Not a column reference: %s", columnHandle);
jdbcClient.dropColumn(session, tableHandle, columnHandle);
}

Expand All @@ -491,7 +488,6 @@ public void renameColumn(ConnectorSession session, ConnectorTableHandle table, C
JdbcTableHandle tableHandle = (JdbcTableHandle) table;
JdbcColumnHandle columnHandle = (JdbcColumnHandle) column;
verify(!tableHandle.isSynthetic(), "Not a table reference: %s", tableHandle);
verify(!columnHandle.isSynthetic(), "Not a column reference: %s", columnHandle);
jdbcClient.renameColumn(session, tableHandle, columnHandle, target);
}

Expand Down