Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.38.0
Description
Calcite has the same hehavior with Oracle on returning the null direction if not specified, which means NULLS LAST is assumed for ASC and NULLS FIRST is assumed for DESC.
However, the default nulls direction is not presented in plan traces. For example:
select empno from emp order by empno desc
has the following plan:
LogicalSort(sort0=[$0], dir0=[DESC]) LogicalProject(EMPNO=[$0]) LogicalTableScan(table=[[CATALOG, SALES, EMP]])
It makes RelNode clearer if adding nulls direction, so the above plan will be like:
LogicalSort(sort0=[$0], dir0=[DESC-nulls-first]) LogicalProject(EMPNO=[$0]) LogicalTableScan(table=[[CATALOG, SALES, EMP]])
Attachments
Issue Links
- is related to
-
CALCITE-6798 Null direction emulation in MySQL and Hive is incorrect when null direction is not specified
-
- Resolved
-
-
CALCITE-970 If NULLS FIRST/LAST not specified, sort NULL values HIGH
-
- Closed
-
- links to