JIRA created for it: https://issues.apache.org/jira/browse/KYLIN-3637

ShaoFeng Shi <shaofeng...@apache.org> 于2018年10月17日周三 下午11:04写道:

> Hi Yi,
>
> This is a bug. Could you please report a JIRA to Kylin? Thank you!
>
> yiwang <756470...@qq.com> 于2018年10月15日周一 下午2:28写道:
>
>> Hi Kylin Team,
>>
>> When I ran sql "SELECT count(TRANS_ID) as TRANS_ID FROM KYLIN_SALES where
>> TRANS_ID <> 1 union all select count(TRANS_ID) as TRANS_ID FROM
>> KYLIN_SALES"
>> on sample cube.
>>
>> Got Error:
>> Error while compiling generated Java code: public static class Record2_1
>> implements java.io.Serializable { public Long TRANS_ID; public long
>> _KY_COUNT__; public Record2_1() {} public boolean equals(Object o) { if
>> (this == o) { return true; } if (!(o instanceof Record2_1)) { return
>> false;
>> } return java.util.Objects.equals(this.TRANS_ID, ((Record2_1) o).TRANS_ID)
>> && this._KY_COUNT__ == ((Record2_1) o)._KY_COUNT__; } public int
>> hashCode()
>> { int h = 0; h = org.apache.calcite.runtime.Utilities.hash(h,
>> this.TRANS_ID); h = org.apache.calcite.runtime.Utilities.hash(h,
>> this._KY_COUNT__); return h; } public int compareTo(Record2_1 that) { int
>> c;
>> c = org.apache.calcite.runtime.Utilities.compareNullsLast(this.TRANS_ID,
>> that.TRANS_ID); if (c != 0) { return c; } c =
>> org.apache.calcite.runtime.Utilities.compare(this._KY_COUNT__,
>> that._KY_COUNT__); if (c != 0) { return c; } return 0; } public String
>> toString() { return "{TRANS_ID=" + this.TRANS_ID + ", _KY_COUNT__=" +
>> this._KY_COUNT__ + "}"; } } public static class Record1_0 implements
>> java.io.Serializable { public long f0; public Record1_0() {} public
>> boolean
>> equals(Object o) { if (this == o) { return true; } if (!(o instanceof
>> Record1_0)) { return false; } return this.f0 == ((Record1_0) o).f0; }
>> public
>> int hashCode() { int h = 0; h =
>> org.apache.calcite.runtime.Utilities.hash(h,
>> this.f0); return h; } public int compareTo(Record1_0 that) { final int c;
>> c
>> = org.apache.calcite.runtime.Utilities.compare(this.f0, that.f0); if (c !=
>> 0) { return c; } return 0; } public String toString() { return "{f0=" +
>> this.f0 + "}"; } } org.apache.calcite.DataContext root; public
>> org.apache.calcite.linq4j.Enumerable bind(final
>> org.apache.calcite.DataContext root0) { root = root0; final
>> org.apache.calcite.linq4j.Enumerable _inputEnumerable =
>> ((org.apache.kylin.query.schema.OLAPTable)
>>
>> root.getRootSchema().getSubSchema("DEFAULT").getTable("KYLIN_SALES")).executeOLAPQuery(root,
>> 1); final org.apache.calcite.linq4j.AbstractEnumerable child = new
>> org.apache.calcite.linq4j.AbstractEnumerable(){ public
>> org.apache.calcite.linq4j.Enumerator enumerator() { return new
>> org.apache.calcite.linq4j.Enumerator(){ public final
>> org.apache.calcite.linq4j.Enumerator inputEnumerator =
>> _inputEnumerable.enumerator(); public void reset() {
>> inputEnumerator.reset(); } public boolean moveNext() { while
>> (inputEnumerator.moveNext()) { final Long inp0_ = (Long) ((Object[])
>> inputEnumerator.current())[0]; if (inp0_ != null && inp0_.longValue() !=
>> 1L)
>> { return true; } } return false; } public void close() {
>> inputEnumerator.close(); } public Object current() { final Object[]
>> current
>> = (Object[]) inputEnumerator.current(); return new Object[] { current[0],
>> current[11]}; } }; } }; final org.apache.calcite.linq4j.Enumerable
>> _inputEnumerable0 = ((org.apache.kylin.query.schema.OLAPTable)
>>
>> root.getRootSchema().getSubSchema("DEFAULT").getTable("KYLIN_SALES")).executeOLAPQuery(root,
>> 2); final org.apache.calcite.linq4j.AbstractEnumerable child1 = new
>> org.apache.calcite.linq4j.AbstractEnumerable(){ public
>> org.apache.calcite.linq4j.Enumerator enumerator() { return new
>> org.apache.calcite.linq4j.Enumerator(){ public final
>> org.apache.calcite.linq4j.Enumerator inputEnumerator =
>> _inputEnumerable0.enumerator(); public void reset() {
>> inputEnumerator.reset(); } public boolean moveNext() { return
>> inputEnumerator.moveNext(); } public void close() {
>> inputEnumerator.close();
>> } public Object current() { final Object[] current = (Object[])
>> inputEnumerator.current(); return new Record2_1( (Long) current[0],
>> org.apache.calcite.runtime.SqlFunctions.toLong(current[11])); } }; } };
>> return
>> org.apache.calcite.linq4j.Linq4j.singletonEnumerable(child.aggregate(new
>> org.apache.calcite.linq4j.function.Function0() { public Object apply() {
>> long a0s0; a0s0 = 0; Record1_0 record0; record0 = new Record1_0();
>> record0.f0 = a0s0; return record0; } } .apply(), new
>> org.apache.calcite.linq4j.function.Function2() { public Record1_0
>> apply(Record1_0 acc, Object[] in) { acc.f0 = acc.f0 +
>> org.apache.calcite.runtime.SqlFunctions.toLong(in[1]); return acc; }
>> public
>> Record1_0 apply(Object acc, Object in) { return apply( (Record1_0) acc,
>> (Object[]) in); } } , new org.apache.calcite.linq4j.function.Function1() {
>> public long apply(Record1_0 acc) { return acc.f0; } public Object
>> apply(Object acc) { return apply( (Record1_0) acc); } }
>>
>> )).concat(org.apache.calcite.linq4j.Linq4j.singletonEnumerable(child1.aggregate(new
>> org.apache.calcite.linq4j.function.Function0() { public Object apply() {
>> long a0s0; a0s0 = 0; Record1_0 record0; record0 = new Record1_0();
>> record0.f0 = a0s0; return record0; } } .apply(), new
>> org.apache.calcite.linq4j.function.Function2() { public Record1_0
>> apply(Record1_0 acc, Record2_1 in) { acc.f0 = acc.f0 + in._KY_COUNT__;
>> return acc; } public Record1_0 apply(Object acc, Object in) { return
>> apply(
>> (Record1_0) acc, (Record2_1) in); } } , new
>> org.apache.calcite.linq4j.function.Function1() { public long
>> apply(Record1_0
>> acc) { return acc.f0; } public Object apply(Object acc) { return apply(
>> (Record1_0) acc); } } ))).take(50000); } public Class getElementType() {
>> return long.class; } while executing SQL: "SELECT count(TRANS_ID) as
>> TRANS_ID FROM KYLIN_SALES where TRANS_ID <> 1 union all select
>> count(TRANS_ID) as TRANS_ID FROM KYLIN_SALES LIMIT 50000"
>>
>> Best regards
>> Yi
>>
>>
>> --
>> Sent from: http://apache-kylin.74782.x6.nabble.com/
>>
>
>
> --
> Best regards,
>
> Shaofeng Shi 史少锋
>
>

-- 
Best regards,

Shaofeng Shi 史少锋

Reply via email to