From 6899f8bc7ce1b07bfe220a5e39527cbfd3429d76 Mon Sep 17 00:00:00 2001 From: Jithendar Trianz <106380520+Jithendar12@users.noreply.github.com> Date: Fri, 16 Aug 2024 01:40:07 +0530 Subject: [PATCH] [Fix] Add views to the Table list in athena-sqlserver connector (#2170) Co-authored-by: ejeffrli <144148373+ejeffrli@users.noreply.github.com> --- .../athena/connectors/sqlserver/SqlServerMetadataHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/athena-sqlserver/src/main/java/com/amazonaws/athena/connectors/sqlserver/SqlServerMetadataHandler.java b/athena-sqlserver/src/main/java/com/amazonaws/athena/connectors/sqlserver/SqlServerMetadataHandler.java index 4b4ac2f381..dafb1d1ef5 100644 --- a/athena-sqlserver/src/main/java/com/amazonaws/athena/connectors/sqlserver/SqlServerMetadataHandler.java +++ b/athena-sqlserver/src/main/java/com/amazonaws/athena/connectors/sqlserver/SqlServerMetadataHandler.java @@ -130,7 +130,7 @@ public class SqlServerMetadataHandler extends JdbcMetadataHandler "WHERE t.object_id = (select object_id from sys.objects o where o.name = ? " + "and schema_id = (select schema_id from sys.schemas s where s.name = ?))"; static final String VIEW_CHECK_QUERY = "select TYPE_DESC from sys.objects where name = ? and schema_id = (select schema_id from sys.schemas s where s.name = ?)"; - static final String LIST_PAGINATED_TABLES_QUERY = "SELECT t.name AS \"TABLE_NAME\", s.name AS \"TABLE_SCHEM\" FROM sys.tables t INNER JOIN sys.schemas s ON t.schema_id = s.schema_id ORDER BY table_name OFFSET ? ROWS FETCH NEXT ? ROWS ONLY;"; + static final String LIST_PAGINATED_TABLES_QUERY = "SELECT o.name AS \"TABLE_NAME\", s.name AS \"TABLE_SCHEM\" FROM sys.objects o INNER JOIN sys.schemas s ON o.schema_id = s.schema_id WHERE o.type IN ('U', 'V') ORDER BY table_name OFFSET ? ROWS FETCH NEXT ? ROWS ONLY;"; public SqlServerMetadataHandler(java.util.Map configOptions) {