[jira] [Created] (KYLIN-2203) Deprecated class ModelDescController

2016-11-16 Thread Zhong,Jason (JIRA)
Zhong,Jason created KYLIN-2203:
--

 Summary: Deprecated class ModelDescController
 Key: KYLIN-2203
 URL: https://issues.apache.org/jira/browse/KYLIN-2203
 Project: Kylin
  Issue Type: Improvement
  Components: REST Service
Affects Versions: v1.6.0
Reporter: Zhong,Jason
Assignee: Zhong,Jason
 Fix For: v1.6.1


Move API in class ModelDescController to ModelController

and Deprecated ModelDescController



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KYLIN-2200) CompileException on UNION ALL query when result only contains one column

2016-11-16 Thread Dayue Gao (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-2200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15673043#comment-15673043
 ] 

Dayue Gao commented on KYLIN-2200:
--

Union also fails to remove duplicates.
{code:sql}
select count(*), sum(price) from kylin_sales
union 
select count(*), sum(price) from kylin_sales
{code}

When input rowformat is Array, EnumerableUnion should use 
ExtendedEnumerable.union(source, Functions.arrayComparer()) instead of 
ExtendedEnumerable.union(source).



> CompileException on UNION ALL query when result only contains one column
> 
>
> Key: KYLIN-2200
> URL: https://issues.apache.org/jira/browse/KYLIN-2200
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Affects Versions: v1.5.4.1
>Reporter: Dayue Gao
>Assignee: Dayue Gao
>
> {code:sql}
> select count(*) from kylin_sales
> union all
> select count(*) from kylin_sales
> {code}
> got following exception
> {noformat}
> Caused by: org.codehaus.commons.compiler.CompileException: Line 82, Column 
> 32: Cannot determine simple type name "Record11_1"
> at 
> org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10092)
> at 
> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5375)
> at 
> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5184)
> at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5165)
> at 
> org.codehaus.janino.UnitCompiler.access$12600(UnitCompiler.java:183)
> at 
> org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java:5096)
> at org.codehaus.janino.Java$ReferenceType.accept(Java.java:2880)
> at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:5136)
> at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5598)
> at 
> org.codehaus.janino.UnitCompiler.access$13300(UnitCompiler.java:183)
> at 
> org.codehaus.janino.UnitCompiler$16.visitCast(UnitCompiler.java:5104)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (KYLIN-2181) remove integer as fixed_length in test_kylin_cube_with_slr_empty desc

2016-11-16 Thread hongbin ma (JIRA)

 [ 
https://issues.apache.org/jira/browse/KYLIN-2181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

hongbin ma resolved KYLIN-2181.
---
   Resolution: Fixed
Fix Version/s: v1.6.1

> remove integer as fixed_length in test_kylin_cube_with_slr_empty desc
> -
>
> Key: KYLIN-2181
> URL: https://issues.apache.org/jira/browse/KYLIN-2181
> Project: Kylin
>  Issue Type: Improvement
>Reporter: hongbin ma
>Assignee: hongbin ma
> Fix For: v1.6.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KYLIN-2135) Enlarge FactDistinctColumns reducer number

2016-11-16 Thread kangkaisen (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-2135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15672686#comment-15672686
 ] 

kangkaisen commented on KYLIN-2135:
---

Hi, [~xiefan46]. We only enlarge the reducer number for ShardByColumns and 
GlobalDictionaryColumns because of these column have ultra high cardinality. We 
don't enlarge the reducer number for normal columns and their reducer number is 
one.

> Enlarge FactDistinctColumns reducer number
> --
>
> Key: KYLIN-2135
> URL: https://issues.apache.org/jira/browse/KYLIN-2135
> Project: Kylin
>  Issue Type: Improvement
>  Components: Job Engine
>Affects Versions: v1.5.4.1
>Reporter: kangkaisen
>Assignee: kangkaisen
> Fix For: v1.6.1
>
> Attachments: KYLIN-2135.patch, new.png, old.png
>
>
> When the hive table has billions of rows and use global dictionary for 
> precise count distinct measures, the  {{Extract Fact Table Distinct Columns}} 
> job will run o long time.
> So we could use more reducer to deal with the one column.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KYLIN-2180) Add project config and make config priority become "cube > project > server"

2016-11-16 Thread kangkaisen (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-2180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15672675#comment-15672675
 ] 

kangkaisen commented on KYLIN-2180:
---

Hi, [~liyang.g...@gmail.com], [~Shaofengshi], please you review the 
{{KylinCubeConfigExt}} when you have time, Thanks you.

> Add project config and make config priority become "cube > project > server"
> 
>
> Key: KYLIN-2180
> URL: https://issues.apache.org/jira/browse/KYLIN-2180
> Project: Kylin
>  Issue Type: New Feature
>  Components: Metadata
>Affects Versions: v1.5.4.1
>Reporter: kangkaisen
>Assignee: kangkaisen
> Attachments: KYLIN-2180-tmp.patch
>
>
> There are cases we want to override global kylin.properties in the scope of a 
> project. E.g. the queue name of Hadoop job.
> Finally, the config priority for Kylin should be "cube > project > server". I 
> think which is reasonable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (KYLIN-2180) Add project config and make config priority become "cube > project > server"

2016-11-16 Thread kangkaisen (JIRA)

 [ 
https://issues.apache.org/jira/browse/KYLIN-2180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

kangkaisen updated KYLIN-2180:
--
Attachment: KYLIN-2180-tmp.patch

This is a tmp patch.
Please review the patch and focus on the {{KylinCubeConfigExt}}. its 
functionality should be okay, but I'm not sure it's design is reasonable. 
Thanks.


> Add project config and make config priority become "cube > project > server"
> 
>
> Key: KYLIN-2180
> URL: https://issues.apache.org/jira/browse/KYLIN-2180
> Project: Kylin
>  Issue Type: New Feature
>  Components: Metadata
>Affects Versions: v1.5.4.1
>Reporter: kangkaisen
>Assignee: kangkaisen
> Attachments: KYLIN-2180-tmp.patch
>
>
> There are cases we want to override global kylin.properties in the scope of a 
> project. E.g. the queue name of Hadoop job.
> Finally, the config priority for Kylin should be "cube > project > server". I 
> think which is reasonable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KYLIN-2200) CompileException on UNION ALL query when result only contains one column

2016-11-16 Thread Dayue Gao (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-2200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15672620#comment-15672620
 ] 

Dayue Gao commented on KYLIN-2200:
--

Still got problem on the following query
{code:sql}
select count(*) from kylin_sales where lstg_format_name='FP-GTC'
union all 
select count(*) from kylin_sales where lstg_format_name='FP-GTC'
{code}

Exception:
{noformat}
Caused by: org.codehaus.commons.compiler.CompileException: Line 138, Column 23: 
No applicable constructor/method found for actual parameters "int, long"; 
candidates are: "Baz$Record2_1()"
{noformat}

Generated Code:
{code:java}
/* 137 */   public Object current() {
/* 138 */ return new Record2_1(
/* 139 */ 0,
/* 140 */ 
org.apache.calcite.runtime.SqlFunctions.toLong(((Object[]) 
inputEnumerator.current())[8]));
/* 141 */   }
{code}

Interestingly, EnumerableCalc use constructor to initialize SyntheticRecordType 
but EnumerableRelImplementor doesn't generate a with-arg constructor for it.

[~julianhyde] Is it a calcite bug or Kylin doesn't use it in the right way?


> CompileException on UNION ALL query when result only contains one column
> 
>
> Key: KYLIN-2200
> URL: https://issues.apache.org/jira/browse/KYLIN-2200
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Affects Versions: v1.5.4.1
>Reporter: Dayue Gao
>Assignee: Dayue Gao
>
> {code:sql}
> select count(*) from kylin_sales
> union all
> select count(*) from kylin_sales
> {code}
> got following exception
> {noformat}
> Caused by: org.codehaus.commons.compiler.CompileException: Line 82, Column 
> 32: Cannot determine simple type name "Record11_1"
> at 
> org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10092)
> at 
> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5375)
> at 
> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5184)
> at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5165)
> at 
> org.codehaus.janino.UnitCompiler.access$12600(UnitCompiler.java:183)
> at 
> org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java:5096)
> at org.codehaus.janino.Java$ReferenceType.accept(Java.java:2880)
> at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:5136)
> at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5598)
> at 
> org.codehaus.janino.UnitCompiler.access$13300(UnitCompiler.java:183)
> at 
> org.codehaus.janino.UnitCompiler$16.visitCast(UnitCompiler.java:5104)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (KYLIN-2177) dict.TrieDictionary:182 : Not a valid value: 2016-11-13

2016-11-16 Thread Shaofeng SHI (JIRA)

 [ 
https://issues.apache.org/jira/browse/KYLIN-2177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shaofeng SHI resolved KYLIN-2177.
-
Resolution: Duplicate

> dict.TrieDictionary:182 : Not a valid value: 2016-11-13
> ---
>
> Key: KYLIN-2177
> URL: https://issues.apache.org/jira/browse/KYLIN-2177
> Project: Kylin
>  Issue Type: Improvement
>  Components: Metadata
>Reporter: huangchao
>Assignee: Shaofeng SHI
> Attachments: Snip20161113_11.png, Snip20161113_12.png, kylin.issue.log
>
>
> version :apache-kylin-1.5.4.1-hbase1.x-bin
> os:ubuntu 14.04.1
> insight return below error after retrigger cube job.
> "Error while executing SQL "select * from sale_detail LIMIT 5": 
> java.lang.IllegalArgumentException: Value not exists!"
> step:
> drop exist cube then recreate job, insight work well when exist "select * 
> from sale_detail LIMIT 5".
> then exist cube build for new data. insight broken and thrown below issue 
> "select * from sale_detail LIMIT 5": java.lang.IllegalArgumentException: 
> Value not exists!"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (KYLIN-2177) dict.TrieDictionary:182 : Not a valid value: 2016-11-13

2016-11-16 Thread Shaofeng SHI (JIRA)

 [ 
https://issues.apache.org/jira/browse/KYLIN-2177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shaofeng SHI closed KYLIN-2177.
---

> dict.TrieDictionary:182 : Not a valid value: 2016-11-13
> ---
>
> Key: KYLIN-2177
> URL: https://issues.apache.org/jira/browse/KYLIN-2177
> Project: Kylin
>  Issue Type: Improvement
>  Components: Metadata
>Reporter: huangchao
>Assignee: Shaofeng SHI
> Attachments: Snip20161113_11.png, Snip20161113_12.png, kylin.issue.log
>
>
> version :apache-kylin-1.5.4.1-hbase1.x-bin
> os:ubuntu 14.04.1
> insight return below error after retrigger cube job.
> "Error while executing SQL "select * from sale_detail LIMIT 5": 
> java.lang.IllegalArgumentException: Value not exists!"
> step:
> drop exist cube then recreate job, insight work well when exist "select * 
> from sale_detail LIMIT 5".
> then exist cube build for new data. insight broken and thrown below issue 
> "select * from sale_detail LIMIT 5": java.lang.IllegalArgumentException: 
> Value not exists!"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (KYLIN-2088) Support intersect count for calculation of retention or conversion rates

2016-11-16 Thread liyang (JIRA)

 [ 
https://issues.apache.org/jira/browse/KYLIN-2088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

liyang closed KYLIN-2088.
-
   Resolution: Fixed
Fix Version/s: v1.6.0

> Support intersect count for calculation of retention or conversion rates
> 
>
> Key: KYLIN-2088
> URL: https://issues.apache.org/jira/browse/KYLIN-2088
> Project: Kylin
>  Issue Type: New Feature
>  Components: Query Engine
>Reporter: Yerui Sun
>Assignee: Yerui Sun
> Fix For: v1.6.0
>
> Attachments: KYLIN-2088.patch
>
>
> Retention or Conversion Rates is very important in data analyze. 
> It can be calculated from two dataset of two different value of one 
> dimension. For example, we have an count distinct measure, like uv(dataset of 
> uuid), and one dimension, like date, and the retention of uv between 
> '20161015' and '20161016' is the intersection of two uv datasets.
> Fortunately, we have implement dataset in Kylin, as bitmap, for precisely 
> count distinct. Only an UDAF is needed to calculate intersection of two or 
> more bitmaps.
> I'll try on this and post patch later.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (KYLIN-2088) Support intersect count for calculation of retention or conversion rates

2016-11-16 Thread liyang (JIRA)

 [ 
https://issues.apache.org/jira/browse/KYLIN-2088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

liyang resolved KYLIN-2088.
---
Resolution: Fixed

> Support intersect count for calculation of retention or conversion rates
> 
>
> Key: KYLIN-2088
> URL: https://issues.apache.org/jira/browse/KYLIN-2088
> Project: Kylin
>  Issue Type: New Feature
>  Components: Query Engine
>Reporter: Yerui Sun
>Assignee: Yerui Sun
> Fix For: v1.6.0
>
> Attachments: KYLIN-2088.patch
>
>
> Retention or Conversion Rates is very important in data analyze. 
> It can be calculated from two dataset of two different value of one 
> dimension. For example, we have an count distinct measure, like uv(dataset of 
> uuid), and one dimension, like date, and the retention of uv between 
> '20161015' and '20161016' is the intersection of two uv datasets.
> Fortunately, we have implement dataset in Kylin, as bitmap, for precisely 
> count distinct. Only an UDAF is needed to calculate intersection of two or 
> more bitmaps.
> I'll try on this and post patch later.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (KYLIN-2188) The AggregationRegionScanner class occured error when we compiled the kylin project using hbase-server-1.2.x.jar.

2016-11-16 Thread Qiang Zhang (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-2188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15671083#comment-15671083
 ] 

Qiang Zhang edited comment on KYLIN-2188 at 11/16/16 5:45 PM:
--

I checkout and compile Kylin's '*hbase1.x' branch. But the Kylin compiler is 
still wrong. 
I compiled successfully it after modified the source code of the Kylin.


was (Author: zhangqiang2):
I checkout and compile Kylin's '*hbase1.x' branch. But the Kylin compiler is 
still wrong. 
I compiled successfully the Kylin after modified source code.

> The AggregationRegionScanner class occured error when we compiled the kylin 
> project using hbase-server-1.2.x.jar.
> -
>
> Key: KYLIN-2188
> URL: https://issues.apache.org/jira/browse/KYLIN-2188
> Project: Kylin
>  Issue Type: Bug
>  Components: Storage - HBase
>Affects Versions: v1.5.3, v1.5.4, v1.5.4.1
> Environment: CentOS Linux release 7.2.1511、maven 3.2.5、jdk1.7.0_80
>Reporter: Qiang Zhang
>Assignee: liyang
>  Labels: patch
>
> The RegionScanner and InternalScanner interface was different between 
> hbase-server-1.2.x.jar and hbase-server-0.9.8.jar. The 
> AggregationRegionScanner class inherited the RegionScanner interface. But it 
> couldn't be compatible with hbase-server-1.2.x.jar and hbase-server-0.9.8.jar.
> The reappear steps is as following:
> 1. Get source code using git from git://git.apache.org/kylin.git;
> 2. Run the mvn command to compile the kylin project;
> 3. Compile successfully;
> 4. Modify the value of the  to 1.2.0 in the pom.xml of 
> the kylin project;
> 5. Run the mvn command to compile the kylin project;
> 3. Compile fail;



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (KYLIN-2188) The AggregationRegionScanner class occured error when we compiled the kylin project using hbase-server-1.2.x.jar.

2016-11-16 Thread Qiang Zhang (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-2188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15671083#comment-15671083
 ] 

Qiang Zhang edited comment on KYLIN-2188 at 11/16/16 5:36 PM:
--

I checkout and compile Kylin's '*hbase1.x' branch. But the Kylin compiler is 
still wrong. 
I compiled successfully the Kylin after modified source code.


was (Author: zhangqiang2):
I checkouted and compiled Kylin's '*hbase1.x' branch. But But the Kylin 
compiler is still wrong. I compiled successfully the Kylin after modified 
source code.

> The AggregationRegionScanner class occured error when we compiled the kylin 
> project using hbase-server-1.2.x.jar.
> -
>
> Key: KYLIN-2188
> URL: https://issues.apache.org/jira/browse/KYLIN-2188
> Project: Kylin
>  Issue Type: Bug
>  Components: Storage - HBase
>Affects Versions: v1.5.3, v1.5.4, v1.5.4.1
> Environment: CentOS Linux release 7.2.1511、maven 3.2.5、jdk1.7.0_80
>Reporter: Qiang Zhang
>Assignee: liyang
>  Labels: patch
>
> The RegionScanner and InternalScanner interface was different between 
> hbase-server-1.2.x.jar and hbase-server-0.9.8.jar. The 
> AggregationRegionScanner class inherited the RegionScanner interface. But it 
> couldn't be compatible with hbase-server-1.2.x.jar and hbase-server-0.9.8.jar.
> The reappear steps is as following:
> 1. Get source code using git from git://git.apache.org/kylin.git;
> 2. Run the mvn command to compile the kylin project;
> 3. Compile successfully;
> 4. Modify the value of the  to 1.2.0 in the pom.xml of 
> the kylin project;
> 5. Run the mvn command to compile the kylin project;
> 3. Compile fail;



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (KYLIN-2202) Fix the conflict between KYLIN-1851 and KYLIN-2135

2016-11-16 Thread XIE FAN (JIRA)

 [ 
https://issues.apache.org/jira/browse/KYLIN-2202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

XIE FAN updated KYLIN-2202:
---
Fix Version/s: (was: Future)
   v1.6.1

> Fix the conflict between KYLIN-1851 and KYLIN-2135
> --
>
> Key: KYLIN-2202
> URL: https://issues.apache.org/jira/browse/KYLIN-2202
> Project: Kylin
>  Issue Type: Bug
>Affects Versions: v1.5.4.1
>Reporter: XIE FAN
> Fix For: v1.6.1
>
>
> In KYLIN-1851, we use a new dictionary(TrieDictionaryForest) to reduce the 
> peek memory usage of the dictionary building procedure. In order to use the 
> new dictionary, we need to make sure that the input data is sorted. But in 
> KYLIN-2135, the output data is split into multi files and values in different 
> files may be out-of-order. So we need to fix the conflict between this two 
> issues.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (KYLIN-2202) Fix the conflict between KYLIN-1851 and KYLIN-2135

2016-11-16 Thread XIE FAN (JIRA)
XIE FAN created KYLIN-2202:
--

 Summary: Fix the conflict between KYLIN-1851 and KYLIN-2135
 Key: KYLIN-2202
 URL: https://issues.apache.org/jira/browse/KYLIN-2202
 Project: Kylin
  Issue Type: Bug
Affects Versions: v1.5.4.1
Reporter: XIE FAN
 Fix For: Future


In KYLIN-1851, we use a new dictionary(TrieDictionaryForest) to reduce the peek 
memory usage of the dictionary building procedure. In order to use the new 
dictionary, we need to make sure that the input data is sorted. But in 
KYLIN-2135, the output data is split into multi files and values in different 
files may be out-of-order. So we need to fix the conflict between this two 
issues.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (KYLIN-2201) Cube desc and aggregation group rule combination max check fail

2016-11-16 Thread Roger Shi (JIRA)
Roger Shi created KYLIN-2201:


 Summary: Cube desc and aggregation group rule combination max 
check fail
 Key: KYLIN-2201
 URL: https://issues.apache.org/jira/browse/KYLIN-2201
 Project: Kylin
  Issue Type: Bug
Reporter: Roger Shi






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KYLIN-2200) CompileException on UNION ALL query when result only contains one column

2016-11-16 Thread Dayue Gao (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-2200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15669874#comment-15669874
 ] 

Dayue Gao commented on KYLIN-2200:
--

The root cause is for the second OLAPTableScan, it returns CUSTOM as its 
JavaRowFormat by mistake.

Here's a dump of rowformats for each operator.
{noformat}
OLAPToEnumerableConverter
  EnumerableLimit(format=SCALA)
EnumerableUnion(format=SCALA)
  EnumerableAggregate(format=SCALA)
EnumerableCalc(format=SCALA)
  OLAPTableScan(format=ARRAY)
  EnumerableAggregate(format=SCALA)
EnumerableCalc(format=SCALA)
  OLAPTableScan(format=CUSTOM)
{noformat}

Due to EnumerableAggregate returns SCALA, EnumerableUnion changes Prefer from 
ARRAY to CUSTOM for the second half. And OLAPTableScan honors prefer in the 
following code

{code:java}
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
// 
PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), 
this.rowType, pref.preferArray());
// 
}
{code}

To fix it, we should use ARRAY for OLAPTableScan regardless of pref.

> CompileException on UNION ALL query when result only contains one column
> 
>
> Key: KYLIN-2200
> URL: https://issues.apache.org/jira/browse/KYLIN-2200
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Affects Versions: v1.5.4.1
>Reporter: Dayue Gao
>Assignee: Dayue Gao
>
> {code:sql}
> select count(*) from kylin_sales
> union all
> select count(*) from kylin_sales
> {code}
> got following exception
> {noformat}
> Caused by: org.codehaus.commons.compiler.CompileException: Line 82, Column 
> 32: Cannot determine simple type name "Record11_1"
> at 
> org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10092)
> at 
> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5375)
> at 
> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5184)
> at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5165)
> at 
> org.codehaus.janino.UnitCompiler.access$12600(UnitCompiler.java:183)
> at 
> org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java:5096)
> at org.codehaus.janino.Java$ReferenceType.accept(Java.java:2880)
> at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:5136)
> at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5598)
> at 
> org.codehaus.janino.UnitCompiler.access$13300(UnitCompiler.java:183)
> at 
> org.codehaus.janino.UnitCompiler$16.visitCast(UnitCompiler.java:5104)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KYLIN-2200) CompileException on UNION ALL query when result only contains one column

2016-11-16 Thread Dayue Gao (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-2200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15669839#comment-15669839
 ] 

Dayue Gao commented on KYLIN-2200:
--

I believe it's not a bug in calcite. Because OLAPTableScan returns 
Enumerable, it's an error to cast Object[] to custom class Record11_1.

> CompileException on UNION ALL query when result only contains one column
> 
>
> Key: KYLIN-2200
> URL: https://issues.apache.org/jira/browse/KYLIN-2200
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Affects Versions: v1.5.4.1
>Reporter: Dayue Gao
>Assignee: Dayue Gao
>
> {code:sql}
> select count(*) from kylin_sales
> union all
> select count(*) from kylin_sales
> {code}
> got following exception
> {noformat}
> Caused by: org.codehaus.commons.compiler.CompileException: Line 82, Column 
> 32: Cannot determine simple type name "Record11_1"
> at 
> org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10092)
> at 
> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5375)
> at 
> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5184)
> at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5165)
> at 
> org.codehaus.janino.UnitCompiler.access$12600(UnitCompiler.java:183)
> at 
> org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java:5096)
> at org.codehaus.janino.Java$ReferenceType.accept(Java.java:2880)
> at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:5136)
> at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5598)
> at 
> org.codehaus.janino.UnitCompiler.access$13300(UnitCompiler.java:183)
> at 
> org.codehaus.janino.UnitCompiler$16.visitCast(UnitCompiler.java:5104)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KYLIN-2200) CompileException on UNION ALL query when result only contains one column

2016-11-16 Thread Dayue Gao (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-2200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15669833#comment-15669833
 ] 

Dayue Gao commented on KYLIN-2200:
--

Here is calcite generated code
{code:java}
/*   1 */ public static class Record1_0 implements java.io.Serializable {
/*   2 */   public long f0;
/*   3 */   public Record1_0() {}
/*   4 */   public boolean equals(Object o) {
/*   5 */ if (this == o) {
/*   6 */   return true;
/*   7 */ }
/*   8 */ if (!(o instanceof Record1_0)) {
/*   9 */   return false;
/*  10 */ }
/*  11 */ return this.f0 == ((Record1_0) o).f0;
/*  12 */   }
/*  13 */ 
/*  14 */   public int hashCode() {
/*  15 */ int h = 0;
/*  16 */ h = org.apache.calcite.runtime.Utilities.hash(h, this.f0);
/*  17 */ return h;
/*  18 */   }
/*  19 */ 
/*  20 */   public int compareTo(Record1_0 that) {
/*  21 */ final int c;
/*  22 */ c = org.apache.calcite.runtime.Utilities.compare(this.f0, 
that.f0);
/*  23 */ if (c != 0) {
/*  24 */   return c;
/*  25 */ }
/*  26 */ return 0;
/*  27 */   }
/*  28 */ 
/*  29 */   public String toString() {
/*  30 */ return "{f0=" + this.f0 + "}";
/*  31 */   }
/*  32 */ 
/*  33 */ }
/*  34 */ 
/*  35 */ org.apache.calcite.DataContext root;
/*  36 */ 
/*  37 */ public org.apache.calcite.linq4j.Enumerable bind(final 
org.apache.calcite.DataContext root0) {
/*  38 */   root = root0;
/*  39 */   final org.apache.calcite.linq4j.Enumerable _inputEnumerable = 
((org.apache.kylin.query.schema.OLAPTable) 
root.getRootSchema().getSubSchema("DEFAULT").getTable("KYLIN_SALES")).executeOLAPQuery(root,
 0);
/*  40 */   final org.apache.calcite.linq4j.AbstractEnumerable child = new 
org.apache.calcite.linq4j.AbstractEnumerable(){
/*  41 */ public org.apache.calcite.linq4j.Enumerator enumerator() {
/*  42 */   return new org.apache.calcite.linq4j.Enumerator(){
/*  43 */   public final org.apache.calcite.linq4j.Enumerator 
inputEnumerator = _inputEnumerable.enumerator();
/*  44 */   public void reset() {
/*  45 */ inputEnumerator.reset();
/*  46 */   }
/*  47 */ 
/*  48 */   public boolean moveNext() {
/*  49 */ return inputEnumerator.moveNext();
/*  50 */   }
/*  51 */ 
/*  52 */   public void close() {
/*  53 */ inputEnumerator.close();
/*  54 */   }
/*  55 */ 
/*  56 */   public Object current() {
/*  57 */ return 
org.apache.calcite.runtime.SqlFunctions.toLong(((Object[]) 
inputEnumerator.current())[8]);
/*  58 */   }
/*  59 */ 
/*  60 */ };
/*  61 */ }
/*  62 */ 
/*  63 */   };
/*  64 */   final org.apache.calcite.linq4j.Enumerable _inputEnumerable0 = 
((org.apache.kylin.query.schema.OLAPTable) 
root.getRootSchema().getSubSchema("DEFAULT").getTable("KYLIN_SALES")).executeOLAPQuery(root,
 1);
/*  65 */   final org.apache.calcite.linq4j.AbstractEnumerable child1 = new 
org.apache.calcite.linq4j.AbstractEnumerable(){
/*  66 */ public org.apache.calcite.linq4j.Enumerator enumerator() {
/*  67 */   return new org.apache.calcite.linq4j.Enumerator(){
/*  68 */   public final org.apache.calcite.linq4j.Enumerator 
inputEnumerator = _inputEnumerable0.enumerator();
/*  69 */   public void reset() {
/*  70 */ inputEnumerator.reset();
/*  71 */   }
/*  72 */ 
/*  73 */   public boolean moveNext() {
/*  74 */ return inputEnumerator.moveNext();
/*  75 */   }
/*  76 */ 
/*  77 */   public void close() {
/*  78 */ inputEnumerator.close();
/*  79 */   }
/*  80 */ 
/*  81 */   public Object current() {
/*  82 */ return ((Record11_1) inputEnumerator.current()).COUNT__;
/*  83 */   }
/*  84 */ 
/*  85 */ };
/*  86 */ }
/*  87 */ 
/*  88 */   };
/*  89 */   return 
org.apache.calcite.linq4j.Linq4j.singletonEnumerable(child.aggregate(new 
org.apache.calcite.linq4j.function.Function0() {
/*  90 */   public Object apply() {
/*  91 */ long $SUM0a0s0;
/*  92 */ $SUM0a0s0 = 0;
/*  93 */ Record1_0 record0;
/*  94 */ record0 = new Record1_0();
/*  95 */ record0.f0 = $SUM0a0s0;
/*  96 */ return record0;
/*  97 */   }
/*  98 */ }
/*  99 */ .apply(), new org.apache.calcite.linq4j.function.Function2() {
/* 100 */   public Record1_0 apply(Record1_0 acc, long in) {
/* 101 */ acc.f0 = acc.f0 + in;
/* 102 */ return acc;
/* 103 */   }
/* 104 */   public Record1_0 apply(Record1_0 acc, Long in) {
/* 105 */ return apply(
/* 106 */   acc,
/* 107 */   in.longValue());
/* 108 */   }
/* 109 */   public Record1_0 apply(Object acc, Object in) {
/* 110 */ return apply(
/* 111 */   (Record1_0) acc,
/* 112 */   (Long) in);
/* 113 */   }
/* 114 */ }
/* 115 */   

[jira] [Created] (KYLIN-2200) CompileException on UNION ALL query when result only contains one column

2016-11-16 Thread Dayue Gao (JIRA)
Dayue Gao created KYLIN-2200:


 Summary: CompileException on UNION ALL query when result only 
contains one column
 Key: KYLIN-2200
 URL: https://issues.apache.org/jira/browse/KYLIN-2200
 Project: Kylin
  Issue Type: Bug
  Components: Query Engine
Affects Versions: v1.5.4.1
Reporter: Dayue Gao
Assignee: Dayue Gao


{code:sql}
select count(*) from kylin_sales
union all
select count(*) from kylin_sales
{code}

got following exception
{noformat}
Caused by: org.codehaus.commons.compiler.CompileException: Line 82, Column 32: 
Cannot determine simple type name "Record11_1"
at 
org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10092)
at 
org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5375)
at 
org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5184)
at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5165)
at org.codehaus.janino.UnitCompiler.access$12600(UnitCompiler.java:183)
at 
org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java:5096)
at org.codehaus.janino.Java$ReferenceType.accept(Java.java:2880)
at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:5136)
at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5598)
at org.codehaus.janino.UnitCompiler.access$13300(UnitCompiler.java:183)
at org.codehaus.janino.UnitCompiler$16.visitCast(UnitCompiler.java:5104)
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)