You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2015/03/29 13:19:52 UTC
[jira] [Commented] (METAMODEL-127) DISTINCT query bug
[ https://issues.apache.org/jira/browse/METAMODEL-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14385708#comment-14385708 ]
Kasper Sørensen commented on METAMODEL-127:
-------------------------------------------
I tried to reproduce but couldn't. Here's my test code (put it in QueryPostprocessDataContext):
{code}
public void testSelectDistinctOnlyOneColumn() throws Exception {
MockDataContext dc = new MockDataContext("sch", "tab", "hello");
Query query = dc.parseQuery("SELECT DISTINCT bar FROM tab");
DataSet ds = dc.executeQuery(query);
assertTrue(ds.next());
assertEquals("yo", ds.getRow().getValue(0));
assertTrue(ds.next());
assertEquals("hello", ds.getRow().getValue(0));
assertTrue(ds.next());
assertEquals("hi", ds.getRow().getValue(0));
assertFalse(ds.next());
ds.close();
}
{code}
Can you help reproduce it? Does it only happen in case of CSV (it inherits from QueryPostprocessDataContext so I am assuming it is a general query engine issue).
> DISTINCT query bug
> ------------------
>
> Key: METAMODEL-127
> URL: https://issues.apache.org/jira/browse/METAMODEL-127
> Project: Apache MetaModel
> Issue Type: Bug
> Affects Versions: 4.3.2
> Environment: Linux
> Reporter: Ashish Mukherjee
>
> I am using a CSV Data Context example with multiple fields - occurrences, first_name, last_name.
> Running this query -
> SELECT DISTINCT persons.csv.first_name FROM persons.csv
> This query performs a distinct across all the three columns and not just on the column adjacent to the DISTINCT keyword.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)