You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tajo.apache.org by "Keuntae Park (JIRA)" <ji...@apache.org> on 2015/01/08 08:30:34 UTC
[jira] [Updated] (TAJO-1287) Duplicated Sort spec should be
supported
[ https://issues.apache.org/jira/browse/TAJO-1287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Keuntae Park updated TAJO-1287:
-------------------------------
Description:
Following test code does not pass:
{code}
public final void testMultipleWindow() throws Exception {
KeyValueSet tableOptions = new KeyValueSet();
tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
Schema schema = new Schema();
schema.addColumn("id", TajoDataTypes.Type.INT4);
schema.addColumn("time", TajoDataTypes.Type.TIME);
schema.addColumn("name", TajoDataTypes.Type.TEXT);
String[] data = new String[]{ "1|12:11:12|abc", "2|10:11:13|def", "2|05:42:41|ghi" };
TajoTestingCluster.createTable("multiwindow", schema, tableOptions, data, 1);
try {
ResultSet res = executeString(
"select id, last_value(time) over ( partition by id order by time ) as time_last, last_value(name) over ( partition by id order by time ) as name_last from multiwindow");
String ascExpected = "id,time_last, name_last\n" +
"-------------------------------\n" +
"1,12:11:12,abc\n" +
"2,10:11:13,def\n" +
"2,10:11:13,def\n";
assertEquals(ascExpected, resultSetToString(res));
res.close();
} finally {
executeString("DROP TABLE multiwindow PURGE");
}
}
{code}
because the same order by key(in this case, 'time') induces Exception:
"org.apache.tajo.catalog.exception.AlreadyExistsFieldException: Already Exists Field: default.multiwindow.time"
It looks like there is a trivial bug when inserting additionalSortKeyColumns in WindowAggExec.
was:
Following test code does not pass:
{code}
public final void testMultipleWindow() throws Exception {
KeyValueSet tableOptions = new KeyValueSet();
tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
Schema schema = new Schema();
schema.addColumn("id", TajoDataTypes.Type.INT4);
schema.addColumn("time", TajoDataTypes.Type.TIME);
schema.addColumn("name", TajoDataTypes.Type.TEXT);
String[] data = new String[]{ "1|12:11:12|abc", "2|10:11:13|def", "2|05:42:41|ghi" };
TajoTestingCluster.createTable("multiwindow", schema, tableOptions, data, 1);
try {
ResultSet res = executeString(
"select id, last_value(time) over ( partition by id order by time ) as time_last, last_value(name) over ( partition by id order by time ) as name_last from multiwindow");
String ascExpected = "id,time_last, name_last\n" +
"-------------------------------\n" +
"1,12:11:12,abc\n" +
"2,10:11:13,def\n" +
"2,10:11:13,def\n";
assertEquals(ascExpected, resultSetToString(res));
res.close();
} finally {
executeString("DROP TABLE multiwindow PURGE");
}
}
{code}
because the same order by key(in this case, 'time') induces Exception:
"org.apache.tajo.catalog.exception.AlreadyExistsFieldException: Already Exists Field: default.multiwindow.time"
It looks like there is trivial bug when inserting additionalSortKeyColumns in WindowAggExec.
> Duplicated Sort spec should be supported
> ----------------------------------------
>
> Key: TAJO-1287
> URL: https://issues.apache.org/jira/browse/TAJO-1287
> Project: Tajo
> Issue Type: Sub-task
> Components: distributed query plan, parser, physical operator, planner/optimizer
> Reporter: Keuntae Park
> Priority: Minor
> Fix For: window function
>
>
> Following test code does not pass:
> {code}
> public final void testMultipleWindow() throws Exception {
> KeyValueSet tableOptions = new KeyValueSet();
> tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
> tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
> Schema schema = new Schema();
> schema.addColumn("id", TajoDataTypes.Type.INT4);
> schema.addColumn("time", TajoDataTypes.Type.TIME);
> schema.addColumn("name", TajoDataTypes.Type.TEXT);
> String[] data = new String[]{ "1|12:11:12|abc", "2|10:11:13|def", "2|05:42:41|ghi" };
> TajoTestingCluster.createTable("multiwindow", schema, tableOptions, data, 1);
> try {
> ResultSet res = executeString(
> "select id, last_value(time) over ( partition by id order by time ) as time_last, last_value(name) over ( partition by id order by time ) as name_last from multiwindow");
> String ascExpected = "id,time_last, name_last\n" +
> "-------------------------------\n" +
> "1,12:11:12,abc\n" +
> "2,10:11:13,def\n" +
> "2,10:11:13,def\n";
> assertEquals(ascExpected, resultSetToString(res));
> res.close();
> } finally {
> executeString("DROP TABLE multiwindow PURGE");
> }
> }
> {code}
> because the same order by key(in this case, 'time') induces Exception:
> "org.apache.tajo.catalog.exception.AlreadyExistsFieldException: Already Exists Field: default.multiwindow.time"
> It looks like there is a trivial bug when inserting additionalSortKeyColumns in WindowAggExec.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)