Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -27,6 +27,7 @@
import io.trino.plugin.jdbc.ConnectionFactory;
import io.trino.plugin.jdbc.JdbcColumnHandle;
import io.trino.plugin.jdbc.JdbcExpression;
import io.trino.plugin.jdbc.JdbcSortItem;
import io.trino.plugin.jdbc.JdbcTableHandle;
import io.trino.plugin.jdbc.JdbcTypeHandle;
import io.trino.plugin.jdbc.LongWriteFunction;
Expand Down Expand Up @@ -283,6 +284,31 @@ public boolean isLimitGuaranteed(ConnectorSession session)
return true;
}

@Override
public boolean supportsTopN(ConnectorSession session, JdbcTableHandle handle, List<JdbcSortItem> sortOrder)
{
for (JdbcSortItem sortItem : sortOrder) {
Type sortItemType = sortItem.getColumn().getColumnType();
if (sortItemType instanceof CharType || sortItemType instanceof VarcharType) {
// Remote database can be case insensitive.
return false;
}
Comment on lines +291 to +295
Copy link
Member

@ebyhr ebyhr Mar 24, 2024

Choose a reason for hiding this comment

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

Is it true? or did you just copy from other connectors?
cc: @wendigo @hashhar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}
return true;
}

@Override
protected Optional<TopNFunction> topNFunction()
{
return Optional.of(TopNFunction.sqlStandard(this::quoted));
}

@Override
public boolean isTopNGuaranteed(ConnectorSession session)
{
return true;
}

@Override
public Optional<String> getTableComment(ResultSet resultSet)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)
SUPPORTS_CREATE_TABLE_WITH_TABLE_COMMENT,
SUPPORTS_PREDICATE_PUSHDOWN,
SUPPORTS_ROW_TYPE,
SUPPORTS_SET_COLUMN_TYPE,
SUPPORTS_TOPN_PUSHDOWN -> false;
SUPPORTS_SET_COLUMN_TYPE -> false;
default -> super.hasBehavior(connectorBehavior);
};
}
Expand Down