[
https://issues.apache.org/jira/browse/KYLIN-3089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16285546#comment-16285546
]
Yang Hao edited comment on KYLIN-3089 at 12/11/17 6:21 AM:
-----------------------------------------------------------
The comparasion may be different between string and changing it to
ImmutableBytesWritable which is used for HFile
example 1 :
s1: cn:ļ¼ļ¼ļ¼
s2: s2: cn:ščš
{code:java}
public ImmutableBytesWritable getImmutable(String s) {
ImmutableBytesWritable key = new ImmutableBytesWritable();
Text text = new Text(s);
key.set(text.getBytes(), 0, text.getLength());
return key;
}
public void order(String s1, String s2) {
System.out.println("compare use string: " + s1.compareTo(s2));
System.out.println("compare use ImmutableBytesWritable: " +
getImmutable(s1).compareTo(getImmutable(s2)));
}
@Test
public void test_order() {
order("cn:ļ¼ļ¼ļ¼", "cn:\uD83D\uDE0Ač\uD83D\uDE0A");
}
{code}
was (Author: yanghaogn):
s1: cn:ļ¼ļ¼ļ¼
s2: s2: cn:ščš
The comparasion is different between string and changing it to
ImmutableBytesWritable which is used for HFile
{code:java}
public ImmutableBytesWritable getImmutable(String s) {
ImmutableBytesWritable key = new ImmutableBytesWritable();
Text text = new Text(s);
key.set(text.getBytes(), 0, text.getLength());
return key;
}
public void order(String s1, String s2) {
System.out.println("compare use string: " + s1.compareTo(s2));
System.out.println("compare use ImmutableBytesWritable: " +
getImmutable(s1).compareTo(getImmutable(s2)));
}
@Test
public void test_order() {
order("cn:ļ¼ļ¼ļ¼", "cn:\uD83D\uDE0Ač\uD83D\uDE0A");
}
{code}
> Query exception on SortedIteratorMergerWithLimit
> ------------------------------------------------
>
> Key: KYLIN-3089
> URL: https://issues.apache.org/jira/browse/KYLIN-3089
> Project: Kylin
> Issue Type: Bug
> Affects Versions: v2.1.0
> Reporter: Yang Hao
>
> The executing error only exists on some special case. I have a simple sql,
> and the query is routing onto SortedIteratorMergerWithLimit. When iterate
> data, it triggers such error
> {code:java}
> //TODO: remove this check when validated
> if (last != null) {
> if (comparator.compare(last, fetched) > 0)
> throw new IllegalStateException("Not sorted! last: " +
> last + " fetched: " + fetched);
> }
> {code}
> sql is as belows.
> {code:java}
> select "DATE",appid,dim_1,dim_2, sum(uv) as uv
> from table_1
> where appid = **** and "DATE" = 20171111
> group by "DATE",appid,dim_1,dim_2
> limit 50000
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)