Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

TAJO-922: Add NTH_VALUE window function #535

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

TAJO-922: Add NTH_VALUE window function #535

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 16, 2015

merged master branch.

@ghost ghost changed the title Tajo 922: Add NTH_VALUE window function TAJO-922: Add NTH_VALUE window function Apr 16, 2015
@sirpkt
Copy link
Contributor

sirpkt commented Apr 17, 2015

It looks good overall to me, however it seems to contain the code for ntile function also.
Would you clean up the patch to include code related to nth_value only, @seungunchoe?

@@ -0,0 +1 @@
select l_orderkey, ntile(3) over (order by l_orderkey) as tile from lineitem;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test code is missed.

@hyunsik
Copy link
Member

hyunsik commented May 11, 2015

@jihoonson Are there something more to do?

@@ -0,0 +1,7 @@
l_orderkey,tile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file looks not to be included in this patch.

@jihoonson
Copy link
Contributor

Sorry for late response.
I've found query result looks wrong as follows.
Tajo

tpch> select n_regionkey, nth_value(n_comment, 1) over (partition by n_regionkey) from nation;
Progress: 100%, response time: 0.314 sec
n_regionkey,  ?windowfunction
-------------------------------
0,  rns. blithely bold courts among the closely regular packages use furiously bold platelets?
0,  rns. blithely bold courts among the closely regular packages use furiously bold platelets?
0,  rns. blithely bold courts among the closely regular packages use furiously bold platelets?
0,  rns. blithely bold courts among the closely regular packages use furiously bold platelets?
0,  rns. blithely bold courts among the closely regular packages use furiously bold platelets?
1,  y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be
1,  y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be
1,  y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be
1,  y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be
1,  y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be
2,  ously. final, express gifts cajole a
2,  ously. final, express gifts cajole a
2,  ously. final, express gifts cajole a
2,  ously. final, express gifts cajole a
2,  ously. final, express gifts cajole a
3,  refully final requests. regular, ironi
3,  refully final requests. regular, ironi
3,  refully final requests. regular, ironi
3,  refully final requests. regular, ironi
3,  refully final requests. regular, ironi
4,  y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d
4,  y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d
4,  y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d
4,  y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d
4,  y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d
(25 rows, 0.314 sec, 1.9 KiB selected)

Pgsql

postgres=# select n_regionkey, nth_value(n_comment, 1) over (partition by n_regionkey) from nation;
 n_regionkey |                                                    nth_value                                                    
-------------+-----------------------------------------------------------------------------------------------------------------
           0 | ven packages wake quickly. regu
           0 | ven packages wake quickly. regu
           0 | ven packages wake quickly. regu
           0 | ven packages wake quickly. regu
           0 | ven packages wake quickly. regu
           1 | y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be
           1 | y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be
           1 | y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be
           1 | y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be
           1 | y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be
           2 | hely enticingly express accounts. even, final 
           2 | hely enticingly express accounts. even, final 
           2 | hely enticingly express accounts. even, final 
           2 | hely enticingly express accounts. even, final 
           2 | hely enticingly express accounts. even, final 
           3 | ular asymptotes are about the furious multipliers. express dependencies nag above the ironically ironic account
           3 | ular asymptotes are about the furious multipliers. express dependencies nag above the ironically ironic account
           3 | ular asymptotes are about the furious multipliers. express dependencies nag above the ironically ironic account
           3 | ular asymptotes are about the furious multipliers. express dependencies nag above the ironically ironic account
           3 | ular asymptotes are about the furious multipliers. express dependencies nag above the ironically ironic account
           4 | y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d
           4 | y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d
           4 | y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d
           4 | y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d
           4 | y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d
(25 rows)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants