Skip to content

Commit 2d31a1b

Browse files
ZhitongYanLeo Yanburhan94
authored
Always include partition column when get-table-layout (#3045)
Co-authored-by: Leo Yan <[email protected]> Co-authored-by: burhan94 <[email protected]>
1 parent 2f71b6f commit 2d31a1b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

athena-snowflake/src/main/java/com/amazonaws/athena/connectors/snowflake/SnowflakeMetadataHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ public GetDataSourceCapabilitiesResponse doGetDataSourceCapabilities(BlockAlloca
231231
public void enhancePartitionSchema(SchemaBuilder partitionSchemaBuilder, GetTableLayoutRequest request)
232232
{
233233
LOGGER.info("{}: Catalog {}, table {}", request.getQueryId(), request.getTableName().getSchemaName(), request.getTableName());
234+
// Always ensure the partition column exists in the schema
235+
if (partitionSchemaBuilder.getField(BLOCK_PARTITION_COLUMN_NAME) == null) {
236+
partitionSchemaBuilder.addField(BLOCK_PARTITION_COLUMN_NAME, Types.MinorType.VARCHAR.getType());
237+
}
234238
partitionSchemaBuilder.addField(QUERY_ID, new ArrowType.Utf8());
235239
partitionSchemaBuilder.addField(PREPARED_STMT, new ArrowType.Utf8());
236240
}

0 commit comments

Comments
 (0)