Created
July 8, 2014 19:53
-
-
Save nileema/71d0099d804a10cb172b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM (SELECT row_number() over() rn, orderkey, orderstatus, custkey from orders) where rn < 10 | |
- Output[rn, orderkey, orderstatus, custkey] | |
rn := row_1 | |
- Window[] => [orderkey:bigint, custkey:bigint, orderstatus:varchar, row_1:bigint] | |
row_1 := row_number() | |
- Limit[9] => [orderkey:bigint, custkey:bigint, orderstatus:varchar] | |
- TableScan[local:tpch:orders:sf0.01, original constraint=true] => [orderkey:bigint, custkey:bigint, orderstatus:varchar] | |
orderkey := local:tpch:orderkey:0 | |
custkey := local:tpch:custkey:1 | |
orderstatus := local:tpch:orderstatus:2 | |
SELECT * FROM (SELECT row_number() over(partition by orderstatus) rn, orderkey, orderstatus, custkey from orders) where rn < 10 | |
- Output[rn, orderkey, orderstatus, custkey] | |
rn := row_1 | |
- RowNumberLimit[partition by (orderstatus) limit=9] => [orderkey:bigint, custkey:bigint, orderstatus:varchar, row_1:bigint] | |
row_1 := row_number() | |
- TableScan[local:tpch:orders:sf0.01, original constraint=true] => [orderkey:bigint, custkey:bigint, orderstatus:varchar] | |
orderkey := local:tpch:orderkey:0 | |
custkey := local:tpch:custkey:1 | |
orderstatus := local:tpch:orderstatus:2 | |
SELECT * FROM (SELECT row_number() over(order by orderkey) rn, orderkey, orderstatus, custkey from orders) where rn < 10 | |
- Output[rn, orderkey, orderstatus, custkey] | |
rn := row_1 | |
- Window[order by (orderkey ASC_NULLS_LAST)] => [orderkey:bigint, custkey:bigint, orderstatus:varchar, row_1:bigint] | |
row_1 := row_number() | |
- TopN[9 by (orderkey ASC_NULLS_LAST)] => [orderkey:bigint, custkey:bigint, orderstatus:varchar] | |
- TableScan[local:tpch:orders:sf0.01, original constraint=true] => [orderkey:bigint, custkey:bigint, orderstatus:varchar] | |
orderkey := local:tpch:orderkey:0 | |
custkey := local:tpch:custkey:1 | |
orderstatus := local:tpch:orderstatus:2 | |
SELECT * FROM (SELECT row_number() over(partition by orderstatus order by orderkey) rn, orderkey, orderstatus, custkey from orders) where rn < 10 | |
- Output[rn, orderkey, orderstatus, custkey] | |
rn := row_1 | |
- TopNRowNumber[partition by (orderstatus), order by (orderkey ASC_NULLS_LAST) limit 9] => [orderkey:bigint, custkey:bigint, orderstatus:varchar, row_1:bigint] | |
row_1 := row_number() | |
- TableScan[local:tpch:orders:sf0.01, original constraint=true] => [orderkey:bigint, custkey:bigint, orderstatus:varchar] | |
orderkey := local:tpch:orderkey:0 | |
custkey := local:tpch:custkey:1 | |
orderstatus := local:tpch:orderstatus:2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment