String query = ("A=LOAD 'input1' AS (a0, a1, a2);" +
"B = group A by $0;" +
"C = foreach B { D = limit A 10; E = order D by $1; F = order E by $2; generate group, F;};" +
"store C into 'output';");
SecondaryKeyOptimizer so = visitSecondaryKeyOptimizer(query);
assertEquals(1, so.getNumUseSecondaryKey());
assertEquals(1, so.getNumSortRemoved());
assertEquals(0, so.getNumDistinctChanged());
}