Skip to content

Commit 424bb0f

Browse files
authored
SNOW-2082360: Remove unnecessary sort in XML query (#3323)
1 parent f321ac4 commit 424bb0f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/snowflake/snowpark/_internal/analyzer/snowflake_plan.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,11 +1406,7 @@ def _create_xml_query(
14061406
).select(worker_column_name, xml_row_number_column_name, "key", "value")
14071407

14081408
# Apply dynamic pivot to get the flat table with dynamic schema
1409-
df = (
1410-
df.pivot("key")
1411-
.max("value")
1412-
.sort(worker_column_name, xml_row_number_column_name)
1413-
)
1409+
df = df.pivot("key").max("value")
14141410

14151411
# Exclude the worker and row number columns
14161412
return f"SELECT * EXCLUDE ({worker_column_name}, {xml_row_number_column_name}) FROM ({df.queries['queries'][-1]})"

0 commit comments

Comments
 (0)