Closed kbremner closed 9 years ago
Thank you and sorry for delay response. I'll check it.
Mreged but I'll try to add ThenBy
for window function
Thanks, I've modified following code finally.
context.From<Shakespeare>()
.Where(x => x.corpus == "othello" && BqFunc.Length(x.word) > 10)
.Select(x => new
{
x.word,
x.word_count,
row_num = BqFunc.RowNumber(x)
.OrderByDescending(y => y.word)
.ThenBy(y => y.word_count)
.ThenByByDescending(y => y.corpus)
.Value
})
.Limit(5);
as
SELECT
[word],
[word_count],
ROW_NUMBER() OVER (ORDER BY [word] DESC, [word_count], [corpus] DESC) AS [row_num]
FROM
[publicdata:samples.shakespeare]
WHERE
(([corpus] = 'othello') AND (LENGTH([word]) > 10))
LIMIT 5
Currently it only specifies the last key as DESC. Fixed so that all keys are specified as DESC when carrying out descending ordering for a window function.