Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](planner)the data type should be the same between input slot and sort slot #27215

Merged
merged 2 commits into from
Nov 19, 2023
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 @@ -313,9 +313,9 @@ private SortInfo createSortInfo(
SlotDescriptor sortSlotDesc = analyzer.getDescTbl().addSlotDescriptor(sortTupleDesc);
if (inputSlotDesc.getColumn() != null) {
sortSlotDesc.setColumn(inputSlotDesc.getColumn());
} else {
sortSlotDesc.setType(inputSlotDesc.getType());
}
// always set type as inputSlotDesc's type
sortSlotDesc.setType(inputSlotDesc.getType());
// all output slots need to be materialized
sortSlotDesc.setIsMaterialized(true);
sortSlotDesc.setIsNullable(inputSlotDesc.getIsNullable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
-- !order --
2023-06-10 cib2205045_1_1s 0.0000 168939.0 0.0000 0.0 0.0000 0.0 0.0000 day

-- !order2 --
1 1 1
2 2 2
3 3 3
4 4 4
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// under the License.

suite("test_inlineview_with_window_function") {
sql """set enable_nereids_planner=false;"""
sql """
drop view if exists test_table_aa;
"""
Expand Down Expand Up @@ -151,4 +152,19 @@ suite("test_inlineview_with_window_function") {
group by ordernum
)tmp1
on tmp.ordernum=tmp1.ordernum;"""

qt_order2 """
SELECT
row_number() over(partition by add_date order by pc_num desc)
,row_number() over(partition by add_date order by vc_num desc)
,row_number() over(partition by add_date order by vt_num desc)
FROM (
SELECT
cast(dnt as datev2) add_date
,row_number() over(order by dnt) pc_num
,row_number() over(order by dnt) vc_num
,row_number() over(order by dnt) vt_num
FROM test_table_aaa
) t;
"""
}
Loading