You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by lu...@apache.org on 2015/07/13 12:36:34 UTC

[01/19] incubator-kylin git commit: minor fix log issue CliCommandExecutor

Repository: incubator-kylin
Updated Branches:
  refs/heads/0.7-staging 96aafed94 -> f116f2c41


minor fix log issue CliCommandExecutor


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/16ca5423
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/16ca5423
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/16ca5423

Branch: refs/heads/0.7-staging
Commit: 16ca5423de102bcbeb403e528cc9932c12e4c160
Parents: 725bde5
Author: qianhao.zhou <qi...@ebay.com>
Authored: Tue Jul 7 15:12:21 2015 +0800
Committer: qianhao.zhou <qi...@ebay.com>
Committed: Tue Jul 7 15:12:21 2015 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/kylin/common/util/CliCommandExecutor.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/16ca5423/common/src/main/java/org/apache/kylin/common/util/CliCommandExecutor.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/kylin/common/util/CliCommandExecutor.java b/common/src/main/java/org/apache/kylin/common/util/CliCommandExecutor.java
index 20bcba5..336b206 100644
--- a/common/src/main/java/org/apache/kylin/common/util/CliCommandExecutor.java
+++ b/common/src/main/java/org/apache/kylin/common/util/CliCommandExecutor.java
@@ -131,7 +131,7 @@ public class CliCommandExecutor {
         String line;
         StringBuilder result = new StringBuilder();
         while ((line = reader.readLine()) != null) {
-            result.append("line").append('\n');
+            result.append(line).append('\n');
             if (logAppender != null) {
                 logAppender.log(line);
             }


[08/19] incubator-kylin git commit: [maven-release-plugin] prepare for next development iteration

Posted by lu...@apache.org.
[maven-release-plugin] prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/9d8ccb10
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/9d8ccb10
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/9d8ccb10

Branch: refs/heads/0.7-staging
Commit: 9d8ccb10d8055ef3bc9482de6807de16020a4b60
Parents: 4ccfea6
Author: Luke Han <lu...@apache.org>
Authored: Thu Jul 9 21:05:04 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Thu Jul 9 21:05:04 2015 +0800

----------------------------------------------------------------------
 atopcalcite/pom.xml   | 2 +-
 common/pom.xml        | 2 +-
 cube/pom.xml          | 2 +-
 dictionary/pom.xml    | 2 +-
 invertedindex/pom.xml | 2 +-
 jdbc/pom.xml          | 2 +-
 job/pom.xml           | 2 +-
 metadata/pom.xml      | 2 +-
 monitor/pom.xml       | 2 +-
 pom.xml               | 4 ++--
 query/pom.xml         | 2 +-
 server/pom.xml        | 2 +-
 storage/pom.xml       | 2 +-
 13 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/atopcalcite/pom.xml
----------------------------------------------------------------------
diff --git a/atopcalcite/pom.xml b/atopcalcite/pom.xml
index db76ba4..d4209fb 100644
--- a/atopcalcite/pom.xml
+++ b/atopcalcite/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index cf95319..ff69208 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/cube/pom.xml
----------------------------------------------------------------------
diff --git a/cube/pom.xml b/cube/pom.xml
index 00470b2..450d8fa 100644
--- a/cube/pom.xml
+++ b/cube/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/dictionary/pom.xml
----------------------------------------------------------------------
diff --git a/dictionary/pom.xml b/dictionary/pom.xml
index 6d43941..5078d56 100644
--- a/dictionary/pom.xml
+++ b/dictionary/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/invertedindex/pom.xml
----------------------------------------------------------------------
diff --git a/invertedindex/pom.xml b/invertedindex/pom.xml
index 699a982..0a00d24 100644
--- a/invertedindex/pom.xml
+++ b/invertedindex/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>kylin</artifactId>
         <groupId>org.apache.kylin</groupId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>kylin-invertedindex</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/jdbc/pom.xml
----------------------------------------------------------------------
diff --git a/jdbc/pom.xml b/jdbc/pom.xml
index b193aeb..d62f9c2 100644
--- a/jdbc/pom.xml
+++ b/jdbc/pom.xml
@@ -27,7 +27,7 @@
 	<parent>
 		<groupId>org.apache.kylin</groupId>
 		<artifactId>kylin</artifactId>
-		<version>0.7.2-incubating</version>
+		<version>0.7.3-incubating-SNAPSHOT</version>
 	</parent>
 
 	<properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/job/pom.xml
----------------------------------------------------------------------
diff --git a/job/pom.xml b/job/pom.xml
index 37c2678..778a987 100644
--- a/job/pom.xml
+++ b/job/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
 
     <artifactId>kylin-job</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/metadata/pom.xml
----------------------------------------------------------------------
diff --git a/metadata/pom.xml b/metadata/pom.xml
index ffd8317..d2e6a18 100644
--- a/metadata/pom.xml
+++ b/metadata/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/monitor/pom.xml
----------------------------------------------------------------------
diff --git a/monitor/pom.xml b/monitor/pom.xml
index 5931619..421e063 100644
--- a/monitor/pom.xml
+++ b/monitor/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2c393b4..dbc44cf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
     <groupId>org.apache.kylin</groupId>
     <artifactId>kylin</artifactId>
     <packaging>pom</packaging>
-    <version>0.7.2-incubating</version>
+    <version>0.7.3-incubating-SNAPSHOT</version>
     <name>Kylin:HadoopOLAPEngine</name>
     <url>http://kylin.incubator.apache.org</url>
     <inceptionYear>2014</inceptionYear>
@@ -147,7 +147,7 @@
         <connection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-kylin.git</connection>
         <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-kylin.git</developerConnection>
         <url>https://git-wip-us.apache.org/repos/asf/incubator-kylin.git</url>
-        <tag>kylin-0.7.2-incubating</tag>
+        <tag>apache-kylin-0.7.1-incubating</tag>
     </scm>
 
     <dependencyManagement>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/query/pom.xml
----------------------------------------------------------------------
diff --git a/query/pom.xml b/query/pom.xml
index b065d00..68c0b9a 100644
--- a/query/pom.xml
+++ b/query/pom.xml
@@ -28,7 +28,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 6a1e4b7..3aa6ac9 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -28,7 +28,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d8ccb10/storage/pom.xml
----------------------------------------------------------------------
diff --git a/storage/pom.xml b/storage/pom.xml
index fcb40d3..601af3f 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating</version>
+        <version>0.7.3-incubating-SNAPSHOT</version>
     </parent>
 
     <dependencies>


[04/19] incubator-kylin git commit: Add missing license header

Posted by lu...@apache.org.
Add missing license header


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/091fb3df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/091fb3df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/091fb3df

Branch: refs/heads/0.7-staging
Commit: 091fb3df9b9b48c5794693dc828d529c9af9b241
Parents: 6e97e24
Author: Luke Han <lu...@apache.org>
Authored: Thu Jul 9 16:53:14 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Thu Jul 9 16:53:14 2015 +0800

----------------------------------------------------------------------
 bin/metastore.sh                                |  17 ++
 .../kylin/common/debug/BackdoorToggles.java     |  17 ++
 .../kylin/common/persistence/RawResource.java   |  18 ++
 .../apache/kylin/job/tools/RowCounterCLI.java   |  17 ++
 pom.xml                                         | 170 +++++++++++++++++++
 .../checkstyle/checkstyle-java-header.txt       |  16 ++
 src/main/config/checkstyle/checkstyle.xml       |  59 +++++++
 src/main/config/checkstyle/suppressions.xml     |  32 ++++
 8 files changed, 346 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/091fb3df/bin/metastore.sh
----------------------------------------------------------------------
diff --git a/bin/metastore.sh b/bin/metastore.sh
index f08de31..bbb1f42 100644
--- a/bin/metastore.sh
+++ b/bin/metastore.sh
@@ -1,5 +1,22 @@
 #!/bin/bash
 
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 dir=$(dirname ${0})
 source ${dir}/check-env.sh
 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/091fb3df/common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java b/common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
index 5760798..e67eb84 100644
--- a/common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
+++ b/common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.common.debug;
 
 import java.util.Map;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/091fb3df/common/src/main/java/org/apache/kylin/common/persistence/RawResource.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/kylin/common/persistence/RawResource.java b/common/src/main/java/org/apache/kylin/common/persistence/RawResource.java
index 2c3238f..131fcfe 100644
--- a/common/src/main/java/org/apache/kylin/common/persistence/RawResource.java
+++ b/common/src/main/java/org/apache/kylin/common/persistence/RawResource.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
 package org.apache.kylin.common.persistence;
 
 import java.io.InputStream;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/091fb3df/job/src/main/java/org/apache/kylin/job/tools/RowCounterCLI.java
----------------------------------------------------------------------
diff --git a/job/src/main/java/org/apache/kylin/job/tools/RowCounterCLI.java b/job/src/main/java/org/apache/kylin/job/tools/RowCounterCLI.java
index b80063d..524c480 100644
--- a/job/src/main/java/org/apache/kylin/job/tools/RowCounterCLI.java
+++ b/job/src/main/java/org/apache/kylin/job/tools/RowCounterCLI.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.job.tools;
 
 import org.apache.hadoop.conf.Configuration;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/091fb3df/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index cdd8191..5948762 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,6 +41,7 @@
         <maven-model.version>3.1.1</maven-model.version>
         <maven-release.version>2.5.1</maven-release.version>
         <maven-assembly.version>2.4</maven-assembly.version>
+        <maven-license.plugin.version>2.6</maven-license.plugin.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 
@@ -441,6 +442,9 @@
                         <target>${javaVersion}</target>
                     </configuration>
                 </plugin>
+
+
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-site-plugin</artifactId>
@@ -537,13 +541,76 @@
                         </execution>
                     </executions>
                 </plugin>
+                <!-- utility plugins -->
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-assembly-plugin</artifactId>
                     <version>${maven-assembly.version}</version>
                 </plugin>
+
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-checkstyle-plugin</artifactId>
+                    <version>2.15</version>
+                </plugin>
+
             </plugins>
         </pluginManagement>
+
+        <plugins>
+            <!--
+            <plugin>
+                <groupId>com.mycila</groupId>
+                <artifactId>license-maven-plugin</artifactId>
+                <version>${maven-license.plugin.version}</version>
+                <configuration>
+                    <header>License-Header.txt</header>
+                    <licenseName>apache_v2</licenseName>
+                    <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
+                    <canUpdateCopyright>true</canUpdateCopyright>
+                    <canUpdateDescription>true</canUpdateDescription>
+                    <excludes>
+                        <exclude>**/*.diff</exclude>
+                        <exclude>*.patch</exclude>
+                        <exclude>**/*.log</exclude>
+                        <exclude>**/*.data</exclude>
+                        <exclude>**/README.*</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+            -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-gpg-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <!-- Checkstyle Plugin
+            <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-checkstyle-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>validate</id>
+                            <phase>validate</phase>
+                            <configuration>
+                                <configLocation>src/main/config/checkstyle/checkstyle.xml</configLocation>
+                                <suppressionsLocation>src/main/config/checkstyle/suppressions.xml</suppressionsLocation>
+                                <consoleOutput>true</consoleOutput>
+                                <headerLocation>src/main/config/checkstyle/checkstyle-java-header.txt</headerLocation>
+                                <failOnViolation>true</failOnViolation>
+                                <includeTestSourceDirectory>true</includeTestSourceDirectory>
+                            </configuration>
+                            <goals>
+                                <goal>check</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+                -->
+        </plugins>
+
     </build>
 
     <modules>
@@ -603,7 +670,94 @@
                             <argLine>-Xms1G -Xmx4G -XX:PermSize=128M -XX:MaxPermSize=512M</argLine>
                         </configuration>
                     </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-gpg-plugin</artifactId>
+                        <configuration>
+                            <skip>true</skip>
+                        </configuration>
+                    </plugin>
+                    <!-- Apache-RAT checks for files without headers.
+                         If run on a messy developer's sandbox, it will fail.
+                         This serves as a reminder to only build a release in a clean
+                         sandbox! -->
+                    <plugin>
+                        <groupId>org.apache.rat</groupId>
+                        <artifactId>apache-rat-plugin</artifactId>
+                        <configuration>
+                            <numUnapprovedLicenses>0</numUnapprovedLicenses>
+                            <excludes>
+                                <exclude>.idea/**</exclude>
+                                <exclude>.git/**</exclude>
+                                <exclude>.settings/**</exclude>
+                                <!-- text files without comments -->
+                                <exclude>**/*.csv</exclude>
+                                <exclude>**/*.json</exclude>
+                                <exclude>**/*.md</exclude>
+                                <!-- binary files -->
+                                <exclude>**/*.dict</exclude>
+                                <exclude>**/*.dic</exclude>
+                                <exclude>**/*.snapshot</exclude>
+                                <exclude>**/*.pdf</exclude>
+                                <exclude>**/*.log</exclude>
+
+                                <exclude>**/.checkstyle</exclude>
+
+                                <!-- generated files -->
+                                <exclude>**/target/**</exclude>
+                                <exclude>lib/**</exclude>
+                                <!-- Kylin's website content -->
+                                <exclude>**/.sass-cache/**</exclude>
 
+                                <exclude>docs/website/**</exclude>
+
+                                <!-- tomcat package -->
+                                <exclude>tomcat/**</exclude>
+                                <!-- front end libary and generated files -->
+                                <exclude>webapp/node_modules/**</exclude>
+                                <exclude>webapp/dist/**</exclude>
+                                <exclude>webapp/app/components/**</exclude>
+                                <!-- json configuration file-->
+                                <exclude>webapp/.bowerrc</exclude>
+                                <exclude>webapp/.jshintrc</exclude>
+                                <!-- generated dict files -->
+                                <exclude>dictionary/metastore_db/**</exclude>
+
+                                <!-- MIT license -->
+                                <exclude>webapp/app/css/AdminLTE-fonts.css</exclude>
+                                <exclude>webapp/app/css/AdminLTE.css</exclude>
+
+                                <!-- jdbc log -->
+                                <exclude>jdbc/kylin_jdbc.log*</exclude>
+
+                                <!-- HBase MiniCluster Testing Data, for testing only -->
+                                <exclude>examples/test_case_data/minicluster/hbase-export.tar.gz</exclude>
+                                <exclude>examples/test_case_data/**/*.xml</exclude>
+
+                            </excludes>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <phase>verify</phase>
+                                <goals>
+                                    <goal>check</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <dependencies>
+                            <dependency>
+                                <groupId>org.apache.maven.doxia</groupId>
+                                <artifactId>doxia-core</artifactId>
+                                <version>1.6</version>
+                                <exclusions>
+                                    <exclusion>
+                                        <groupId>xerces</groupId>
+                                        <artifactId>xercesImpl</artifactId>
+                                    </exclusion>
+                                </exclusions>
+                            </dependency>
+                        </dependencies>
+                    </plugin>
                 </plugins>
             </build>
         </profile>
@@ -663,6 +817,14 @@
             <id>apache-release</id>
             <build>
                 <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-gpg-plugin</artifactId>
+                        <configuration>
+                            <skip>false</skip>
+                        </configuration>
+                    </plugin>
+
                     <!-- Override the parent assembly execution to customize the assembly
               descriptor and final name. -->
                     <plugin>
@@ -743,6 +905,8 @@
                                 <exclude>**/*.pdf</exclude>
                                 <exclude>**/*.log</exclude>
 
+                                <exclude>**/.checkstyle</exclude>
+
                                 <!-- generated files -->
                                 <exclude>**/target/**</exclude>
                                 <exclude>lib/**</exclude>
@@ -821,5 +985,11 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>dev</id>
+            <properties>
+                <skipCheck>true</skipCheck>
+            </properties>
+        </profile>
     </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/091fb3df/src/main/config/checkstyle/checkstyle-java-header.txt
----------------------------------------------------------------------
diff --git a/src/main/config/checkstyle/checkstyle-java-header.txt b/src/main/config/checkstyle/checkstyle-java-header.txt
new file mode 100644
index 0000000..2a42971
--- /dev/null
+++ b/src/main/config/checkstyle/checkstyle-java-header.txt
@@ -0,0 +1,16 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/091fb3df/src/main/config/checkstyle/checkstyle.xml
----------------------------------------------------------------------
diff --git a/src/main/config/checkstyle/checkstyle.xml b/src/main/config/checkstyle/checkstyle.xml
new file mode 100644
index 0000000..8d46977
--- /dev/null
+++ b/src/main/config/checkstyle/checkstyle.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!--
+  This version of checkstyle is based on the Apache Giraph checkstyle
+  configuration, which in turn is based on Hadoop and common-math
+  configurations.
+
+  The documentation for checkstyle is available at
+
+  http://checkstyle.sourceforge.net
+-->
+
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
+
+<module name="Checker">
+    <property name="localeLanguage" value="en"/>
+
+    <!-- Checks for headers -->
+    <!-- See http://checkstyle.sf.net/config_header.html -->
+    <!-- Verify that EVERY source file has the appropriate license -->
+    <module name="Header">
+        <property name="headerFile" value="${checkstyle.header.file}"/>
+    </module>
+
+    <!-- Setup special comments to suppress specific checks from source files -->
+    <module name="SuppressionCommentFilter">
+        <property name="offCommentFormat" value="CHECKSTYLE\: stop ([\w\|]+)"/>
+        <property name="onCommentFormat"  value="CHECKSTYLE\: resume ([\w\|]+)"/>
+        <property name="checkFormat"      value="$1"/>
+    </module>
+
+    <!-- Turn off all checks between OFF and ON -->
+    <module name="SuppressionCommentFilter">
+        <property name="offCommentFormat" value="CHECKSTYLE\: OFF"/>
+        <property name="onCommentFormat"  value="CHECKSTYLE\: ON"/>
+    </module>
+
+    <!-- Turn off checks for the next N lines. -->
+    <module name="SuppressWithNearbyCommentFilter">
+        <property name="commentFormat" value="CHECKSTYLE: +IGNORE (\d+)"/>
+        <property name="influenceFormat" value="$1"/>
+    </module>
+</module>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/091fb3df/src/main/config/checkstyle/suppressions.xml
----------------------------------------------------------------------
diff --git a/src/main/config/checkstyle/suppressions.xml b/src/main/config/checkstyle/suppressions.xml
new file mode 100644
index 0000000..c6edc5f
--- /dev/null
+++ b/src/main/config/checkstyle/suppressions.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+
+<!DOCTYPE suppressions PUBLIC
+        "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+        "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+
+<suppressions>
+    <!-- Suppress javadoc, line length, visibility checks for test code -->
+    <suppress checks="JavadocStyleCheck" files="Test*.java"/>
+    <suppress checks="JavadocTypeCheck" files="Test*.java"/>
+    <suppress checks="LineLength" files="Test*.java"/>
+    <suppress checks="Indentation" files="Test*.java"/>
+    <suppress checks="VisibilityModifier" files="Test*.java"/>
+
+</suppressions>


[16/19] incubator-kylin git commit: Fix license issue with 0.7.2 release

Posted by lu...@apache.org.
Fix license issue with 0.7.2 release


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/4b0ee63c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/4b0ee63c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/4b0ee63c

Branch: refs/heads/0.7-staging
Commit: 4b0ee63cc776cccb1039e34961a97371df8b64a3
Parents: 575e0b8 b6eaf1a
Author: Luke Han <lu...@apache.org>
Authored: Mon Jul 13 17:04:04 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Mon Jul 13 17:04:04 2015 +0800

----------------------------------------------------------------------
 README.md                                       |  76 +---
 atopcalcite/pom.xml                             |   2 +-
 .../apache/calcite/runtime/SqlFunctions.java    |  34 +-
 .../calcite/sql2rel/SqlToRelConverter.java      | 169 ++-----
 bin/metastore.sh                                |  17 +
 common/pom.xml                                  |   2 +-
 .../kylin/common/debug/BackdoorToggles.java     |  17 +
 .../kylin/common/persistence/RawResource.java   |  18 +
 .../org/apache/kylin/common/util/Bytes.java     |   8 +-
 .../java/org/apache/kylin/common/util/Pair.java |   9 +-
 cube/pom.xml                                    |   2 +-
 .../org/apache/kylin/cube/CubeSegmentsTest.java |   4 +-
 dictionary/pom.xml                              |   2 +-
 docs/release_notes.md                           |  50 ++-
 docs/website/README.md                          |  49 +-
 docs/website/_config-prod.yml                   |  20 -
 docs/website/_config.yml                        |   4 +-
 .../2015-07-02-Events-and-Conferences.md        |  25 ++
 .../2015-07-06-How-to-making-a-release.md       | 448 +++++++++++++++++++
 .../blog/2015-01-25-introduce-data-model.md     |   2 +-
 .../2015-06-10-release-v0.7.1-incubating.md     | 149 ++++++
 docs/website/blog/index.html~                   |  64 ---
 docs/website/blog/index.md~                     |  43 --
 docs/website/docs/index.cn.md                   | 134 ++----
 docs/website/docs/index.md                      | 133 ++----
 docs/website/download/index.cn.md               |   7 +
 docs/website/download/index.md                  |   9 +
 invertedindex/pom.xml                           |   2 +-
 .../invertedindex/IIInstanceTest.java           |   4 +-
 .../invertedindex/invertedindex/LZFTest.java    |   4 +-
 jdbc/pom.xml                                    |   2 +-
 job/pom.xml                                     |   2 +-
 .../apache/kylin/job/tools/RowCounterCLI.java   |  17 +
 .../kylin/job/tools/HBaseRowDigestTest.java     |   4 +-
 metadata/pom.xml                                |   2 +-
 .../measure/fixedlen/FixedHLLCodec.java         |   4 +-
 .../realization/IRealizationConstants.java      |   4 +-
 monitor/pom.xml                                 |   5 +-
 .../apache/kylin/monitor/ApiRequestParser.java  |   4 +-
 .../java/org/apache/kylin/monitor/Client.java   |   4 +-
 .../org/apache/kylin/monitor/ConfigUtils.java   |   4 +-
 .../org/apache/kylin/monitor/DebugClient.java   |   4 +-
 .../org/apache/kylin/monitor/FileUtils.java     |   4 +-
 .../apache/kylin/monitor/HiveJdbcClient.java    |   4 +-
 .../kylin/monitor/MonitorMetaManager.java       |   4 +-
 .../org/apache/kylin/monitor/QueryParser.java   |   4 +-
 .../org/apache/kylin/monitor/ParseLogTest.java  |   4 +-
 pom.xml                                         | 172 ++++++-
 query/pom.xml                                   |   2 +-
 server/pom.xml                                  |   2 +-
 .../kylin/rest/filter/KylinApiFilter.java       |  17 +
 .../org/apache/kylin/jdbc/JDBCDriverTest.java   |   4 +-
 src/main/config/assemblies/source-assembly.xml  |   1 -
 .../checkstyle/checkstyle-java-header.txt       |  17 +
 src/main/config/checkstyle/checkstyle.xml       |  44 ++
 src/main/config/checkstyle/suppressions.xml     |  32 ++
 storage/pom.xml                                 |   2 +-
 .../storage/hbase/coprocessor/AggrKey.java      |  17 +
 .../hbase/coprocessor/CoprocessorConstants.java |   3 -
 .../endpoint/generated/IIProtos.java            |  20 +-
 .../coprocessor/observer/ObserverBehavior.java  |  17 +
 .../kylin/storage/filter/FilterPerfTest.java    |  17 +
 62 files changed, 1359 insertions(+), 591 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4b0ee63c/atopcalcite/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
----------------------------------------------------------------------
diff --cc atopcalcite/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
index 80b9fdd,0000000..c3e99ef
mode 100644,000000..100644
--- a/atopcalcite/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
+++ b/atopcalcite/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
@@@ -1,1378 -1,0 +1,1372 @@@
 +/*
-  * OVERRIDE POINT:
-  * - divide(BigDecimal,BigDecimal), was `b0.divide(b1)`, now `b0.divide(b1, MathContext.DECIMAL64);` 
-  */
- 
- /*
-  * Licensed to the Apache Software Foundation (ASF) under one or more
-  * contributor license agreements.  See the NOTICE file distributed with
-  * this work for additional information regarding copyright ownership.
-  * The ASF licenses this file to you under the Apache License, Version 2.0
-  * (the "License"); you may not use this file except in compliance with
-  * the License.  You may obtain a copy of the License at
-  *
-  * http://www.apache.org/licenses/LICENSE-2.0
-  *
++ * Licensed to the Apache Software Foundation (ASF) under one
++ * or more contributor license agreements.  See the NOTICE file
++ * distributed with this work for additional information
++ * regarding copyright ownership.  The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License.  You may obtain a copy of the License at
++ * 
++ *     http://www.apache.org/licenses/LICENSE-2.0
++ * 
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
-  */
++*/
 +package org.apache.calcite.runtime;
 +
 +import org.apache.calcite.DataContext;
 +import org.apache.calcite.avatica.util.ByteString;
 +import org.apache.calcite.avatica.util.DateTimeUtils;
 +import org.apache.calcite.linq4j.Enumerable;
 +import org.apache.calcite.linq4j.Linq4j;
 +import org.apache.calcite.linq4j.function.Deterministic;
 +import org.apache.calcite.linq4j.function.Function1;
 +import org.apache.calcite.linq4j.function.NonDeterministic;
 +import org.apache.calcite.linq4j.tree.Primitive;
 +
 +import java.math.BigDecimal;
 +import java.math.BigInteger;
 +import java.math.MathContext;
 +import java.sql.SQLException;
 +import java.sql.Timestamp;
 +import java.text.DecimalFormat;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.TimeZone;
++import java.util.*;
 +import java.util.concurrent.atomic.AtomicLong;
 +import java.util.regex.Pattern;
 +
 +/**
++ * OVERRIDE POINT:
++ * - divide(BigDecimal,BigDecimal), was `b0.divide(b1)`, now `b0.divide(b1, MathContext.DECIMAL64);`
 + * Helper methods to implement SQL functions in generated code.
 + *
 + * <p>Not present: and, or, not (builtin operators are better, because they
 + * use lazy evaluation. Implementations do not check for null values; the
 + * calling code must do that.</p>
 + *
 + * <p>Many of the functions do not check for null values. This is intentional.
 + * If null arguments are possible, the code-generation framework checks for
 + * nulls before calling the functions.</p>
 + */
 +@SuppressWarnings("UnnecessaryUnboxing")
 +@Deterministic
 +public class SqlFunctions {
 +  private static final DecimalFormat DOUBLE_FORMAT =
 +      new DecimalFormat("0.0E0");
 +
 +  private static final TimeZone LOCAL_TZ = TimeZone.getDefault();
 +
 +  private static final Function1<List<Object>, Enumerable<Object>>
 +  LIST_AS_ENUMERABLE =
 +      new Function1<List<Object>, Enumerable<Object>>() {
 +        public Enumerable<Object> apply(List<Object> list) {
 +          return Linq4j.asEnumerable(list);
 +        }
 +      };
 +
 +  /** Holds, for each thread, a map from sequence name to sequence current
 +   * value.
 +   *
 +   * <p>This is a straw man of an implementation whose main goal is to prove
 +   * that sequences can be parsed, validated and planned. A real application
 +   * will want persistent values for sequences, shared among threads. */
 +  private static final ThreadLocal<Map<String, AtomicLong>> THREAD_SEQUENCES =
 +      new ThreadLocal<Map<String, AtomicLong>>() {
 +        @Override protected Map<String, AtomicLong> initialValue() {
 +          return new HashMap<String, AtomicLong>();
 +        }
 +      };
 +
 +  private SqlFunctions() {
 +  }
 +
 +  /** SQL SUBSTRING(string FROM ... FOR ...) function. */
 +  public static String substring(String s, int from, int for_) {
 +    return s.substring(from - 1, Math.min(from - 1 + for_, s.length()));
 +  }
 +
 +  /** SQL SUBSTRING(string FROM ...) function. */
 +  public static String substring(String s, int from) {
 +    return s.substring(from - 1);
 +  }
 +
 +  /** SQL UPPER(string) function. */
 +  public static String upper(String s) {
 +    return s.toUpperCase();
 +  }
 +
 +  /** SQL LOWER(string) function. */
 +  public static String lower(String s) {
 +    return s.toLowerCase();
 +  }
 +
 +  /** SQL INITCAP(string) function. */
 +  public static String initcap(String s) {
 +    // Assumes Alpha as [A-Za-z0-9]
 +    // white space is treated as everything else.
 +    final int len = s.length();
 +    boolean start = true;
 +    final StringBuilder newS = new StringBuilder();
 +
 +    for (int i = 0; i < len; i++) {
 +      char curCh = s.charAt(i);
 +      final int c = (int) curCh;
 +      if (start) {  // curCh is whitespace or first character of word.
 +        if (c > 47 && c < 58) { // 0-9
 +          start = false;
 +        } else if (c > 64 && c < 91) {  // A-Z
 +          start = false;
 +        } else if (c > 96 && c < 123) {  // a-z
 +          start = false;
 +          curCh = (char) (c - 32); // Uppercase this character
 +        }
 +        // else {} whitespace
 +      } else {  // Inside of a word or white space after end of word.
 +        if (c > 47 && c < 58) { // 0-9
 +          // noop
 +        } else if (c > 64 && c < 91) {  // A-Z
 +          curCh = (char) (c + 32); // Lowercase this character
 +        } else if (c > 96 && c < 123) {  // a-z
 +          // noop
 +        } else { // whitespace
 +          start = true;
 +        }
 +      }
 +      newS.append(curCh);
 +    } // for each character in s
 +    return newS.toString();
 +  }
 +
 +  /** SQL CHARACTER_LENGTH(string) function. */
 +  public static int charLength(String s) {
 +    return s.length();
 +  }
 +
 +  /** SQL {@code string || string} operator. */
 +  public static String concat(String s0, String s1) {
 +    return s0 + s1;
 +  }
 +
 +  /** SQL {@code binary || binary} operator. */
 +  public static ByteString concat(ByteString s0, ByteString s1) {
 +    return s0.concat(s1);
 +  }
 +
 +  /** SQL {@code RTRIM} function applied to string. */
 +  public static String rtrim(String s) {
 +    return trim_(s, false, true, ' ');
 +  }
 +
 +  /** SQL {@code LTRIM} function. */
 +  public static String ltrim(String s) {
 +    return trim_(s, true, false, ' ');
 +  }
 +
 +  /** SQL {@code TRIM(... seek FROM s)} function. */
 +  public static String trim(boolean leading, boolean trailing, String seek,
 +      String s) {
 +    return trim_(s, leading, trailing, seek.charAt(0));
 +  }
 +
 +  /** SQL {@code TRIM} function. */
 +  private static String trim_(String s, boolean left, boolean right, char c) {
 +    int j = s.length();
 +    if (right) {
 +      for (;;) {
 +        if (j == 0) {
 +          return "";
 +        }
 +        if (s.charAt(j - 1) != c) {
 +          break;
 +        }
 +        --j;
 +      }
 +    }
 +    int i = 0;
 +    if (left) {
 +      for (;;) {
 +        if (i == j) {
 +          return "";
 +        }
 +        if (s.charAt(i) != c) {
 +          break;
 +        }
 +        ++i;
 +      }
 +    }
 +    return s.substring(i, j);
 +  }
 +
 +  /** SQL {@code TRIM} function applied to binary string. */
 +  public static ByteString trim(ByteString s) {
 +    return trim_(s, true, true);
 +  }
 +
 +  /** Helper for CAST. */
 +  public static ByteString rtrim(ByteString s) {
 +    return trim_(s, false, true);
 +  }
 +
 +  /** SQL {@code TRIM} function applied to binary string. */
 +  private static ByteString trim_(ByteString s, boolean left, boolean right) {
 +    int j = s.length();
 +    if (right) {
 +      for (;;) {
 +        if (j == 0) {
 +          return ByteString.EMPTY;
 +        }
 +        if (s.byteAt(j - 1) != 0) {
 +          break;
 +        }
 +        --j;
 +      }
 +    }
 +    int i = 0;
 +    if (left) {
 +      for (;;) {
 +        if (i == j) {
 +          return ByteString.EMPTY;
 +        }
 +        if (s.byteAt(i) != 0) {
 +          break;
 +        }
 +        ++i;
 +      }
 +    }
 +    return s.substring(i, j);
 +  }
 +
 +  /** SQL {@code OVERLAY} function. */
 +  public static String overlay(String s, String r, int start) {
 +    if (s == null || r == null) {
 +      return null;
 +    }
 +    return s.substring(0, start - 1)
 +        + r
 +        + s.substring(start - 1 + r.length());
 +  }
 +
 +  /** SQL {@code OVERLAY} function. */
 +  public static String overlay(String s, String r, int start, int length) {
 +    if (s == null || r == null) {
 +      return null;
 +    }
 +    return s.substring(0, start - 1)
 +        + r
 +        + s.substring(start - 1 + length);
 +  }
 +
 +  /** SQL {@code OVERLAY} function applied to binary strings. */
 +  public static ByteString overlay(ByteString s, ByteString r, int start) {
 +    if (s == null || r == null) {
 +      return null;
 +    }
 +    return s.substring(0, start - 1)
 +           .concat(r)
 +           .concat(s.substring(start - 1 + r.length()));
 +  }
 +
 +  /** SQL {@code OVERLAY} function applied to binary strings. */
 +  public static ByteString overlay(ByteString s, ByteString r, int start,
 +      int length) {
 +    if (s == null || r == null) {
 +      return null;
 +    }
 +    return s.substring(0, start - 1)
 +           .concat(r)
 +           .concat(s.substring(start - 1 + length));
 +  }
 +
 +  /** SQL {@code LIKE} function. */
 +  public static boolean like(String s, String pattern) {
 +    final String regex = Like.sqlToRegexLike(pattern, null);
 +    return Pattern.matches(regex, s);
 +  }
 +
 +  /** SQL {@code LIKE} function with escape. */
 +  public static boolean like(String s, String pattern, String escape) {
 +    final String regex = Like.sqlToRegexLike(pattern, escape);
 +    return Pattern.matches(regex, s);
 +  }
 +
 +  /** SQL {@code SIMILAR} function. */
 +  public static boolean similar(String s, String pattern) {
 +    final String regex = Like.sqlToRegexSimilar(pattern, null);
 +    return Pattern.matches(regex, s);
 +  }
 +
 +  /** SQL {@code SIMILAR} function with escape. */
 +  public static boolean similar(String s, String pattern, String escape) {
 +    final String regex = Like.sqlToRegexSimilar(pattern, escape);
 +    return Pattern.matches(regex, s);
 +  }
 +
 +  // =
 +
 +  /** SQL = operator applied to Object values (including String; neither
 +   * side may be null). */
 +  public static boolean eq(Object b0, Object b1) {
 +    return b0.equals(b1);
 +  }
 +
 +  /** SQL = operator applied to BigDecimal values (neither may be null). */
 +  public static boolean eq(BigDecimal b0, BigDecimal b1) {
 +    return b0.stripTrailingZeros().equals(b1.stripTrailingZeros());
 +  }
 +
 +  // <>
 +
 +  /** SQL &lt;&gt; operator applied to Object values (including String;
 +   * neither side may be null). */
 +  public static boolean ne(Object b0, Object b1) {
 +    return !b0.equals(b1);
 +  }
 +
 +  /** SQL &lt;&gt; operator applied to BigDecimal values. */
 +  public static boolean ne(BigDecimal b0, BigDecimal b1) {
 +    return b0.compareTo(b1) != 0;
 +  }
 +
 +  // <
 +
 +  /** SQL &lt; operator applied to boolean values. */
 +  public static boolean lt(boolean b0, boolean b1) {
 +    return compare(b0, b1) < 0;
 +  }
 +
 +  /** SQL &lt; operator applied to String values. */
 +  public static boolean lt(String b0, String b1) {
 +    return b0.compareTo(b1) < 0;
 +  }
 +
 +  /** SQL &lt; operator applied to ByteString values. */
 +  public static boolean lt(ByteString b0, ByteString b1) {
 +    return b0.compareTo(b1) < 0;
 +  }
 +
 +  /** SQL &lt; operator applied to BigDecimal values. */
 +  public static boolean lt(BigDecimal b0, BigDecimal b1) {
 +    return b0.compareTo(b1) < 0;
 +  }
 +
 +  // <=
 +
 +  /** SQL &le; operator applied to boolean values. */
 +  public static boolean le(boolean b0, boolean b1) {
 +    return compare(b0, b1) <= 0;
 +  }
 +
 +  /** SQL &le; operator applied to String values. */
 +  public static boolean le(String b0, String b1) {
 +    return b0.compareTo(b1) <= 0;
 +  }
 +
 +  /** SQL &le; operator applied to ByteString values. */
 +  public static boolean le(ByteString b0, ByteString b1) {
 +    return b0.compareTo(b1) <= 0;
 +  }
 +
 +  /** SQL &le; operator applied to BigDecimal values. */
 +  public static boolean le(BigDecimal b0, BigDecimal b1) {
 +    return b0.compareTo(b1) <= 0;
 +  }
 +
 +  // >
 +
 +  /** SQL &gt; operator applied to boolean values. */
 +  public static boolean gt(boolean b0, boolean b1) {
 +    return compare(b0, b1) > 0;
 +  }
 +
 +  /** SQL &gt; operator applied to String values. */
 +  public static boolean gt(String b0, String b1) {
 +    return b0.compareTo(b1) > 0;
 +  }
 +
 +  /** SQL &gt; operator applied to ByteString values. */
 +  public static boolean gt(ByteString b0, ByteString b1) {
 +    return b0.compareTo(b1) > 0;
 +  }
 +
 +  /** SQL &gt; operator applied to BigDecimal values. */
 +  public static boolean gt(BigDecimal b0, BigDecimal b1) {
 +    return b0.compareTo(b1) > 0;
 +  }
 +
 +  // >=
 +
 +  /** SQL &ge; operator applied to boolean values. */
 +  public static boolean ge(boolean b0, boolean b1) {
 +    return compare(b0, b1) >= 0;
 +  }
 +
 +  /** SQL &ge; operator applied to String values. */
 +  public static boolean ge(String b0, String b1) {
 +    return b0.compareTo(b1) >= 0;
 +  }
 +
 +  /** SQL &ge; operator applied to ByteString values. */
 +  public static boolean ge(ByteString b0, ByteString b1) {
 +    return b0.compareTo(b1) >= 0;
 +  }
 +
 +  /** SQL &ge; operator applied to BigDecimal values. */
 +  public static boolean ge(BigDecimal b0, BigDecimal b1) {
 +    return b0.compareTo(b1) >= 0;
 +  }
 +
 +  // +
 +
 +  /** SQL <code>+</code> operator applied to int values. */
 +  public static int plus(int b0, int b1) {
 +    return b0 + b1;
 +  }
 +
 +  /** SQL <code>+</code> operator applied to int values; left side may be
 +   * null. */
 +  public static Integer plus(Integer b0, int b1) {
 +    return b0 == null ? null : (b0 + b1);
 +  }
 +
 +  /** SQL <code>+</code> operator applied to int values; right side may be
 +   * null. */
 +  public static Integer plus(int b0, Integer b1) {
 +    return b1 == null ? null : (b0 + b1);
 +  }
 +
 +  /** SQL <code>+</code> operator applied to nullable int values. */
 +  public static Integer plus(Integer b0, Integer b1) {
 +    return (b0 == null || b1 == null) ? null : (b0 + b1);
 +  }
 +
 +  /** SQL <code>+</code> operator applied to nullable long and int values. */
 +  public static Long plus(Long b0, Integer b1) {
 +    return (b0 == null || b1 == null)
 +        ? null
 +        : (b0.longValue() + b1.longValue());
 +  }
 +
 +  /** SQL <code>+</code> operator applied to nullable int and long values. */
 +  public static Long plus(Integer b0, Long b1) {
 +    return (b0 == null || b1 == null)
 +        ? null
 +        : (b0.longValue() + b1.longValue());
 +  }
 +
 +  /** SQL <code>+</code> operator applied to BigDecimal values. */
 +  public static BigDecimal plus(BigDecimal b0, BigDecimal b1) {
 +    return (b0 == null || b1 == null) ? null : b0.add(b1);
 +  }
 +
 +  // -
 +
 +  /** SQL <code>-</code> operator applied to int values. */
 +  public static int minus(int b0, int b1) {
 +    return b0 - b1;
 +  }
 +
 +  /** SQL <code>-</code> operator applied to int values; left side may be
 +   * null. */
 +  public static Integer minus(Integer b0, int b1) {
 +    return b0 == null ? null : (b0 - b1);
 +  }
 +
 +  /** SQL <code>-</code> operator applied to int values; right side may be
 +   * null. */
 +  public static Integer minus(int b0, Integer b1) {
 +    return b1 == null ? null : (b0 - b1);
 +  }
 +
 +  /** SQL <code>-</code> operator applied to nullable int values. */
 +  public static Integer minus(Integer b0, Integer b1) {
 +    return (b0 == null || b1 == null) ? null : (b0 - b1);
 +  }
 +
 +  /** SQL <code>-</code> operator applied to nullable long and int values. */
 +  public static Long minus(Long b0, Integer b1) {
 +    return (b0 == null || b1 == null)
 +        ? null
 +        : (b0.longValue() - b1.longValue());
 +  }
 +
 +  /** SQL <code>-</code> operator applied to nullable int and long values. */
 +  public static Long minus(Integer b0, Long b1) {
 +    return (b0 == null || b1 == null)
 +        ? null
 +        : (b0.longValue() - b1.longValue());
 +  }
 +
 +  /** SQL <code>-</code> operator applied to BigDecimal values. */
 +  public static BigDecimal minus(BigDecimal b0, BigDecimal b1) {
 +    return (b0 == null || b1 == null) ? null : b0.subtract(b1);
 +  }
 +
 +  // /
 +
 +  /** SQL <code>/</code> operator applied to int values. */
 +  public static int divide(int b0, int b1) {
 +    return b0 / b1;
 +  }
 +
 +  /** SQL <code>/</code> operator applied to int values; left side may be
 +   * null. */
 +  public static Integer divide(Integer b0, int b1) {
 +    return b0 == null ? null : (b0 / b1);
 +  }
 +
 +  /** SQL <code>/</code> operator applied to int values; right side may be
 +   * null. */
 +  public static Integer divide(int b0, Integer b1) {
 +    return b1 == null ? null : (b0 / b1);
 +  }
 +
 +  /** SQL <code>/</code> operator applied to nullable int values. */
 +  public static Integer divide(Integer b0, Integer b1) {
 +    return (b0 == null || b1 == null) ? null : (b0 / b1);
 +  }
 +
 +  /** SQL <code>/</code> operator applied to nullable long and int values. */
 +  public static Long divide(Long b0, Integer b1) {
 +    return (b0 == null || b1 == null)
 +        ? null
 +        : (b0.longValue() / b1.longValue());
 +  }
 +
 +  /** SQL <code>/</code> operator applied to nullable int and long values. */
 +  public static Long divide(Integer b0, Long b1) {
 +    return (b0 == null || b1 == null)
 +        ? null
 +        : (b0.longValue() / b1.longValue());
 +  }
 +
 +  /** SQL <code>/</code> operator applied to BigDecimal values. */
 +  public static BigDecimal divide(BigDecimal b0, BigDecimal b1) {
 +    return (b0 == null || b1 == null) ? null : b0.divide(b1, MathContext.DECIMAL64);
 +  }
 +
 +  // *
 +
 +  /** SQL <code>*</code> operator applied to int values. */
 +  public static int multiply(int b0, int b1) {
 +    return b0 * b1;
 +  }
 +
 +  /** SQL <code>*</code> operator applied to int values; left side may be
 +   * null. */
 +  public static Integer multiply(Integer b0, int b1) {
 +    return b0 == null ? null : (b0 * b1);
 +  }
 +
 +  /** SQL <code>*</code> operator applied to int values; right side may be
 +   * null. */
 +  public static Integer multiply(int b0, Integer b1) {
 +    return b1 == null ? null : (b0 * b1);
 +  }
 +
 +  /** SQL <code>*</code> operator applied to nullable int values. */
 +  public static Integer multiply(Integer b0, Integer b1) {
 +    return (b0 == null || b1 == null) ? null : (b0 * b1);
 +  }
 +
 +  /** SQL <code>*</code> operator applied to nullable long and int values. */
 +  public static Long multiply(Long b0, Integer b1) {
 +    return (b0 == null || b1 == null)
 +        ? null
 +        : (b0.longValue() * b1.longValue());
 +  }
 +
 +  /** SQL <code>*</code> operator applied to nullable int and long values. */
 +  public static Long multiply(Integer b0, Long b1) {
 +    return (b0 == null || b1 == null)
 +        ? null
 +        : (b0.longValue() * b1.longValue());
 +  }
 +
 +  /** SQL <code>*</code> operator applied to BigDecimal values. */
 +  public static BigDecimal multiply(BigDecimal b0, BigDecimal b1) {
 +    return (b0 == null || b1 == null) ? null : b0.multiply(b1);
 +  }
 +
 +  // EXP
 +
 +  /** SQL <code>EXP</code> operator applied to double values. */
 +  public static double exp(double b0) {
 +    return Math.exp(b0);
 +  }
 +
 +  public static double exp(long b0) {
 +    return Math.exp(b0);
 +  }
 +
 +  // POWER
 +
 +  /** SQL <code>POWER</code> operator applied to double values. */
 +  public static double power(double b0, double b1) {
 +    return Math.pow(b0, b1);
 +  }
 +
 +  public static double power(long b0, long b1) {
 +    return Math.pow(b0, b1);
 +  }
 +
 +  public static double power(long b0, BigDecimal b1) {
 +    return Math.pow(b0, b1.doubleValue());
 +  }
 +
 +  // LN
 +
 +  /** SQL {@code LN(number)} function applied to double values. */
 +  public static double ln(double d) {
 +    return Math.log(d);
 +  }
 +
 +  /** SQL {@code LN(number)} function applied to long values. */
 +  public static double ln(long b0) {
 +    return Math.log(b0);
 +  }
 +
 +  /** SQL {@code LN(number)} function applied to BigDecimal values. */
 +  public static double ln(BigDecimal d) {
 +    return Math.log(d.doubleValue());
 +  }
 +
 +  // LOG10
 +
 +  /** SQL <code>LOG10(numeric)</code> operator applied to double values. */
 +  public static double log10(double b0) {
 +    return Math.log10(b0);
 +  }
 +
 +  /** SQL {@code LOG10(number)} function applied to long values. */
 +  public static double log10(long b0) {
 +    return Math.log10(b0);
 +  }
 +
 +  /** SQL {@code LOG10(number)} function applied to BigDecimal values. */
 +  public static double log10(BigDecimal d) {
 +    return Math.log10(d.doubleValue());
 +  }
 +
 +  // MOD
 +
 +  /** SQL <code>MOD</code> operator applied to byte values. */
 +  public static byte mod(byte b0, byte b1) {
 +    return (byte) (b0 % b1);
 +  }
 +
 +  /** SQL <code>MOD</code> operator applied to short values. */
 +  public static short mod(short b0, short b1) {
 +    return (short) (b0 % b1);
 +  }
 +
 +  /** SQL <code>MOD</code> operator applied to int values. */
 +  public static int mod(int b0, int b1) {
 +    return b0 % b1;
 +  }
 +
 +  /** SQL <code>MOD</code> operator applied to long values. */
 +  public static long mod(long b0, long b1) {
 +    return b0 % b1;
 +  }
 +
 +  // temporary
 +  public static BigDecimal mod(BigDecimal b0, int b1) {
 +    return mod(b0, BigDecimal.valueOf(b1));
 +  }
 +
 +  // temporary
 +  public static int mod(int b0, BigDecimal b1) {
 +    return mod(b0, b1.intValue());
 +  }
 +
 +  public static BigDecimal mod(BigDecimal b0, BigDecimal b1) {
 +    final BigDecimal[] bigDecimals = b0.divideAndRemainder(b1);
 +    return bigDecimals[1];
 +  }
 +
 +  // FLOOR
 +
 +  public static double floor(double b0) {
 +    return Math.floor(b0);
 +  }
 +
 +  public static float floor(float b0) {
 +    return (float) Math.floor(b0);
 +  }
 +
 +  public static BigDecimal floor(BigDecimal b0) {
 +    return b0.setScale(0, BigDecimal.ROUND_FLOOR);
 +  }
 +
 +  /** SQL <code>FLOOR</code> operator applied to byte values. */
 +  public static byte floor(byte b0, byte b1) {
 +    return (byte) floor((int) b0, (int) b1);
 +  }
 +
 +  /** SQL <code>FLOOR</code> operator applied to short values. */
 +  public static short floor(short b0, short b1) {
 +    return (short) floor((int) b0, (int) b1);
 +  }
 +
 +  /** SQL <code>FLOOR</code> operator applied to int values. */
 +  public static int floor(int b0, int b1) {
 +    int r = b0 % b1;
 +    if (r < 0) {
 +      r += b1;
 +    }
 +    return b0 - r;
 +  }
 +
 +  /** SQL <code>FLOOR</code> operator applied to long values. */
 +  public static long floor(long b0, long b1) {
 +    long r = b0 % b1;
 +    if (r < 0) {
 +      r += b1;
 +    }
 +    return b0 - r;
 +  }
 +
 +  // temporary
 +  public static BigDecimal floor(BigDecimal b0, int b1) {
 +    return floor(b0, BigDecimal.valueOf(b1));
 +  }
 +
 +  // temporary
 +  public static int floor(int b0, BigDecimal b1) {
 +    return floor(b0, b1.intValue());
 +  }
 +
 +  public static BigDecimal floor(BigDecimal b0, BigDecimal b1) {
 +    final BigDecimal[] bigDecimals = b0.divideAndRemainder(b1);
 +    BigDecimal r = bigDecimals[1];
 +    if (r.signum() < 0) {
 +      r = r.add(b1);
 +    }
 +    return b0.subtract(r);
 +  }
 +
 +  // CEIL
 +
 +  public static double ceil(double b0) {
 +    return Math.ceil(b0);
 +  }
 +
 +  public static float ceil(float b0) {
 +    return (float) Math.ceil(b0);
 +  }
 +
 +  public static BigDecimal ceil(BigDecimal b0) {
 +    return b0.setScale(0, BigDecimal.ROUND_CEILING);
 +  }
 +
 +  /** SQL <code>CEIL</code> operator applied to byte values. */
 +  public static byte ceil(byte b0, byte b1) {
 +    return floor((byte) (b0 + b1 - 1), b1);
 +  }
 +
 +  /** SQL <code>CEIL</code> operator applied to short values. */
 +  public static short ceil(short b0, short b1) {
 +    return floor((short) (b0 + b1 - 1), b1);
 +  }
 +
 +  /** SQL <code>CEIL</code> operator applied to int values. */
 +  public static int ceil(int b0, int b1) {
 +    int r = b0 % b1;
 +    if (r > 0) {
 +      r -= b1;
 +    }
 +    return b0 - r;
 +  }
 +
 +  /** SQL <code>CEIL</code> operator applied to long values. */
 +  public static long ceil(long b0, long b1) {
 +    return floor(b0 + b1 - 1, b1);
 +  }
 +
 +  // temporary
 +  public static BigDecimal ceil(BigDecimal b0, int b1) {
 +    return ceil(b0, BigDecimal.valueOf(b1));
 +  }
 +
 +  // temporary
 +  public static int ceil(int b0, BigDecimal b1) {
 +    return ceil(b0, b1.intValue());
 +  }
 +
 +  public static BigDecimal ceil(BigDecimal b0, BigDecimal b1) {
 +    final BigDecimal[] bigDecimals = b0.divideAndRemainder(b1);
 +    BigDecimal r = bigDecimals[1];
 +    if (r.signum() > 0) {
 +      r = r.subtract(b1);
 +    }
 +    return b0.subtract(r);
 +  }
 +
 +  // ABS
 +
 +  /** SQL <code>ABS</code> operator applied to byte values. */
 +  public static byte abs(byte b0) {
 +    return (byte) Math.abs(b0);
 +  }
 +
 +  /** SQL <code>ABS</code> operator applied to short values. */
 +  public static short abs(short b0) {
 +    return (short) Math.abs(b0);
 +  }
 +
 +  /** SQL <code>ABS</code> operator applied to int values. */
 +  public static int abs(int b0) {
 +    return Math.abs(b0);
 +  }
 +
 +  /** SQL <code>ABS</code> operator applied to long values. */
 +  public static long abs(long b0) {
 +    return Math.abs(b0);
 +  }
 +
 +  /** SQL <code>ABS</code> operator applied to float values. */
 +  public static float abs(float b0) {
 +    return Math.abs(b0);
 +  }
 +
 +  /** SQL <code>ABS</code> operator applied to double values. */
 +  public static double abs(double b0) {
 +    return Math.abs(b0);
 +  }
 +
 +  /** SQL <code>ABS</code> operator applied to BigDecimal values. */
 +  public static BigDecimal abs(BigDecimal b0) {
 +    return b0.abs();
 +  }
 +
 +  // Helpers
 +
 +  /** Helper for implementing MIN. Somewhat similar to LEAST operator. */
 +  public static <T extends Comparable<T>> T lesser(T b0, T b1) {
 +    return b0 == null || b0.compareTo(b1) > 0 ? b1 : b0;
 +  }
 +
 +  /** LEAST operator. */
 +  public static <T extends Comparable<T>> T least(T b0, T b1) {
 +    return b0 == null || b1 != null && b0.compareTo(b1) > 0 ? b1 : b0;
 +  }
 +
 +  public static boolean greater(boolean b0, boolean b1) {
 +    return b0 || b1;
 +  }
 +
 +  public static boolean lesser(boolean b0, boolean b1) {
 +    return b0 && b1;
 +  }
 +
 +  public static byte greater(byte b0, byte b1) {
 +    return b0 > b1 ? b0 : b1;
 +  }
 +
 +  public static byte lesser(byte b0, byte b1) {
 +    return b0 > b1 ? b1 : b0;
 +  }
 +
 +  public static char greater(char b0, char b1) {
 +    return b0 > b1 ? b0 : b1;
 +  }
 +
 +  public static char lesser(char b0, char b1) {
 +    return b0 > b1 ? b1 : b0;
 +  }
 +
 +  public static short greater(short b0, short b1) {
 +    return b0 > b1 ? b0 : b1;
 +  }
 +
 +  public static short lesser(short b0, short b1) {
 +    return b0 > b1 ? b1 : b0;
 +  }
 +
 +  public static int greater(int b0, int b1) {
 +    return b0 > b1 ? b0 : b1;
 +  }
 +
 +  public static int lesser(int b0, int b1) {
 +    return b0 > b1 ? b1 : b0;
 +  }
 +
 +  public static long greater(long b0, long b1) {
 +    return b0 > b1 ? b0 : b1;
 +  }
 +
 +  public static long lesser(long b0, long b1) {
 +    return b0 > b1 ? b1 : b0;
 +  }
 +
 +  public static float greater(float b0, float b1) {
 +    return b0 > b1 ? b0 : b1;
 +  }
 +
 +  public static float lesser(float b0, float b1) {
 +    return b0 > b1 ? b1 : b0;
 +  }
 +
 +  public static double greater(double b0, double b1) {
 +    return b0 > b1 ? b0 : b1;
 +  }
 +
 +  public static double lesser(double b0, double b1) {
 +    return b0 > b1 ? b1 : b0;
 +  }
 +
 +  /** Helper for implementing MAX. Somewhat similar to GREATEST operator. */
 +  public static <T extends Comparable<T>> T greater(T b0, T b1) {
 +    return b0 == null || b0.compareTo(b1) < 0 ? b1 : b0;
 +  }
 +
 +  /** GREATEST operator. */
 +  public static <T extends Comparable<T>> T greatest(T b0, T b1) {
 +    return b0 == null || b1 != null && b0.compareTo(b1) < 0 ? b1 : b0;
 +  }
 +
 +  /** Boolean comparison. */
 +  public static int compare(boolean x, boolean y) {
 +    return x == y ? 0 : x ? 1 : -1;
 +  }
 +
 +  /** CAST(FLOAT AS VARCHAR). */
 +  public static String toString(float x) {
 +    if (x == 0) {
 +      return "0E0";
 +    }
 +    BigDecimal bigDecimal =
 +        new BigDecimal(x, MathContext.DECIMAL32).stripTrailingZeros();
 +    final String s = bigDecimal.toString();
 +    return s.replaceAll("0*E", "E").replace("E+", "E");
 +  }
 +
 +  /** CAST(DOUBLE AS VARCHAR). */
 +  public static String toString(double x) {
 +    if (x == 0) {
 +      return "0E0";
 +    }
 +    BigDecimal bigDecimal =
 +        new BigDecimal(x, MathContext.DECIMAL64).stripTrailingZeros();
 +    final String s = bigDecimal.toString();
 +    return s.replaceAll("0*E", "E").replace("E+", "E");
 +  }
 +
 +  /** CAST(DECIMAL AS VARCHAR). */
 +  public static String toString(BigDecimal x) {
 +    final String s = x.toString();
 +    if (s.startsWith("0")) {
 +      // we want ".1" not "0.1"
 +      return s.substring(1);
 +    } else if (s.startsWith("-0")) {
 +      // we want "-.1" not "-0.1"
 +      return "-" + s.substring(2);
 +    } else {
 +      return s;
 +    }
 +  }
 +
 +  /** CAST(BOOLEAN AS VARCHAR). */
 +  public static String toString(boolean x) {
 +    // Boolean.toString returns lower case -- no good.
 +    return x ? "TRUE" : "FALSE";
 +  }
 +
 +  @NonDeterministic
 +  private static Object cannotConvert(Object o, Class toType) {
 +    throw new RuntimeException("Cannot convert " + o + " to " + toType);
 +  }
 +
 +  /** CAST(VARCHAR AS BOOLEAN). */
 +  public static boolean toBoolean(String s) {
 +    s = trim_(s, true, true, ' ');
 +    if (s.equalsIgnoreCase("TRUE")) {
 +      return true;
 +    } else if (s.equalsIgnoreCase("FALSE")) {
 +      return false;
 +    } else {
 +      throw new RuntimeException("Invalid character for cast");
 +    }
 +  }
 +
 +  public static boolean toBoolean(Number number) {
 +    return !number.equals(0);
 +  }
 +
 +  public static boolean toBoolean(Object o) {
 +    return o instanceof Boolean ? (Boolean) o
 +        : o instanceof Number ? toBoolean((Number) o)
 +        : o instanceof String ? toBoolean((String) o)
 +        : (Boolean) cannotConvert(o, boolean.class);
 +  }
 +
 +  // Don't need parseByte etc. - Byte.parseByte is sufficient.
 +
 +  public static byte toByte(Object o) {
 +    return o instanceof Byte ? (Byte) o
 +        : o instanceof Number ? toByte((Number) o)
 +        : Byte.parseByte(o.toString());
 +  }
 +
 +  public static byte toByte(Number number) {
 +    return number.byteValue();
 +  }
 +
 +  public static char toChar(String s) {
 +    return s.charAt(0);
 +  }
 +
 +  public static Character toCharBoxed(String s) {
 +    return s.charAt(0);
 +  }
 +
 +  public static short toShort(String s) {
 +    return Short.parseShort(s.trim());
 +  }
 +
 +  public static short toShort(Number number) {
 +    return number.shortValue();
 +  }
 +
 +  public static short toShort(Object o) {
 +    return o instanceof Short ? (Short) o
 +        : o instanceof Number ? toShort((Number) o)
 +        : o instanceof String ? toShort((String) o)
 +        : (Short) cannotConvert(o, short.class);
 +  }
 +
 +  public static int toInt(java.util.Date v) {
 +    return toInt(v, LOCAL_TZ);
 +  }
 +
 +  public static int toInt(java.util.Date v, TimeZone timeZone) {
 +    return (int) (toLong(v, timeZone)  / DateTimeUtils.MILLIS_PER_DAY);
 +  }
 +
 +  public static Integer toIntOptional(java.util.Date v) {
 +    return v == null ? null : toInt(v);
 +  }
 +
 +  public static Integer toIntOptional(java.util.Date v, TimeZone timeZone) {
 +    return v == null
 +        ? null
 +        : toInt(v, timeZone);
 +  }
 +
 +  public static long toLong(Date v) {
 +    return toLong(v, LOCAL_TZ);
 +  }
 +
 +  public static int toInt(java.sql.Time v) {
 +    return (int) (toLong(v) % DateTimeUtils.MILLIS_PER_DAY);
 +  }
 +
 +  public static Integer toIntOptional(java.sql.Time v) {
 +    return v == null ? null : toInt(v);
 +  }
 +
 +  public static int toInt(String s) {
 +    return Integer.parseInt(s.trim());
 +  }
 +
 +  public static int toInt(Number number) {
 +    return number.intValue();
 +  }
 +
 +  public static int toInt(Object o) {
 +    return o instanceof Integer ? (Integer) o
 +        : o instanceof Number ? toInt((Number) o)
 +        : o instanceof String ? toInt((String) o)
 +        : (Integer) cannotConvert(o, int.class);
 +  }
 +
 +  public static long toLong(Timestamp v) {
 +    return toLong(v, LOCAL_TZ);
 +  }
 +
 +  // mainly intended for java.sql.Timestamp but works for other dates also
 +  public static long toLong(java.util.Date v, TimeZone timeZone) {
 +    final long time = v.getTime();
 +    return time + timeZone.getOffset(time);
 +  }
 +
 +  // mainly intended for java.sql.Timestamp but works for other dates also
 +  public static Long toLongOptional(java.util.Date v) {
 +    return v == null ? null : toLong(v, LOCAL_TZ);
 +  }
 +
 +  public static Long toLongOptional(Timestamp v, TimeZone timeZone) {
 +    if (v == null) {
 +      return null;
 +    }
 +    return toLong(v, LOCAL_TZ);
 +  }
 +
 +  public static long toLong(String s) {
 +    if (s.startsWith("199") && s.contains(":")) {
 +      return Timestamp.valueOf(s).getTime();
 +    }
 +    return Long.parseLong(s.trim());
 +  }
 +
 +  public static long toLong(Number number) {
 +    return number.longValue();
 +  }
 +
 +  public static long toLong(Object o) {
 +    return o instanceof Long ? (Long) o
 +        : o instanceof Number ? toLong((Number) o)
 +        : o instanceof String ? toLong((String) o)
 +        : (Long) cannotConvert(o, long.class);
 +  }
 +
 +  public static float toFloat(String s) {
 +    return Float.parseFloat(s.trim());
 +  }
 +
 +  public static float toFloat(Number number) {
 +    return number.floatValue();
 +  }
 +
 +  public static float toFloat(Object o) {
 +    return o instanceof Float ? (Float) o
 +        : o instanceof Number ? toFloat((Number) o)
 +            : o instanceof String ? toFloat((String) o)
 +                : (Float) cannotConvert(o, float.class);
 +  }
 +
 +  public static double toDouble(String s) {
 +    return Double.parseDouble(s.trim());
 +  }
 +
 +  public static double toDouble(Number number) {
 +    return number.doubleValue();
 +  }
 +
 +  public static double toDouble(Object o) {
 +    return o instanceof Double ? (Double) o
 +        : o instanceof Number ? toDouble((Number) o)
 +        : o instanceof String ? toDouble((String) o)
 +        : (Double) cannotConvert(o, double.class);
 +  }
 +
 +  public static BigDecimal toBigDecimal(String s) {
 +    return new BigDecimal(s.trim());
 +  }
 +
 +  public static BigDecimal toBigDecimal(Number number) {
 +    // There are some values of "long" that cannot be represented as "double".
 +    // Not so "int". If it isn't a long, go straight to double.
 +    return number instanceof BigDecimal ? (BigDecimal) number
 +        : number instanceof BigInteger ? new BigDecimal((BigInteger) number)
 +        : number instanceof Long ? new BigDecimal(number.longValue())
 +        : new BigDecimal(number.doubleValue());
 +  }
 +
 +  public static BigDecimal toBigDecimal(Object o) {
 +    return o instanceof Number ? toBigDecimal((Number) o)
 +        : toBigDecimal(o.toString());
 +  }
 +
 +  // Don't need shortValueOf etc. - Short.valueOf is sufficient.
 +
 +  /** Helper for CAST(... AS VARCHAR(maxLength)). */
 +  public static String truncate(String s, int maxLength) {
 +    return s == null ? null
 +        : s.length() > maxLength ? s.substring(0, maxLength)
 +        : s;
 +  }
 +
 +  /** Helper for CAST(... AS VARBINARY(maxLength)). */
 +  public static ByteString truncate(ByteString s, int maxLength) {
 +    return s == null ? null
 +        : s.length() > maxLength ? s.substring(0, maxLength)
 +        : s;
 +  }
 +
 +  /** SQL {@code POSITION(seek IN string)} function. */
 +  public static int position(String seek, String s) {
 +    return s.indexOf(seek) + 1;
 +  }
 +
 +  /** SQL {@code POSITION(seek IN string)} function. */
 +  public static int position(ByteString seek, ByteString s) {
 +    return s.indexOf(seek) + 1;
 +  }
 +
 +  /** Helper for rounding. Truncate(12345, 1000) returns 12000. */
 +  public static long round(long v, long x) {
 +    return truncate(v + x / 2, x);
 +  }
 +
 +  /** Helper for rounding. Truncate(12345, 1000) returns 12000. */
 +  public static long truncate(long v, long x) {
 +    long remainder = v % x;
 +    if (remainder < 0) {
 +      remainder += x;
 +    }
 +    return v - remainder;
 +  }
 +
 +  /** Helper for rounding. Truncate(12345, 1000) returns 12000. */
 +  public static int round(int v, int x) {
 +    return truncate(v + x / 2, x);
 +  }
 +
 +  /** Helper for rounding. Truncate(12345, 1000) returns 12000. */
 +  public static int truncate(int v, int x) {
 +    int remainder = v % x;
 +    if (remainder < 0) {
 +      remainder += x;
 +    }
 +    return v - remainder;
 +  }
 +
 +  /** SQL {@code CURRENT_TIMESTAMP} function. */
 +  @NonDeterministic
 +  public static long currentTimestamp(DataContext root) {
 +    // Cast required for JDK 1.6.
 +    return (Long) DataContext.Variable.CURRENT_TIMESTAMP.get(root);
 +  }
 +
 +  /** SQL {@code CURRENT_TIME} function. */
 +  @NonDeterministic
 +  public static int currentTime(DataContext root) {
 +    int time = (int) (currentTimestamp(root) % DateTimeUtils.MILLIS_PER_DAY);
 +    if (time < 0) {
 +      time += DateTimeUtils.MILLIS_PER_DAY;
 +    }
 +    return time;
 +  }
 +
 +  /** SQL {@code CURRENT_DATE} function. */
 +  @NonDeterministic
 +  public static int currentDate(DataContext root) {
 +    final long timestamp = currentTimestamp(root);
 +    int date = (int) (timestamp / DateTimeUtils.MILLIS_PER_DAY);
 +    final int time = (int) (timestamp % DateTimeUtils.MILLIS_PER_DAY);
 +    if (time < 0) {
 +      --date;
 +    }
 +    return date;
 +  }
 +
 +  /** SQL {@code LOCAL_TIMESTAMP} function. */
 +  @NonDeterministic
 +  public static long localTimestamp(DataContext root) {
 +    // Cast required for JDK 1.6.
 +    return (Long) DataContext.Variable.LOCAL_TIMESTAMP.get(root);
 +  }
 +
 +  /** SQL {@code LOCAL_TIME} function. */
 +  @NonDeterministic
 +  public static int localTime(DataContext root) {
 +    return (int) (localTimestamp(root) % DateTimeUtils.MILLIS_PER_DAY);
 +  }
 +
 +  /** Helper for "array element reference". Caller has already ensured that
 +   * array and index are not null. Index is 1-based, per SQL. */
 +  public static Object arrayItem(List list, int item) {
 +    if (item < 1 || item > list.size()) {
 +      return null;
 +    }
 +    return list.get(item - 1);
 +  }
 +
 +  /** Helper for "map element reference". Caller has already ensured that
 +   * array and index are not null. Index is 1-based, per SQL. */
 +  public static Object mapItem(Map map, Object item) {
 +    return map.get(item);
 +  }
 +
 +  /** Implements the {@code [ ... ]} operator on an object whose type is not
 +   * known until runtime.
 +   */
 +  public static Object item(Object object, Object index) {
 +    if (object instanceof Map) {
 +      return ((Map) object).get(index);
 +    }
 +    if (object instanceof List && index instanceof Number) {
 +      List list = (List) object;
 +      return list.get(((Number) index).intValue());
 +    }
 +    return null;
 +  }
 +
 +  /** NULL &rarr; FALSE, FALSE &rarr; FALSE, TRUE &rarr; TRUE. */
 +  public static boolean isTrue(Boolean b) {
 +    return b != null && b;
 +  }
 +
 +  /** NULL &rarr; TRUE, FALSE &rarr; FALSE, TRUE &rarr; TRUE. */
 +  public static boolean isNotFalse(Boolean b) {
 +    return b == null || b;
 +  }
 +
 +  /** NULL &rarr; NULL, FALSE &rarr; TRUE, TRUE &rarr; FALSE. */
 +  public static Boolean not(Boolean b) {
 +    return (b == null) ? null : !b;
 +  }
 +
 +  /** Converts a JDBC array to a list. */
 +  public static List arrayToList(final java.sql.Array a) {
 +    if (a == null) {
 +      return null;
 +    }
 +    try {
 +      return Primitive.asList(a.getArray());
 +    } catch (SQLException e) {
 +      throw new RuntimeException(e);
 +    }
 +  }
 +
 +  /** Support the {@code CURRENT VALUE OF sequence} operator. */
 +  @NonDeterministic
 +  public static long sequenceCurrentValue(String key) {
 +    return getAtomicLong(key).get();
 +  }
 +
 +  /** Support the {@code NEXT VALUE OF sequence} operator. */
 +  @NonDeterministic
 +  public static long sequenceNextValue(String key) {
 +    return getAtomicLong(key).incrementAndGet();
 +  }
 +
 +  private static AtomicLong getAtomicLong(String key) {
 +    final Map<String, AtomicLong> map = THREAD_SEQUENCES.get();
 +    AtomicLong atomic = map.get(key);
 +    if (atomic == null) {
 +      atomic = new AtomicLong();
 +      map.put(key, atomic);
 +    }
 +    return atomic;
 +  }
 +
 +  /** Support the SLICE function. */
 +  public static List slice(List list) {
 +    return list;
 +  }
 +
 +  /** Support the ELEMENT function. */
 +  public static Object element(List list) {
 +    switch (list.size()) {
 +    case 0:
 +      return null;
 +    case 1:
 +      return list.get(0);
 +    default:
 +      throw new RuntimeException("more than one value");
 +    }
 +  }
 +
 +  /** Returns a lambda that converts a list to an enumerable. */
 +  public static <E> Function1<List<E>, Enumerable<E>> listToEnumerable() {
 +    //noinspection unchecked
 +    return (Function1<List<E>, Enumerable<E>>) (Function1) LIST_AS_ENUMERABLE;
 +  }
 +
 +}
 +
 +// End SqlFunctions.java



[11/19] incubator-kylin git commit: KYLIN-884 restructure docs and website

Posted by lu...@apache.org.
KYLIN-884 restructure docs and website


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/9f64637f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/9f64637f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/9f64637f

Branch: refs/heads/0.7-staging
Commit: 9f64637fa975dfa3ff42cbf388b58b9ee97fee1e
Parents: 9392f50
Author: Luke Han <lu...@apache.org>
Authored: Fri Jul 10 14:35:18 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Fri Jul 10 14:35:18 2015 +0800

----------------------------------------------------------------------
 README.md                     | 76 +++++++-------------------------------
 docs/website/_config-prod.yml | 20 ----------
 2 files changed, 13 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9f64637f/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 9131162..73313f5 100644
--- a/README.md
+++ b/README.md
@@ -1,76 +1,26 @@
-Kylin OLAP
-===========
+Apache Kylin
+============
 
-
-What is Kylin
-------------
 > Extreme OLAP Engine for Big Data
 
-An open source distributed Analytical Engine from eBay to provide SQL interface and multi-dimensional analysis (OLAP) on Hadoop to support TB to PB size analysis.
-
-This [slice](docs/Apache Kylin 2014 Dec.pdf) might help you better understand what kylin is and how it works.
-
-
-Tutorial 
-------------
-
-Please follow this installation tutorial to start with Kylin: [Installation Tutorial](docs/Installation/Installation.md)
-
-
-Advanced Topics
--------
-####Connectivity
-1.[How to use kylin remote jdbc driver](docs/Tutorial/How to use kylin remote jdbc driver.md)
-
-2.[Kylin ODBC Driver Tutorial](docs/Tutorial/Kylin ODBC Driver Tutorial.md) 
-
-3.[SQL Reference](https://github.com/apache/incubator-calcite/blob/master/doc/reference.md)
-
-####REST
-
-1.[Kylin Restful API List](docs/REST/Kylin Restful API List.md)
-
-2.[Build Cube with Restful API](docs/REST/Build Cube with Restful API.md)
-
-3.[How to consume Kylin REST API in javascript](docs/REST/How to consume Kylin REST API in javascript.md)
+Apache Kylin is an open source Distributed Analytics Engine, contributed by eBay Inc., provides SQL interface and multi-dimensional analysis (OLAP) on Hadoop supporting extremely large datasets.
 
-####Operations
-1.[Kylin Metadata Store](docs/Operations/Kylin Metadata Store.md)
+For more details, see the website [http://kylin.incubator.apache.org](http://kylin.incubator.apache.org).
 
-2.[Export Kylin HBase data](docs/Operations/Export Kylin HBase data.md)
-
-3.[Advanced settings of Kylin environment](docs/Operations/Advanced settings of Kylin environment.md)
-
-####Test
-
-1.[Run Kylin test case with HBase Mini Cluster](docs/Test/Run Kylin test case with HBase Mini Cluster.md)
-
-
-####Technial Details
-
-1.[New meta data model structure](docs/TechInside/New meta data model structure.md)
-
-2.[Job Engine Design](docs/JobEngine/Design.md)
+Documentation
+=============
+Please refer to [http://kylin.incubator.apache.org/docs/](http://kylin.incubator.apache.org/docs/).
 
 Get Help
-------------
-
-The fastest way to get response from our developers is to send email to our mail list <de...@kylin.incubator.apache.org>, and remember to subscribe our mail list via <de...@kylin.incubator.apache.org>
-
-
-Resources
-------------
-
-* [FAQ](docs/MISC/FAQ on Kylin Installation and Usage.md)
-
-* Web Site: <http://kylin.incubator.apache.org/>
+============
+The fastest way to get response from our developers is to send email to our mail list <de...@kylin.incubator.apache.org>,   
+and remember to subscribe our mail list via <de...@kylin.incubator.apache.org>
 
-* Developer Mail: <de...@kylin.incubator.apache.org>
+Licnese
+============
+Please refer to [LICENSE](https://github.com/apache/incubator-kylin/blob/master/LICENSE) file.
 
-* How To Contribute: See [this](docs/MISC/How to Contribute.md)
 
-* Apache Proposal: [Apache Kylin](https://wiki.apache.org/incubator/KylinProposal)
 
-* [Kylin Document Conventions](docs/MISC/Kylin Document Conventions.md)
 
 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9f64637f/docs/website/_config-prod.yml
----------------------------------------------------------------------
diff --git a/docs/website/_config-prod.yml b/docs/website/_config-prod.yml
deleted file mode 100644
index 83a3dd1..0000000
--- a/docs/website/_config-prod.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# kylin.apache.org
-baseurl: ""
-noindex: 0 # Make sure this gets indexed by Google
\ No newline at end of file


[15/19] incubator-kylin git commit: Fix license issue with 0.7.2 release

Posted by lu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4b0ee63c/atopcalcite/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
----------------------------------------------------------------------
diff --cc atopcalcite/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
index c643f94,0000000..89eb3b1
mode 100644,000000..100644
--- a/atopcalcite/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
+++ b/atopcalcite/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
@@@ -1,5032 -1,0 +1,4923 @@@
 +/*
-  * OVERRIDE POINT:
-  * - getInSubqueryThreshold(), was `20`, now `Integer.MAX_VALUE`
-  * - isTrimUnusedFields(), override to false
-  * - AggConverter.visit(SqlCall), skip column reading for COUNT(COL), for https://jirap.corp.ebay.com/browse/KYLIN-104
-  */
- 
- /*
-  * Licensed to the Apache Software Foundation (ASF) under one or more
-  * contributor license agreements.  See the NOTICE file distributed with
-  * this work for additional information regarding copyright ownership.
-  * The ASF licenses this file to you under the Apache License, Version 2.0
-  * (the "License"); you may not use this file except in compliance with
-  * the License.  You may obtain a copy of the License at
-  *
-  * http://www.apache.org/licenses/LICENSE-2.0
-  *
++ * Licensed to the Apache Software Foundation (ASF) under one
++ * or more contributor license agreements.  See the NOTICE file
++ * distributed with this work for additional information
++ * regarding copyright ownership.  The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License.  You may obtain a copy of the License at
++ * 
++ *     http://www.apache.org/licenses/LICENSE-2.0
++ * 
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
-  */
++*/
 +package org.apache.calcite.sql2rel;
 +
++import com.google.common.base.Function;
++import com.google.common.base.Preconditions;
++import com.google.common.collect.*;
 +import org.apache.calcite.linq4j.Ord;
- import org.apache.calcite.plan.Convention;
- import org.apache.calcite.plan.RelOptCluster;
- import org.apache.calcite.plan.RelOptPlanner;
- import org.apache.calcite.plan.RelOptSamplingParameters;
- import org.apache.calcite.plan.RelOptTable;
- import org.apache.calcite.plan.RelOptUtil;
++import org.apache.calcite.plan.*;
 +import org.apache.calcite.prepare.Prepare;
 +import org.apache.calcite.prepare.RelOptTableImpl;
- import org.apache.calcite.rel.RelCollation;
- import org.apache.calcite.rel.RelCollations;
- import org.apache.calcite.rel.RelFieldCollation;
- import org.apache.calcite.rel.RelNode;
- import org.apache.calcite.rel.RelShuttle;
- import org.apache.calcite.rel.core.Aggregate;
- import org.apache.calcite.rel.core.AggregateCall;
- import org.apache.calcite.rel.core.Collect;
- import org.apache.calcite.rel.core.CorrelationId;
- import org.apache.calcite.rel.core.Join;
- import org.apache.calcite.rel.core.JoinInfo;
- import org.apache.calcite.rel.core.JoinRelType;
- import org.apache.calcite.rel.core.Project;
- import org.apache.calcite.rel.core.Sample;
- import org.apache.calcite.rel.core.Uncollect;
- import org.apache.calcite.rel.logical.LogicalAggregate;
- import org.apache.calcite.rel.logical.LogicalCorrelate;
- import org.apache.calcite.rel.logical.LogicalIntersect;
- import org.apache.calcite.rel.logical.LogicalJoin;
- import org.apache.calcite.rel.logical.LogicalMinus;
- import org.apache.calcite.rel.logical.LogicalProject;
- import org.apache.calcite.rel.logical.LogicalSort;
- import org.apache.calcite.rel.logical.LogicalTableFunctionScan;
- import org.apache.calcite.rel.logical.LogicalTableModify;
- import org.apache.calcite.rel.logical.LogicalTableScan;
- import org.apache.calcite.rel.logical.LogicalUnion;
- import org.apache.calcite.rel.logical.LogicalValues;
++import org.apache.calcite.rel.*;
++import org.apache.calcite.rel.core.*;
++import org.apache.calcite.rel.logical.*;
 +import org.apache.calcite.rel.metadata.RelColumnMapping;
 +import org.apache.calcite.rel.stream.LogicalDelta;
 +import org.apache.calcite.rel.type.RelDataType;
 +import org.apache.calcite.rel.type.RelDataTypeFactory;
 +import org.apache.calcite.rel.type.RelDataTypeField;
- import org.apache.calcite.rex.RexBuilder;
- import org.apache.calcite.rex.RexCall;
- import org.apache.calcite.rex.RexCallBinding;
- import org.apache.calcite.rex.RexCorrelVariable;
- import org.apache.calcite.rex.RexDynamicParam;
- import org.apache.calcite.rex.RexFieldAccess;
- import org.apache.calcite.rex.RexFieldCollation;
- import org.apache.calcite.rex.RexInputRef;
- import org.apache.calcite.rex.RexLiteral;
- import org.apache.calcite.rex.RexNode;
- import org.apache.calcite.rex.RexRangeRef;
- import org.apache.calcite.rex.RexShuttle;
- import org.apache.calcite.rex.RexUtil;
- import org.apache.calcite.rex.RexVisitorImpl;
- import org.apache.calcite.rex.RexWindowBound;
++import org.apache.calcite.rex.*;
 +import org.apache.calcite.schema.ModifiableTable;
 +import org.apache.calcite.schema.ModifiableView;
 +import org.apache.calcite.schema.Table;
 +import org.apache.calcite.schema.TranslatableTable;
- import org.apache.calcite.sql.JoinConditionType;
- import org.apache.calcite.sql.JoinType;
- import org.apache.calcite.sql.SemiJoinType;
- import org.apache.calcite.sql.SqlAggFunction;
- import org.apache.calcite.sql.SqlBasicCall;
- import org.apache.calcite.sql.SqlCall;
- import org.apache.calcite.sql.SqlDataTypeSpec;
- import org.apache.calcite.sql.SqlDelete;
- import org.apache.calcite.sql.SqlDynamicParam;
- import org.apache.calcite.sql.SqlExplainLevel;
- import org.apache.calcite.sql.SqlFunction;
- import org.apache.calcite.sql.SqlIdentifier;
- import org.apache.calcite.sql.SqlInsert;
- import org.apache.calcite.sql.SqlIntervalQualifier;
- import org.apache.calcite.sql.SqlJoin;
- import org.apache.calcite.sql.SqlKind;
- import org.apache.calcite.sql.SqlLiteral;
- import org.apache.calcite.sql.SqlMerge;
- import org.apache.calcite.sql.SqlNode;
- import org.apache.calcite.sql.SqlNodeList;
- import org.apache.calcite.sql.SqlNumericLiteral;
- import org.apache.calcite.sql.SqlOperator;
- import org.apache.calcite.sql.SqlOperatorTable;
- import org.apache.calcite.sql.SqlSampleSpec;
- import org.apache.calcite.sql.SqlSelect;
- import org.apache.calcite.sql.SqlSelectKeyword;
- import org.apache.calcite.sql.SqlSetOperator;
- import org.apache.calcite.sql.SqlUpdate;
- import org.apache.calcite.sql.SqlUtil;
- import org.apache.calcite.sql.SqlValuesOperator;
- import org.apache.calcite.sql.SqlWindow;
- import org.apache.calcite.sql.SqlWith;
- import org.apache.calcite.sql.SqlWithItem;
++import org.apache.calcite.sql.*;
 +import org.apache.calcite.sql.fun.SqlCountAggFunction;
 +import org.apache.calcite.sql.fun.SqlInOperator;
 +import org.apache.calcite.sql.fun.SqlRowOperator;
 +import org.apache.calcite.sql.fun.SqlStdOperatorTable;
 +import org.apache.calcite.sql.parser.SqlParserPos;
 +import org.apache.calcite.sql.type.SqlReturnTypeInference;
 +import org.apache.calcite.sql.type.SqlTypeName;
 +import org.apache.calcite.sql.type.SqlTypeUtil;
 +import org.apache.calcite.sql.type.TableFunctionReturnTypeInference;
 +import org.apache.calcite.sql.util.SqlBasicVisitor;
 +import org.apache.calcite.sql.util.SqlVisitor;
- import org.apache.calcite.sql.validate.AggregatingSelectScope;
- import org.apache.calcite.sql.validate.CollectNamespace;
- import org.apache.calcite.sql.validate.DelegatingScope;
- import org.apache.calcite.sql.validate.ListScope;
- import org.apache.calcite.sql.validate.ParameterScope;
- import org.apache.calcite.sql.validate.SelectScope;
- import org.apache.calcite.sql.validate.SqlMonotonicity;
- import org.apache.calcite.sql.validate.SqlQualified;
- import org.apache.calcite.sql.validate.SqlUserDefinedTableFunction;
- import org.apache.calcite.sql.validate.SqlUserDefinedTableMacro;
- import org.apache.calcite.sql.validate.SqlValidator;
- import org.apache.calcite.sql.validate.SqlValidatorImpl;
- import org.apache.calcite.sql.validate.SqlValidatorNamespace;
- import org.apache.calcite.sql.validate.SqlValidatorScope;
- import org.apache.calcite.sql.validate.SqlValidatorUtil;
- import org.apache.calcite.util.ImmutableBitSet;
- import org.apache.calcite.util.ImmutableIntList;
- import org.apache.calcite.util.NlsString;
- import org.apache.calcite.util.NumberUtil;
- import org.apache.calcite.util.Pair;
- import org.apache.calcite.util.Util;
++import org.apache.calcite.sql.validate.*;
++import org.apache.calcite.util.*;
 +import org.apache.calcite.util.mapping.Mappings;
 +import org.apache.calcite.util.trace.CalciteTrace;
 +
- import com.google.common.base.Function;
- import com.google.common.base.Preconditions;
- import com.google.common.collect.ImmutableList;
- import com.google.common.collect.ImmutableSet;
- import com.google.common.collect.Iterables;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- 
 +import java.lang.reflect.Type;
 +import java.math.BigDecimal;
- import java.util.AbstractList;
- import java.util.ArrayList;
- import java.util.Collection;
- import java.util.Collections;
- import java.util.EnumSet;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Stack;
- import java.util.TreeSet;
++import java.util.*;
 +import java.util.logging.Level;
 +import java.util.logging.Logger;
 +
 +import static org.apache.calcite.sql.SqlUtil.stripAs;
 +import static org.apache.calcite.util.Static.RESOURCE;
 +
++/*
++ * OVERRIDE POINT:
++ * - getInSubqueryThreshold(), was `20`, now `Integer.MAX_VALUE`
++ * - isTrimUnusedFields(), override to false
++ * - AggConverter.visit(SqlCall), skip column reading for COUNT(COL), for https://jirap.corp.ebay.com/browse/KYLIN-104
++ */
++
 +/**
 + * Converts a SQL parse tree (consisting of
 + * {@link org.apache.calcite.sql.SqlNode} objects) into a relational algebra
 + * expression (consisting of {@link org.apache.calcite.rel.RelNode} objects).
 + *
 + * <p>The public entry points are: {@link #convertQuery},
 + * {@link #convertExpression(SqlNode)}.
 + */
 +public class SqlToRelConverter {
 +  //~ Static fields/initializers ---------------------------------------------
 +
 +  protected static final Logger SQL2REL_LOGGER =
 +      CalciteTrace.getSqlToRelTracer();
 +
 +  private static final BigDecimal TWO = BigDecimal.valueOf(2L);
 +
 +  //~ Instance fields --------------------------------------------------------
 +
 +  protected final SqlValidator validator;
 +  protected final RexBuilder rexBuilder;
 +  protected final Prepare.CatalogReader catalogReader;
 +  protected final RelOptCluster cluster;
 +  private DefaultValueFactory defaultValueFactory;
 +  private SubqueryConverter subqueryConverter;
 +  protected final List<RelNode> leaves = new ArrayList<>();
 +  private final List<SqlDynamicParam> dynamicParamSqlNodes = new ArrayList<>();
 +  private final SqlOperatorTable opTab;
 +  private boolean shouldConvertTableAccess;
 +  protected final RelDataTypeFactory typeFactory;
 +  private final SqlNodeToRexConverter exprConverter;
 +  private boolean decorrelationEnabled;
 +  private boolean trimUnusedFields;
 +  private boolean shouldCreateValuesRel;
 +  private boolean isExplain;
 +  private int nDynamicParamsInExplain;
 +
 +  /**
 +   * Fields used in name resolution for correlated subqueries.
 +   */
 +  private final Map<String, DeferredLookup> mapCorrelToDeferred =
 +      new HashMap<>();
 +  private int nextCorrel = 0;
 +
 +  private static final String CORREL_PREFIX = "$cor";
 +
 +  /**
 +   * Stack of names of datasets requested by the <code>
 +   * TABLE(SAMPLE(&lt;datasetName&gt;, &lt;query&gt;))</code> construct.
 +   */
 +  private final Stack<String> datasetStack = new Stack<>();
 +
 +  /**
 +   * Mapping of non-correlated subqueries that have been converted to their
 +   * equivalent constants. Used to avoid re-evaluating the subquery if it's
 +   * already been evaluated.
 +   */
 +  private final Map<SqlNode, RexNode> mapConvertedNonCorrSubqs =
 +      new HashMap<>();
 +
 +  public final RelOptTable.ViewExpander viewExpander;
 +
 +  //~ Constructors -----------------------------------------------------------
 +  /**
 +   * Creates a converter.
 +   *
 +   * @param viewExpander    Preparing statement
 +   * @param validator       Validator
 +   * @param catalogReader   Schema
 +   * @param planner         Planner
 +   * @param rexBuilder      Rex builder
 +   * @param convertletTable Expression converter
 +   */
 +  @Deprecated // will be removed before 2.0
 +  public SqlToRelConverter(
 +      RelOptTable.ViewExpander viewExpander,
 +      SqlValidator validator,
 +      Prepare.CatalogReader catalogReader,
 +      RelOptPlanner planner,
 +      RexBuilder rexBuilder,
 +      SqlRexConvertletTable convertletTable) {
 +    this(viewExpander, validator, catalogReader,
 +        RelOptCluster.create(planner, rexBuilder), convertletTable);
 +  }
 +
 +  /* Creates a converter. */
 +  public SqlToRelConverter(
 +      RelOptTable.ViewExpander viewExpander,
 +      SqlValidator validator,
 +      Prepare.CatalogReader catalogReader,
 +      RelOptCluster cluster,
 +      SqlRexConvertletTable convertletTable) {
 +    this.viewExpander = viewExpander;
 +    this.opTab =
 +        (validator
 +            == null) ? SqlStdOperatorTable.instance()
 +            : validator.getOperatorTable();
 +    this.validator = validator;
 +    this.catalogReader = catalogReader;
 +    this.defaultValueFactory = new NullDefaultValueFactory();
 +    this.subqueryConverter = new NoOpSubqueryConverter();
 +    this.rexBuilder = cluster.getRexBuilder();
 +    this.typeFactory = rexBuilder.getTypeFactory();
 +    this.cluster = Preconditions.checkNotNull(cluster);
 +    this.shouldConvertTableAccess = true;
 +    this.exprConverter =
 +        new SqlNodeToRexConverterImpl(convertletTable);
 +    decorrelationEnabled = true;
 +    trimUnusedFields = false;
 +    shouldCreateValuesRel = true;
 +    isExplain = false;
 +    nDynamicParamsInExplain = 0;
 +  }
 +
 +  //~ Methods ----------------------------------------------------------------
 +
 +  /**
 +   * @return the RelOptCluster in use.
 +   */
 +  public RelOptCluster getCluster() {
 +    return cluster;
 +  }
 +
 +  /**
 +   * Returns the row-expression builder.
 +   */
 +  public RexBuilder getRexBuilder() {
 +    return rexBuilder;
 +  }
 +
 +  /**
 +   * Returns the number of dynamic parameters encountered during translation;
 +   * this must only be called after {@link #convertQuery}.
 +   *
 +   * @return number of dynamic parameters
 +   */
 +  public int getDynamicParamCount() {
 +    return dynamicParamSqlNodes.size();
 +  }
 +
 +  /**
 +   * Returns the type inferred for a dynamic parameter.
 +   *
 +   * @param index 0-based index of dynamic parameter
 +   * @return inferred type, never null
 +   */
 +  public RelDataType getDynamicParamType(int index) {
 +    SqlNode sqlNode = dynamicParamSqlNodes.get(index);
 +    if (sqlNode == null) {
 +      throw Util.needToImplement("dynamic param type inference");
 +    }
 +    return validator.getValidatedNodeType(sqlNode);
 +  }
 +
 +  /**
 +   * Returns the current count of the number of dynamic parameters in an
 +   * EXPLAIN PLAN statement.
 +   *
 +   * @param increment if true, increment the count
 +   * @return the current count before the optional increment
 +   */
 +  public int getDynamicParamCountInExplain(boolean increment) {
 +    int retVal = nDynamicParamsInExplain;
 +    if (increment) {
 +      ++nDynamicParamsInExplain;
 +    }
 +    return retVal;
 +  }
 +
 +  /**
 +   * @return mapping of non-correlated subqueries that have been converted to
 +   * the constants that they evaluate to
 +   */
 +  public Map<SqlNode, RexNode> getMapConvertedNonCorrSubqs() {
 +    return mapConvertedNonCorrSubqs;
 +  }
 +
 +  /**
 +   * Adds to the current map of non-correlated converted subqueries the
 +   * elements from another map that contains non-correlated subqueries that
 +   * have been converted by another SqlToRelConverter.
 +   *
 +   * @param alreadyConvertedNonCorrSubqs the other map
 +   */
 +  public void addConvertedNonCorrSubqs(
 +      Map<SqlNode, RexNode> alreadyConvertedNonCorrSubqs) {
 +    mapConvertedNonCorrSubqs.putAll(alreadyConvertedNonCorrSubqs);
 +  }
 +
 +  /**
 +   * Set a new DefaultValueFactory. To have any effect, this must be called
 +   * before any convert method.
 +   *
 +   * @param factory new DefaultValueFactory
 +   */
 +  public void setDefaultValueFactory(DefaultValueFactory factory) {
 +    defaultValueFactory = factory;
 +  }
 +
 +  /**
 +   * Sets a new SubqueryConverter. To have any effect, this must be called
 +   * before any convert method.
 +   *
 +   * @param converter new SubqueryConverter
 +   */
 +  public void setSubqueryConverter(SubqueryConverter converter) {
 +    subqueryConverter = converter;
 +  }
 +
 +  /**
 +   * Indicates that the current statement is part of an EXPLAIN PLAN statement
 +   *
 +   * @param nDynamicParams number of dynamic parameters in the statement
 +   */
 +  public void setIsExplain(int nDynamicParams) {
 +    isExplain = true;
 +    nDynamicParamsInExplain = nDynamicParams;
 +  }
 +
 +  /**
 +   * Controls whether table access references are converted to physical rels
 +   * immediately. The optimizer doesn't like leaf rels to have
 +   * {@link Convention#NONE}. However, if we are doing further conversion
 +   * passes (e.g. {@link RelStructuredTypeFlattener}), then we may need to
 +   * defer conversion. To have any effect, this must be called before any
 +   * convert method.
 +   *
 +   * @param enabled true for immediate conversion (the default); false to
 +   *                generate logical LogicalTableScan instances
 +   */
 +  public void enableTableAccessConversion(boolean enabled) {
 +    shouldConvertTableAccess = enabled;
 +  }
 +
 +  /**
 +   * Controls whether instances of
 +   * {@link org.apache.calcite.rel.logical.LogicalValues} are generated. These
 +   * may not be supported by all physical implementations. To have any effect,
 +   * this must be called before any convert method.
 +   *
 +   * @param enabled true to allow LogicalValues to be generated (the default);
 +   *                false to force substitution of Project+OneRow instead
 +   */
 +  public void enableValuesRelCreation(boolean enabled) {
 +    shouldCreateValuesRel = enabled;
 +  }
 +
 +  private void checkConvertedType(SqlNode query, RelNode result) {
 +    if (!query.isA(SqlKind.DML)) {
 +      // Verify that conversion from SQL to relational algebra did
 +      // not perturb any type information.  (We can't do this if the
 +      // SQL statement is something like an INSERT which has no
 +      // validator type information associated with its result,
 +      // hence the namespace check above.)
 +      RelDataType convertedRowType = result.getRowType();
 +      if (!checkConvertedRowType(query, convertedRowType)) {
 +        RelDataType validatedRowType =
 +            validator.getValidatedNodeType(query);
 +        validatedRowType = uniquifyFields(validatedRowType);
 +        throw Util.newInternal("Conversion to relational algebra failed to "
 +            + "preserve datatypes:\n"
 +            + "validated type:\n"
 +            + validatedRowType.getFullTypeString()
 +            + "\nconverted type:\n"
 +            + convertedRowType.getFullTypeString()
 +            + "\nrel:\n"
 +            + RelOptUtil.toString(result));
 +      }
 +    }
 +  }
 +
 +  public RelNode flattenTypes(
 +      RelNode rootRel,
 +      boolean restructure) {
 +    RelStructuredTypeFlattener typeFlattener =
 +        new RelStructuredTypeFlattener(rexBuilder, createToRelContext());
 +    return typeFlattener.rewrite(rootRel, restructure);
 +  }
 +
 +  /**
 +   * If subquery is correlated and decorrelation is enabled, performs
 +   * decorrelation.
 +   *
 +   * @param query   Query
 +   * @param rootRel Root relational expression
 +   * @return New root relational expression after decorrelation
 +   */
 +  public RelNode decorrelate(SqlNode query, RelNode rootRel) {
 +    if (!enableDecorrelation()) {
 +      return rootRel;
 +    }
 +    final RelNode result = decorrelateQuery(rootRel);
 +    if (result != rootRel) {
 +      checkConvertedType(query, result);
 +    }
 +    return result;
 +  }
 +
 +  /**
 +   * Walks over a tree of relational expressions, replacing each
 +   * {@link RelNode} with a 'slimmed down' relational expression that projects
 +   * only the fields required by its consumer.
 +   *
 +   * <p>This may make things easier for the optimizer, by removing crud that
 +   * would expand the search space, but is difficult for the optimizer itself
 +   * to do it, because optimizer rules must preserve the number and type of
 +   * fields. Hence, this transform that operates on the entire tree, similar
 +   * to the {@link RelStructuredTypeFlattener type-flattening transform}.
 +   *
 +   * <p>Currently this functionality is disabled in farrago/luciddb; the
 +   * default implementation of this method does nothing.
 +   *
 +   * @param rootRel Relational expression that is at the root of the tree
 +   * @return Trimmed relational expression
 +   */
 +  public RelNode trimUnusedFields(RelNode rootRel) {
 +    // Trim fields that are not used by their consumer.
 +    if (isTrimUnusedFields()) {
 +      final RelFieldTrimmer trimmer = newFieldTrimmer();
 +      rootRel = trimmer.trim(rootRel);
 +      boolean dumpPlan = SQL2REL_LOGGER.isLoggable(Level.FINE);
 +      if (dumpPlan) {
 +        SQL2REL_LOGGER.fine(
 +            RelOptUtil.dumpPlan(
 +                "Plan after trimming unused fields",
 +                rootRel,
 +                false,
 +                SqlExplainLevel.EXPPLAN_ATTRIBUTES));
 +      }
 +    }
 +    return rootRel;
 +  }
 +
 +  /**
 +   * Creates a RelFieldTrimmer.
 +   *
 +   * @return Field trimmer
 +   */
 +  protected RelFieldTrimmer newFieldTrimmer() {
 +    return new RelFieldTrimmer(validator);
 +  }
 +
 +  /**
 +   * Converts an unvalidated query's parse tree into a relational expression.
 +   *
 +   * @param query           Query to convert
 +   * @param needsValidation Whether to validate the query before converting;
 +   *                        <code>false</code> if the query has already been
 +   *                        validated.
 +   * @param top             Whether the query is top-level, say if its result
 +   *                        will become a JDBC result set; <code>false</code> if
 +   *                        the query will be part of a view.
 +   */
 +  public RelNode convertQuery(
 +      SqlNode query,
 +      final boolean needsValidation,
 +      final boolean top) {
 +    if (needsValidation) {
 +      query = validator.validate(query);
 +    }
 +
 +    RelNode result = convertQueryRecursive(query, top, null);
 +    if (top && isStream(query)) {
 +      result = new LogicalDelta(cluster, result.getTraitSet(), result);
 +    }
 +    checkConvertedType(query, result);
 +
 +    boolean dumpPlan = SQL2REL_LOGGER.isLoggable(Level.FINE);
 +    if (dumpPlan) {
 +      SQL2REL_LOGGER.fine(
 +          RelOptUtil.dumpPlan(
 +              "Plan after converting SqlNode to RelNode",
 +              result,
 +              false,
 +              SqlExplainLevel.EXPPLAN_ATTRIBUTES));
 +    }
 +
 +    return result;
 +  }
 +
 +  private static boolean isStream(SqlNode query) {
 +    return query instanceof SqlSelect
 +        && ((SqlSelect) query).isKeywordPresent(SqlSelectKeyword.STREAM);
 +  }
 +
 +  protected boolean checkConvertedRowType(
 +      SqlNode query,
 +      RelDataType convertedRowType) {
 +    RelDataType validatedRowType = validator.getValidatedNodeType(query);
 +    validatedRowType = uniquifyFields(validatedRowType);
 +
 +    return RelOptUtil.equal(
 +        "validated row type", validatedRowType, "converted row type", convertedRowType, false);
 +  }
 +
 +  protected RelDataType uniquifyFields(RelDataType rowType) {
 +    return validator.getTypeFactory().createStructType(
 +        RelOptUtil.getFieldTypeList(rowType),
 +        SqlValidatorUtil.uniquify(rowType.getFieldNames()));
 +  }
 +
 +  /**
 +   * Converts a SELECT statement's parse tree into a relational expression.
 +   */
 +  public RelNode convertSelect(SqlSelect select) {
 +    final SqlValidatorScope selectScope = validator.getWhereScope(select);
 +    final Blackboard bb = createBlackboard(selectScope, null);
 +    convertSelectImpl(bb, select);
 +    return bb.root;
 +  }
 +
 +  /**
 +   * Factory method for creating translation workspace.
 +   */
 +  protected Blackboard createBlackboard(
 +      SqlValidatorScope scope,
 +      Map<String, RexNode> nameToNodeMap) {
 +    return new Blackboard(scope, nameToNodeMap);
 +  }
 +
 +  /**
 +   * Implementation of {@link #convertSelect(SqlSelect)}; derived class may
 +   * override.
 +   */
 +  protected void convertSelectImpl(
 +      final Blackboard bb,
 +      SqlSelect select) {
 +    convertFrom(
 +        bb,
 +        select.getFrom());
 +    convertWhere(
 +        bb,
 +        select.getWhere());
 +
 +    final List<SqlNode> orderExprList = new ArrayList<>();
 +    final List<RelFieldCollation> collationList = new ArrayList<>();
 +    gatherOrderExprs(
 +        bb,
 +        select,
 +        select.getOrderList(),
 +        orderExprList,
 +        collationList);
 +    final RelCollation collation =
 +        cluster.traitSet().canonize(RelCollations.of(collationList));
 +
 +    if (validator.isAggregate(select)) {
 +      convertAgg(
 +          bb,
 +          select,
 +          orderExprList);
 +    } else {
 +      convertSelectList(
 +          bb,
 +          select,
 +          orderExprList);
 +    }
 +
 +    if (select.isDistinct()) {
 +      distinctify(bb, true);
 +    }
 +    convertOrder(
 +        select, bb, collation, orderExprList, select.getOffset(),
 +        select.getFetch());
 +    bb.setRoot(bb.root, true);
 +  }
 +
 +  /**
 +   * Having translated 'SELECT ... FROM ... [GROUP BY ...] [HAVING ...]', adds
 +   * a relational expression to make the results unique.
 +   *
 +   * <p>If the SELECT clause contains duplicate expressions, adds
 +   * {@link org.apache.calcite.rel.logical.LogicalProject}s so that we are
 +   * grouping on the minimal set of keys. The performance gain isn't huge, but
 +   * it is difficult to detect these duplicate expressions later.
 +   *
 +   * @param bb               Blackboard
 +   * @param checkForDupExprs Check for duplicate expressions
 +   */
 +  private void distinctify(
 +      Blackboard bb,
 +      boolean checkForDupExprs) {
 +    // Look for duplicate expressions in the project.
 +    // Say we have 'select x, y, x, z'.
 +    // Then dups will be {[2, 0]}
 +    // and oldToNew will be {[0, 0], [1, 1], [2, 0], [3, 2]}
 +    RelNode rel = bb.root;
 +    if (checkForDupExprs && (rel instanceof LogicalProject)) {
 +      LogicalProject project = (LogicalProject) rel;
 +      final List<RexNode> projectExprs = project.getProjects();
 +      final List<Integer> origins = new ArrayList<>();
 +      int dupCount = 0;
 +      for (int i = 0; i < projectExprs.size(); i++) {
 +        int x = findExpr(projectExprs.get(i), projectExprs, i);
 +        if (x >= 0) {
 +          origins.add(x);
 +          ++dupCount;
 +        } else {
 +          origins.add(i);
 +        }
 +      }
 +      if (dupCount == 0) {
 +        distinctify(bb, false);
 +        return;
 +      }
 +
 +      final Map<Integer, Integer> squished = Maps.newHashMap();
 +      final List<RelDataTypeField> fields = rel.getRowType().getFieldList();
 +      final List<Pair<RexNode, String>> newProjects = Lists.newArrayList();
 +      for (int i = 0; i < fields.size(); i++) {
 +        if (origins.get(i) == i) {
 +          squished.put(i, newProjects.size());
 +          newProjects.add(RexInputRef.of2(i, fields));
 +        }
 +      }
 +      rel =
 +          LogicalProject.create(rel, Pair.left(newProjects),
 +              Pair.right(newProjects));
 +      bb.root = rel;
 +      distinctify(bb, false);
 +      rel = bb.root;
 +
 +      // Create the expressions to reverse the mapping.
 +      // Project($0, $1, $0, $2).
 +      final List<Pair<RexNode, String>> undoProjects = Lists.newArrayList();
 +      for (int i = 0; i < fields.size(); i++) {
 +        final int origin = origins.get(i);
 +        RelDataTypeField field = fields.get(i);
 +        undoProjects.add(
 +            Pair.of(
 +                (RexNode) new RexInputRef(
 +                    squished.get(origin), field.getType()),
 +                field.getName()));
 +      }
 +
 +      rel =
 +          LogicalProject.create(rel, Pair.left(undoProjects),
 +              Pair.right(undoProjects));
 +      bb.setRoot(
 +          rel,
 +          false);
 +
 +      return;
 +    }
 +
 +    // Usual case: all of the expressions in the SELECT clause are
 +    // different.
 +    final ImmutableBitSet groupSet =
 +        ImmutableBitSet.range(rel.getRowType().getFieldCount());
 +    rel =
 +        createAggregate(bb, false, groupSet, ImmutableList.of(groupSet),
 +            ImmutableList.<AggregateCall>of());
 +
 +    bb.setRoot(
 +        rel,
 +        false);
 +  }
 +
 +  private int findExpr(RexNode seek, List<RexNode> exprs, int count) {
 +    for (int i = 0; i < count; i++) {
 +      RexNode expr = exprs.get(i);
 +      if (expr.toString().equals(seek.toString())) {
 +        return i;
 +      }
 +    }
 +    return -1;
 +  }
 +
 +  /**
 +   * Converts a query's ORDER BY clause, if any.
 +   *
 +   * @param select        Query
 +   * @param bb            Blackboard
 +   * @param collation     Collation list
 +   * @param orderExprList Method populates this list with orderBy expressions
 +   *                      not present in selectList
 +   * @param offset        Expression for number of rows to discard before
 +   *                      returning first row
 +   * @param fetch         Expression for number of rows to fetch
 +   */
 +  protected void convertOrder(
 +      SqlSelect select,
 +      Blackboard bb,
 +      RelCollation collation,
 +      List<SqlNode> orderExprList,
 +      SqlNode offset,
 +      SqlNode fetch) {
 +    if (select.getOrderList() == null) {
 +      assert collation.getFieldCollations().isEmpty();
 +      if (offset == null && fetch == null) {
 +        return;
 +      }
 +    }
 +
 +    // Create a sorter using the previously constructed collations.
 +    bb.setRoot(
 +        LogicalSort.create(bb.root, collation,
 +            offset == null ? null : convertExpression(offset),
 +            fetch == null ? null : convertExpression(fetch)),
 +        false);
 +
 +    // If extra expressions were added to the project list for sorting,
 +    // add another project to remove them.
 +    if (orderExprList.size() > 0) {
 +      final List<RexNode> exprs = new ArrayList<>();
 +      final RelDataType rowType = bb.root.getRowType();
 +      final int fieldCount =
 +          rowType.getFieldCount() - orderExprList.size();
 +      for (int i = 0; i < fieldCount; i++) {
 +        exprs.add(rexBuilder.makeInputRef(bb.root, i));
 +      }
 +      bb.setRoot(
 +          new LogicalProject(
 +              cluster,
 +              cluster.traitSetOf(RelCollations.PRESERVE),
 +              bb.root,
 +              exprs,
 +              cluster.getTypeFactory().createStructType(
 +                  rowType.getFieldList().subList(0, fieldCount))),
 +          false);
 +    }
 +  }
 +
 +  /**
 +   * Returns whether a given node contains a {@link SqlInOperator}.
 +   *
 +   * @param node a RexNode tree
 +   */
 +  private static boolean containsInOperator(
 +      SqlNode node) {
 +    try {
 +      SqlVisitor<Void> visitor =
 +          new SqlBasicVisitor<Void>() {
 +            public Void visit(SqlCall call) {
 +              if (call.getOperator() instanceof SqlInOperator) {
 +                throw new Util.FoundOne(call);
 +              }
 +              return super.visit(call);
 +            }
 +          };
 +      node.accept(visitor);
 +      return false;
 +    } catch (Util.FoundOne e) {
 +      Util.swallow(e, null);
 +      return true;
 +    }
 +  }
 +
 +  /**
 +   * Push down all the NOT logical operators into any IN/NOT IN operators.
 +   *
 +   * @param sqlNode the root node from which to look for NOT operators
 +   * @return the transformed SqlNode representation with NOT pushed down.
 +   */
 +  private static SqlNode pushDownNotForIn(SqlNode sqlNode) {
 +    if ((sqlNode instanceof SqlCall) && containsInOperator(sqlNode)) {
 +      SqlCall sqlCall = (SqlCall) sqlNode;
 +      if ((sqlCall.getOperator() == SqlStdOperatorTable.AND)
 +          || (sqlCall.getOperator() == SqlStdOperatorTable.OR)) {
 +        SqlNode[] sqlOperands = ((SqlBasicCall) sqlCall).operands;
 +        for (int i = 0; i < sqlOperands.length; i++) {
 +          sqlOperands[i] = pushDownNotForIn(sqlOperands[i]);
 +        }
 +        return sqlNode;
 +      } else if (sqlCall.getOperator() == SqlStdOperatorTable.NOT) {
 +        SqlNode childNode = sqlCall.operand(0);
 +        assert childNode instanceof SqlCall;
 +        SqlBasicCall childSqlCall = (SqlBasicCall) childNode;
 +        if (childSqlCall.getOperator() == SqlStdOperatorTable.AND) {
 +          SqlNode[] andOperands = childSqlCall.getOperands();
 +          SqlNode[] orOperands = new SqlNode[andOperands.length];
 +          for (int i = 0; i < orOperands.length; i++) {
 +            orOperands[i] =
 +                SqlStdOperatorTable.NOT.createCall(
 +                    SqlParserPos.ZERO,
 +                    andOperands[i]);
 +          }
 +          for (int i = 0; i < orOperands.length; i++) {
 +            orOperands[i] = pushDownNotForIn(orOperands[i]);
 +          }
 +          return SqlStdOperatorTable.OR.createCall(SqlParserPos.ZERO,
 +              orOperands[0], orOperands[1]);
 +        } else if (childSqlCall.getOperator() == SqlStdOperatorTable.OR) {
 +          SqlNode[] orOperands = childSqlCall.getOperands();
 +          SqlNode[] andOperands = new SqlNode[orOperands.length];
 +          for (int i = 0; i < andOperands.length; i++) {
 +            andOperands[i] =
 +                SqlStdOperatorTable.NOT.createCall(
 +                    SqlParserPos.ZERO,
 +                    orOperands[i]);
 +          }
 +          for (int i = 0; i < andOperands.length; i++) {
 +            andOperands[i] = pushDownNotForIn(andOperands[i]);
 +          }
 +          return SqlStdOperatorTable.AND.createCall(SqlParserPos.ZERO,
 +              andOperands[0], andOperands[1]);
 +        } else if (childSqlCall.getOperator() == SqlStdOperatorTable.NOT) {
 +          SqlNode[] notOperands = childSqlCall.getOperands();
 +          assert notOperands.length == 1;
 +          return pushDownNotForIn(notOperands[0]);
 +        } else if (childSqlCall.getOperator() instanceof SqlInOperator) {
 +          SqlNode[] inOperands = childSqlCall.getOperands();
 +          SqlInOperator inOp =
 +              (SqlInOperator) childSqlCall.getOperator();
 +          if (inOp.isNotIn()) {
 +            return SqlStdOperatorTable.IN.createCall(
 +                SqlParserPos.ZERO,
 +                inOperands[0],
 +                inOperands[1]);
 +          } else {
 +            return SqlStdOperatorTable.NOT_IN.createCall(
 +                SqlParserPos.ZERO,
 +                inOperands[0],
 +                inOperands[1]);
 +          }
 +        } else {
 +          // childSqlCall is "leaf" node in a logical expression tree
 +          // (only considering AND, OR, NOT)
 +          return sqlNode;
 +        }
 +      } else {
 +        // sqlNode is "leaf" node in a logical expression tree
 +        // (only considering AND, OR, NOT)
 +        return sqlNode;
 +      }
 +    } else {
 +      // tree rooted at sqlNode does not contain inOperator
 +      return sqlNode;
 +    }
 +  }
 +
 +  /**
 +   * Converts a WHERE clause.
 +   *
 +   * @param bb    Blackboard
 +   * @param where WHERE clause, may be null
 +   */
 +  private void convertWhere(
 +      final Blackboard bb,
 +      final SqlNode where) {
 +    if (where == null) {
 +      return;
 +    }
 +    SqlNode newWhere = pushDownNotForIn(where);
 +    replaceSubqueries(bb, newWhere, RelOptUtil.Logic.UNKNOWN_AS_FALSE);
 +    final RexNode convertedWhere = bb.convertExpression(newWhere);
 +
 +    // only allocate filter if the condition is not TRUE
 +    if (!convertedWhere.isAlwaysTrue()) {
 +      bb.setRoot(
 +          RelOptUtil.createFilter(bb.root, convertedWhere),
 +          false);
 +    }
 +  }
 +
 +  private void replaceSubqueries(
 +      final Blackboard bb,
 +      final SqlNode expr,
 +      RelOptUtil.Logic logic) {
 +    findSubqueries(bb, expr, logic, false);
 +    for (SubQuery node : bb.subqueryList) {
 +      substituteSubquery(bb, node);
 +    }
 +  }
 +
 +  private void substituteSubquery(Blackboard bb, SubQuery subQuery) {
 +    final RexNode expr = subQuery.expr;
 +    if (expr != null) {
 +      // Already done.
 +      return;
 +    }
 +
 +    final SqlBasicCall call;
 +    final RelNode rel;
 +    final SqlNode query;
 +    final Pair<RelNode, Boolean> converted;
 +    switch (subQuery.node.getKind()) {
 +    case CURSOR:
 +      convertCursor(bb, subQuery);
 +      return;
 +
 +    case MULTISET_QUERY_CONSTRUCTOR:
 +    case MULTISET_VALUE_CONSTRUCTOR:
 +      rel = convertMultisets(ImmutableList.of(subQuery.node), bb);
 +      subQuery.expr = bb.register(rel, JoinRelType.INNER);
 +      return;
 +
 +    case IN:
 +      call = (SqlBasicCall) subQuery.node;
 +      final SqlNode[] operands = call.getOperands();
 +
 +      SqlNode leftKeyNode = operands[0];
 +      query = operands[1];
 +
 +      final List<RexNode> leftKeys;
 +      switch (leftKeyNode.getKind()) {
 +      case ROW:
 +        leftKeys = Lists.newArrayList();
 +        for (SqlNode sqlExpr : ((SqlBasicCall) leftKeyNode).getOperandList()) {
 +          leftKeys.add(bb.convertExpression(sqlExpr));
 +        }
 +        break;
 +      default:
 +        leftKeys = ImmutableList.of(bb.convertExpression(leftKeyNode));
 +      }
 +
 +      final boolean isNotIn = ((SqlInOperator) call.getOperator()).isNotIn();
 +      if (query instanceof SqlNodeList) {
 +        SqlNodeList valueList = (SqlNodeList) query;
 +        if (!containsNullLiteral(valueList)
 +            && valueList.size() < getInSubqueryThreshold()) {
 +          // We're under the threshold, so convert to OR.
 +          subQuery.expr =
 +              convertInToOr(
 +                  bb,
 +                  leftKeys,
 +                  valueList,
 +                  isNotIn);
 +          return;
 +        }
 +
 +        // Otherwise, let convertExists translate
 +        // values list into an inline table for the
 +        // reference to Q below.
 +      }
 +
 +      // Project out the search columns from the left side
 +
 +      //  Q1:
 +      // "select from emp where emp.deptno in (select col1 from T)"
 +      //
 +      // is converted to
 +      //
 +      // "select from
 +      //   emp inner join (select distinct col1 from T)) q
 +      //   on emp.deptno = q.col1
 +      //
 +      // Q2:
 +      // "select from emp where emp.deptno not in (Q)"
 +      //
 +      // is converted to
 +      //
 +      // "select from
 +      //   emp left outer join (select distinct col1, TRUE from T) q
 +      //   on emp.deptno = q.col1
 +      //   where emp.deptno <> null
 +      //         and q.indicator <> TRUE"
 +      //
 +      final boolean outerJoin = bb.subqueryNeedsOuterJoin
 +          || isNotIn
 +          || subQuery.logic == RelOptUtil.Logic.TRUE_FALSE_UNKNOWN;
 +      converted =
 +          convertExists(query, RelOptUtil.SubqueryType.IN, subQuery.logic,
 +              outerJoin);
 +      if (converted.right) {
 +        // Generate
 +        //    emp CROSS JOIN (SELECT COUNT(*) AS c,
 +        //                       COUNT(deptno) AS ck FROM dept)
 +        final RelDataType longType =
 +            typeFactory.createSqlType(SqlTypeName.BIGINT);
 +        final RelNode seek = converted.left.getInput(0); // fragile
 +        final int keyCount = leftKeys.size();
 +        final List<Integer> args = ImmutableIntList.range(0, keyCount);
 +        LogicalAggregate aggregate =
 +            LogicalAggregate.create(seek, false, ImmutableBitSet.of(), null,
 +                ImmutableList.of(
 +                    AggregateCall.create(SqlStdOperatorTable.COUNT, false,
 +                        ImmutableList.<Integer>of(), -1, longType, null),
 +                    AggregateCall.create(SqlStdOperatorTable.COUNT, false,
 +                        args, -1, longType, null)));
 +        LogicalJoin join =
 +            LogicalJoin.create(bb.root,
 +                aggregate,
 +                rexBuilder.makeLiteral(true),
 +                JoinRelType.INNER,
 +                ImmutableSet.<String>of());
 +        bb.setRoot(join, false);
 +      }
 +      RexNode rex =
 +          bb.register(converted.left,
 +              outerJoin ? JoinRelType.LEFT : JoinRelType.INNER, leftKeys);
 +
 +      subQuery.expr = translateIn(subQuery, bb.root, rex);
 +      if (isNotIn) {
 +        subQuery.expr =
 +            rexBuilder.makeCall(SqlStdOperatorTable.NOT, subQuery.expr);
 +      }
 +      return;
 +
 +    case EXISTS:
 +      // "select from emp where exists (select a from T)"
 +      //
 +      // is converted to the following if the subquery is correlated:
 +      //
 +      // "select from emp left outer join (select AGG_TRUE() as indicator
 +      // from T group by corr_var) q where q.indicator is true"
 +      //
 +      // If there is no correlation, the expression is replaced with a
 +      // boolean indicating whether the subquery returned 0 or >= 1 row.
 +      call = (SqlBasicCall) subQuery.node;
 +      query = call.getOperands()[0];
 +      converted = convertExists(query, RelOptUtil.SubqueryType.EXISTS,
 +          subQuery.logic, true);
 +      assert !converted.right;
 +      if (convertNonCorrelatedSubQuery(subQuery, bb, converted.left, true)) {
 +        return;
 +      }
 +      subQuery.expr = bb.register(converted.left, JoinRelType.LEFT);
 +      return;
 +
 +    case SCALAR_QUERY:
 +      // Convert the subquery.  If it's non-correlated, convert it
 +      // to a constant expression.
 +      call = (SqlBasicCall) subQuery.node;
 +      query = call.getOperands()[0];
 +      converted = convertExists(query, RelOptUtil.SubqueryType.SCALAR,
 +          subQuery.logic, true);
 +      assert !converted.right;
 +      if (convertNonCorrelatedSubQuery(subQuery, bb, converted.left, false)) {
 +        return;
 +      }
 +      rel = convertToSingleValueSubq(query, converted.left);
 +      subQuery.expr = bb.register(rel, JoinRelType.LEFT);
 +      return;
 +
 +    case SELECT:
 +      // This is used when converting multiset queries:
 +      //
 +      // select * from unnest(select multiset[deptno] from emps);
 +      //
 +      converted = convertExists(subQuery.node, RelOptUtil.SubqueryType.SCALAR,
 +          subQuery.logic, true);
 +      assert !converted.right;
 +      subQuery.expr = bb.register(converted.left, JoinRelType.LEFT);
 +      return;
 +
 +    default:
 +      throw Util.newInternal("unexpected kind of subquery :" + subQuery.node);
 +    }
 +  }
 +
 +  private RexNode translateIn(SubQuery subQuery, RelNode root,
 +      final RexNode rex) {
 +    switch (subQuery.logic) {
 +    case TRUE:
 +      return rexBuilder.makeLiteral(true);
 +
 +    case UNKNOWN_AS_FALSE:
 +      assert rex instanceof RexRangeRef;
 +      final int fieldCount = rex.getType().getFieldCount();
 +      RexNode rexNode = rexBuilder.makeFieldAccess(rex, fieldCount - 1);
 +      rexNode = rexBuilder.makeCall(SqlStdOperatorTable.IS_TRUE, rexNode);
 +
 +      // Then append the IS NOT NULL(leftKeysForIn).
 +      //
 +      // RexRangeRef contains the following fields:
 +      //   leftKeysForIn,
 +      //   rightKeysForIn (the original subquery select list),
 +      //   nullIndicator
 +      //
 +      // The first two lists contain the same number of fields.
 +      final int k = (fieldCount - 1) / 2;
 +      for (int i = 0; i < k; i++) {
 +        rexNode =
 +            rexBuilder.makeCall(
 +                SqlStdOperatorTable.AND,
 +                rexNode,
 +                rexBuilder.makeCall(
 +                    SqlStdOperatorTable.IS_NOT_NULL,
 +                    rexBuilder.makeFieldAccess(rex, i)));
 +      }
 +      return rexNode;
 +
 +    case TRUE_FALSE_UNKNOWN:
 +    case UNKNOWN_AS_TRUE:
 +      // select e.deptno,
 +      //   case
 +      //   when ct.c = 0 then false
 +      //   when dt.i is not null then true
 +      //   when e.deptno is null then null
 +      //   when ct.ck < ct.c then null
 +      //   else false
 +      //   end
 +      // from e
 +      // cross join (select count(*) as c, count(deptno) as ck from v) as ct
 +      // left join (select distinct deptno, true as i from v) as dt
 +      //   on e.deptno = dt.deptno
 +      final Join join = (Join) root;
 +      final Project left = (Project) join.getLeft();
 +      final RelNode leftLeft = ((Join) left.getInput()).getLeft();
 +      final int leftLeftCount = leftLeft.getRowType().getFieldCount();
 +      final RelDataType nullableBooleanType =
 +          typeFactory.createTypeWithNullability(
 +              typeFactory.createSqlType(SqlTypeName.BOOLEAN), true);
 +      final RelDataType longType =
 +          typeFactory.createSqlType(SqlTypeName.BIGINT);
 +      final RexNode cRef = rexBuilder.makeInputRef(root, leftLeftCount);
 +      final RexNode ckRef = rexBuilder.makeInputRef(root, leftLeftCount + 1);
 +      final RexNode iRef =
 +          rexBuilder.makeInputRef(root, root.getRowType().getFieldCount() - 1);
 +
 +      final RexLiteral zero =
 +          rexBuilder.makeExactLiteral(BigDecimal.ZERO, longType);
 +      final RexLiteral trueLiteral = rexBuilder.makeLiteral(true);
 +      final RexLiteral falseLiteral = rexBuilder.makeLiteral(false);
 +      final RexNode unknownLiteral =
 +          rexBuilder.makeNullLiteral(SqlTypeName.BOOLEAN);
 +
 +      final ImmutableList.Builder<RexNode> args = ImmutableList.builder();
 +      args.add(rexBuilder.makeCall(SqlStdOperatorTable.EQUALS, cRef, zero),
 +          falseLiteral,
 +          rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, iRef),
 +          trueLiteral);
 +      final JoinInfo joinInfo = join.analyzeCondition();
 +      for (int leftKey : joinInfo.leftKeys) {
 +        final RexNode kRef = rexBuilder.makeInputRef(root, leftKey);
 +        args.add(rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, kRef),
 +            unknownLiteral);
 +      }
 +      args.add(rexBuilder.makeCall(SqlStdOperatorTable.LESS_THAN, ckRef, cRef),
 +          unknownLiteral,
 +          falseLiteral);
 +
 +      return rexBuilder.makeCall(
 +          nullableBooleanType,
 +          SqlStdOperatorTable.CASE,
 +          args.build());
 +
 +    default:
 +      throw new AssertionError(subQuery.logic);
 +    }
 +  }
 +
 +  private static boolean containsNullLiteral(SqlNodeList valueList) {
 +    for (SqlNode node : valueList.getList()) {
 +      if (node instanceof SqlLiteral) {
 +        SqlLiteral lit = (SqlLiteral) node;
 +        if (lit.getValue() == null) {
 +          return true;
 +        }
 +      }
 +    }
 +    return false;
 +  }
 +
 +  /**
 +   * Determines if a subquery is non-correlated and if so, converts it to a
 +   * constant.
 +   *
 +   * @param subQuery  the call that references the subquery
 +   * @param bb        blackboard used to convert the subquery
 +   * @param converted RelNode tree corresponding to the subquery
 +   * @param isExists  true if the subquery is part of an EXISTS expression
 +   * @return if the subquery can be converted to a constant
 +   */
 +  private boolean convertNonCorrelatedSubQuery(
 +      SubQuery subQuery,
 +      Blackboard bb,
 +      RelNode converted,
 +      boolean isExists) {
 +    SqlCall call = (SqlBasicCall) subQuery.node;
 +    if (subqueryConverter.canConvertSubquery()
 +        && isSubQueryNonCorrelated(converted, bb)) {
 +      // First check if the subquery has already been converted
 +      // because it's a nested subquery.  If so, don't re-evaluate
 +      // it again.
 +      RexNode constExpr = mapConvertedNonCorrSubqs.get(call);
 +      if (constExpr == null) {
 +        constExpr =
 +            subqueryConverter.convertSubquery(
 +                call,
 +                this,
 +                isExists,
 +                isExplain);
 +      }
 +      if (constExpr != null) {
 +        subQuery.expr = constExpr;
 +        mapConvertedNonCorrSubqs.put(call, constExpr);
 +        return true;
 +      }
 +    }
 +    return false;
 +  }
 +
 +  /**
 +   * Converts the RelNode tree for a select statement to a select that
 +   * produces a single value.
 +   *
 +   * @param query the query
 +   * @param plan   the original RelNode tree corresponding to the statement
 +   * @return the converted RelNode tree
 +   */
 +  public RelNode convertToSingleValueSubq(
 +      SqlNode query,
 +      RelNode plan) {
 +    // Check whether query is guaranteed to produce a single value.
 +    if (query instanceof SqlSelect) {
 +      SqlSelect select = (SqlSelect) query;
 +      SqlNodeList selectList = select.getSelectList();
 +      SqlNodeList groupList = select.getGroup();
 +
 +      if ((selectList.size() == 1)
 +          && ((groupList == null) || (groupList.size() == 0))) {
 +        SqlNode selectExpr = selectList.get(0);
 +        if (selectExpr instanceof SqlCall) {
 +          SqlCall selectExprCall = (SqlCall) selectExpr;
 +          if (Util.isSingleValue(selectExprCall)) {
 +            return plan;
 +          }
 +        }
 +
 +        // If there is a limit with 0 or 1,
 +        // it is ensured to produce a single value
 +        if (select.getFetch() != null
 +            && select.getFetch() instanceof SqlNumericLiteral) {
 +          SqlNumericLiteral limitNum = (SqlNumericLiteral) select.getFetch();
 +          if (((BigDecimal) limitNum.getValue()).intValue() < 2) {
 +            return plan;
 +          }
 +        }
 +      }
 +    } else if (query instanceof SqlCall) {
 +      // If the query is (values ...),
 +      // it is necessary to look into the operands to determine
 +      // whether SingleValueAgg is necessary
 +      SqlCall exprCall = (SqlCall) query;
 +      if (exprCall.getOperator()
 +          instanceof SqlValuesOperator
 +              && Util.isSingleValue(exprCall)) {
 +        return plan;
 +      }
 +    }
 +
 +    // If not, project SingleValueAgg
 +    return RelOptUtil.createSingleValueAggRel(
 +        cluster,
 +        plan);
 +  }
 +
 +  /**
 +   * Converts "x IN (1, 2, ...)" to "x=1 OR x=2 OR ...".
 +   *
 +   * @param leftKeys   LHS
 +   * @param valuesList RHS
 +   * @param isNotIn    is this a NOT IN operator
 +   * @return converted expression
 +   */
 +  private RexNode convertInToOr(
 +      final Blackboard bb,
 +      final List<RexNode> leftKeys,
 +      SqlNodeList valuesList,
 +      boolean isNotIn) {
 +    final List<RexNode> comparisons = new ArrayList<>();
 +    for (SqlNode rightVals : valuesList) {
 +      RexNode rexComparison;
 +      if (leftKeys.size() == 1) {
 +        rexComparison =
 +            rexBuilder.makeCall(
 +                SqlStdOperatorTable.EQUALS,
 +                leftKeys.get(0),
 +                rexBuilder.ensureType(leftKeys.get(0).getType(),
 +                    bb.convertExpression(rightVals), true));
 +      } else {
 +        assert rightVals instanceof SqlCall;
 +        final SqlBasicCall call = (SqlBasicCall) rightVals;
 +        assert (call.getOperator() instanceof SqlRowOperator)
 +            && call.getOperands().length == leftKeys.size();
 +        rexComparison =
 +            RexUtil.composeConjunction(
 +                rexBuilder,
 +                Iterables.transform(
 +                    Pair.zip(leftKeys, call.getOperandList()),
 +                    new Function<Pair<RexNode, SqlNode>, RexNode>() {
 +                      public RexNode apply(Pair<RexNode, SqlNode> pair) {
 +                        return rexBuilder.makeCall(SqlStdOperatorTable.EQUALS,
 +                            pair.left,
 +                            rexBuilder.ensureType(pair.left.getType(),
 +                                bb.convertExpression(pair.right), true));
 +                      }
 +                    }),
 +                false);
 +      }
 +      comparisons.add(rexComparison);
 +    }
 +
 +    RexNode result =
 +        RexUtil.composeDisjunction(rexBuilder, comparisons, true);
 +    assert result != null;
 +
 +    if (isNotIn) {
 +      result =
 +          rexBuilder.makeCall(
 +              SqlStdOperatorTable.NOT,
 +              result);
 +    }
 +
 +    return result;
 +  }
 +
 +  /**
 +   * Gets the list size threshold under which {@link #convertInToOr} is used.
 +   * Lists of this size or greater will instead be converted to use a join
 +   * against an inline table
 +   * ({@link org.apache.calcite.rel.logical.LogicalValues}) rather than a
 +   * predicate. A threshold of 0 forces usage of an inline table in all cases; a
 +   * threshold of Integer.MAX_VALUE forces usage of OR in all cases
 +   *
 +   * @return threshold, default 20
 +   */
 +  protected int getInSubqueryThreshold() {
 +    /* OVERRIDE POINT */
 +    return Integer.MAX_VALUE;
 +  }
 +
 +  /**
 +   * Converts an EXISTS or IN predicate into a join. For EXISTS, the subquery
 +   * produces an indicator variable, and the result is a relational expression
 +   * which outer joins that indicator to the original query. After performing
 +   * the outer join, the condition will be TRUE if the EXISTS condition holds,
 +   * NULL otherwise.
 +   *
 +   * @param seek           A query, for example 'select * from emp' or
 +   *                       'values (1,2,3)' or '('Foo', 34)'.
 +   * @param subqueryType   Whether sub-query is IN, EXISTS or scalar
 +   * @param logic Whether the answer needs to be in full 3-valued logic (TRUE,
 +   *     FALSE, UNKNOWN) will be required, or whether we can accept an
 +   *     approximation (say representing UNKNOWN as FALSE)
 +   * @param needsOuterJoin Whether an outer join is needed
 +   * @return join expression
 +   * @pre extraExpr == null || extraName != null
 +   */
 +  private Pair<RelNode, Boolean> convertExists(
 +      SqlNode seek,
 +      RelOptUtil.SubqueryType subqueryType,
 +      RelOptUtil.Logic logic,
 +      boolean needsOuterJoin) {
 +    final SqlValidatorScope seekScope =
 +        (seek instanceof SqlSelect)
 +            ? validator.getSelectScope((SqlSelect) seek)
 +            : null;
 +    final Blackboard seekBb = createBlackboard(seekScope, null);
 +    RelNode seekRel = convertQueryOrInList(seekBb, seek);
 +
 +    return RelOptUtil.createExistsPlan(seekRel, subqueryType, logic,
 +        needsOuterJoin);
 +  }
 +
 +  private RelNode convertQueryOrInList(
 +      Blackboard bb,
 +      SqlNode seek) {
 +    // NOTE: Once we start accepting single-row queries as row constructors,
 +    // there will be an ambiguity here for a case like X IN ((SELECT Y FROM
 +    // Z)).  The SQL standard resolves the ambiguity by saying that a lone
 +    // select should be interpreted as a table expression, not a row
 +    // expression.  The semantic difference is that a table expression can
 +    // return multiple rows.
 +    if (seek instanceof SqlNodeList) {
 +      return convertRowValues(
 +          bb,
 +          seek,
 +          ((SqlNodeList) seek).getList(),
 +          false,
 +          null);
 +    } else {
 +      return convertQueryRecursive(seek, false, null);
 +    }
 +  }
 +
 +  private RelNode convertRowValues(
 +      Blackboard bb,
 +      SqlNode rowList,
 +      Collection<SqlNode> rows,
 +      boolean allowLiteralsOnly,
 +      RelDataType targetRowType) {
 +    // NOTE jvs 30-Apr-2006: We combine all rows consisting entirely of
 +    // literals into a single LogicalValues; this gives the optimizer a smaller
 +    // input tree.  For everything else (computed expressions, row
 +    // subqueries), we union each row in as a projection on top of a
 +    // LogicalOneRow.
 +
 +    final ImmutableList.Builder<ImmutableList<RexLiteral>> tupleList =
 +        ImmutableList.builder();
 +    final RelDataType rowType;
 +    if (targetRowType != null) {
 +      rowType = targetRowType;
 +    } else {
 +      rowType =
 +          SqlTypeUtil.promoteToRowType(
 +              typeFactory,
 +              validator.getValidatedNodeType(rowList),
 +              null);
 +    }
 +
 +    final List<RelNode> unionInputs = new ArrayList<>();
 +    for (SqlNode node : rows) {
 +      SqlBasicCall call;
 +      if (isRowConstructor(node)) {
 +        call = (SqlBasicCall) node;
 +        ImmutableList.Builder<RexLiteral> tuple = ImmutableList.builder();
 +        for (Ord<SqlNode> operand : Ord.zip(call.operands)) {
 +          RexLiteral rexLiteral =
 +              convertLiteralInValuesList(
 +                  operand.e,
 +                  bb,
 +                  rowType,
 +                  operand.i);
 +          if ((rexLiteral == null) && allowLiteralsOnly) {
 +            return null;
 +          }
 +          if ((rexLiteral == null) || !shouldCreateValuesRel) {
 +            // fallback to convertRowConstructor
 +            tuple = null;
 +            break;
 +          }
 +          tuple.add(rexLiteral);
 +        }
 +        if (tuple != null) {
 +          tupleList.add(tuple.build());
 +          continue;
 +        }
 +      } else {
 +        RexLiteral rexLiteral =
 +            convertLiteralInValuesList(
 +                node,
 +                bb,
 +                rowType,
 +                0);
 +        if ((rexLiteral != null) && shouldCreateValuesRel) {
 +          tupleList.add(ImmutableList.of(rexLiteral));
 +          continue;
 +        } else {
 +          if ((rexLiteral == null) && allowLiteralsOnly) {
 +            return null;
 +          }
 +        }
 +
 +        // convert "1" to "row(1)"
 +        call =
 +            (SqlBasicCall) SqlStdOperatorTable.ROW.createCall(
 +                SqlParserPos.ZERO,
 +                node);
 +      }
 +      unionInputs.add(convertRowConstructor(bb, call));
 +    }
 +    LogicalValues values =
 +        LogicalValues.create(cluster, rowType, tupleList.build());
 +    RelNode resultRel;
 +    if (unionInputs.isEmpty()) {
 +      resultRel = values;
 +    } else {
 +      if (!values.getTuples().isEmpty()) {
 +        unionInputs.add(values);
 +      }
 +      resultRel = LogicalUnion.create(unionInputs, true);
 +    }
 +    leaves.add(resultRel);
 +    return resultRel;
 +  }
 +
 +  private RexLiteral convertLiteralInValuesList(
 +      SqlNode sqlNode,
 +      Blackboard bb,
 +      RelDataType rowType,
 +      int iField) {
 +    if (!(sqlNode instanceof SqlLiteral)) {
 +      return null;
 +    }
 +    RelDataTypeField field = rowType.getFieldList().get(iField);
 +    RelDataType type = field.getType();
 +    if (type.isStruct()) {
 +      // null literals for weird stuff like UDT's need
 +      // special handling during type flattening, so
 +      // don't use LogicalValues for those
 +      return null;
 +    }
 +
 +    RexNode literalExpr =
 +        exprConverter.convertLiteral(
 +            bb,
 +            (SqlLiteral) sqlNode);
 +
 +    if (!(literalExpr instanceof RexLiteral)) {
 +      assert literalExpr.isA(SqlKind.CAST);
 +      RexNode child = ((RexCall) literalExpr).getOperands().get(0);
 +      assert RexLiteral.isNullLiteral(child);
 +
 +      // NOTE jvs 22-Nov-2006:  we preserve type info
 +      // in LogicalValues digest, so it's OK to lose it here
 +      return (RexLiteral) child;
 +    }
 +
 +    RexLiteral literal = (RexLiteral) literalExpr;
 +
 +    Comparable value = literal.getValue();
 +
 +    if (SqlTypeUtil.isExactNumeric(type)) {
 +      BigDecimal roundedValue =
 +          NumberUtil.rescaleBigDecimal(
 +              (BigDecimal) value,
 +              type.getScale());
 +      return rexBuilder.makeExactLiteral(
 +          roundedValue,
 +          type);
 +    }
 +
 +    if ((value instanceof NlsString)
 +        && (type.getSqlTypeName() == SqlTypeName.CHAR)) {
 +      // pad fixed character type
 +      NlsString unpadded = (NlsString) value;
 +      return rexBuilder.makeCharLiteral(
 +          new NlsString(
 +              Util.rpad(unpadded.getValue(), type.getPrecision()),
 +              unpadded.getCharsetName(),
 +              unpadded.getCollation()));
 +    }
 +    return literal;
 +  }
 +
 +  private boolean isRowConstructor(SqlNode node) {
 +    if (!(node.getKind() == SqlKind.ROW)) {
 +      return false;
 +    }
 +    SqlCall call = (SqlCall) node;
 +    return call.getOperator().getName().equalsIgnoreCase("row");
 +  }
 +
 +  /**
 +   * Builds a list of all <code>IN</code> or <code>EXISTS</code> operators
 +   * inside SQL parse tree. Does not traverse inside queries.
 +   *
 +   * @param bb                           blackboard
 +   * @param node                         the SQL parse tree
 +   * @param logic Whether the answer needs to be in full 3-valued logic (TRUE,
 +   *              FALSE, UNKNOWN) will be required, or whether we can accept
 +   *              an approximation (say representing UNKNOWN as FALSE)
 +   * @param registerOnlyScalarSubqueries if set to true and the parse tree
 +   *                                     corresponds to a variation of a select
 +   *                                     node, only register it if it's a scalar
 +   *                                     subquery
 +   */
 +  private void findSubqueries(
 +      Blackboard bb,
 +      SqlNode node,
 +      RelOptUtil.Logic logic,
 +      boolean registerOnlyScalarSubqueries) {
 +    final SqlKind kind = node.getKind();
 +    switch (kind) {
 +    case EXISTS:
 +    case SELECT:
 +    case MULTISET_QUERY_CONSTRUCTOR:
 +    case MULTISET_VALUE_CONSTRUCTOR:
 +    case CURSOR:
 +    case SCALAR_QUERY:
 +      if (!registerOnlyScalarSubqueries
 +          || (kind == SqlKind.SCALAR_QUERY)) {
 +        bb.registerSubquery(node, RelOptUtil.Logic.TRUE_FALSE);
 +      }
 +      return;
 +    case IN:
 +      if (((SqlCall) node).getOperator() == SqlStdOperatorTable.NOT_IN) {
 +        logic = logic.negate();
 +      }
 +      break;
 +    case NOT:
 +      logic = logic.negate();
 +      break;
 +    }
 +    if (node instanceof SqlCall) {
 +      if (kind == SqlKind.OR
 +          || kind == SqlKind.NOT) {
 +        // It's always correct to outer join subquery with
 +        // containing query; however, when predicates involve Or
 +        // or NOT, outer join might be necessary.
 +        bb.subqueryNeedsOuterJoin = true;
 +      }
 +      for (SqlNode operand : ((SqlCall) node).getOperandList()) {
 +        if (operand != null) {
 +          // In the case of an IN expression, locate scalar
 +          // subqueries so we can convert them to constants
 +          findSubqueries(
 +              bb,
 +              operand,
 +              logic,
 +              kind == SqlKind.IN || registerOnlyScalarSubqueries);
 +        }
 +      }
 +    } else if (node instanceof SqlNodeList) {
 +      for (SqlNode child : (SqlNodeList) node) {
 +        findSubqueries(
 +            bb,
 +            child,
 +            logic,
 +            kind == SqlKind.IN || registerOnlyScalarSubqueries);
 +      }
 +    }
 +
 +    // Now that we've located any scalar subqueries inside the IN
 +    // expression, register the IN expression itself.  We need to
 +    // register the scalar subqueries first so they can be converted
 +    // before the IN expression is converted.
 +    if (kind == SqlKind.IN) {
 +      if (logic == RelOptUtil.Logic.TRUE_FALSE_UNKNOWN
 +          && !validator.getValidatedNodeType(node).isNullable()) {
 +        logic = RelOptUtil.Logic.UNKNOWN_AS_FALSE;
 +      }
 +      // TODO: This conversion is only valid in the WHERE clause
 +      if (logic == RelOptUtil.Logic.UNKNOWN_AS_FALSE
 +          && !bb.subqueryNeedsOuterJoin) {
 +        logic = RelOptUtil.Logic.TRUE;
 +      }
 +      bb.registerSubquery(node, logic);
 +    }
 +  }
 +
 +  /**
 +   * Converts an expression from {@link SqlNode} to {@link RexNode} format.
 +   *
 +   * @param node Expression to translate
 +   * @return Converted expression
 +   */
 +  public RexNode convertExpression(
 +      SqlNode node) {
 +    Map<String, RelDataType> nameToTypeMap = Collections.emptyMap();
 +    Blackboard bb =
 +        createBlackboard(
 +            new ParameterScope((SqlValidatorImpl) validator, nameToTypeMap),
 +            null);
 +    return bb.convertExpression(node);
 +  }
 +
 +  /**
 +   * Converts an expression from {@link SqlNode} to {@link RexNode} format,
 +   * mapping identifier references to predefined expressions.
 +   *
 +   * @param node          Expression to translate
 +   * @param nameToNodeMap map from String to {@link RexNode}; when an
 +   *                      {@link SqlIdentifier} is encountered, it is used as a
 +   *                      key and translated to the corresponding value from
 +   *                      this map
 +   * @return Converted expression
 +   */
 +  public RexNode convertExpression(
 +      SqlNode node,
 +      Map<String, RexNode> nameToNodeMap) {
 +    final Map<String, RelDataType> nameToTypeMap = new HashMap<>();
 +    for (Map.Entry<String, RexNode> entry : nameToNodeMap.entrySet()) {
 +      nameToTypeMap.put(entry.getKey(), entry.getValue().getType());
 +    }
 +    Blackboard bb =
 +        createBlackboard(
 +            new ParameterScope((SqlValidatorImpl) validator, nameToTypeMap),
 +            nameToNodeMap);
 +    return bb.convertExpression(node);
 +  }
 +
 +  /**
 +   * Converts a non-standard expression.
 +   *
 +   * <p>This method is an extension-point that derived classes can override. If
 +   * this method returns a null result, the normal expression translation
 +   * process will proceed. The default implementation always returns null.
 +   *
 +   * @param node Expression
 +   * @param bb   Blackboard
 +   * @return null to proceed with the usual expression translation process
 +   */
 +  protected RexNode convertExtendedExpression(
 +      SqlNode node,
 +      Blackboard bb) {
 +    return null;
 +  }
 +
 +  private RexNode convertOver(Blackboard bb, SqlNode node) {
 +    SqlCall call = (SqlCall) node;
 +    SqlCall aggCall = call.operand(0);
 +    SqlNode windowOrRef = call.operand(1);
 +    final SqlWindow window =
 +        validator.resolveWindow(windowOrRef, bb.scope, true);
 +    final SqlNodeList partitionList = window.getPartitionList();
 +    final ImmutableList.Builder<RexNode> partitionKeys =
 +        ImmutableList.builder();
 +    for (SqlNode partition : partitionList) {
 +      partitionKeys.add(bb.convertExpression(partition));
 +    }
 +    RexNode lowerBound = bb.convertExpression(window.getLowerBound());
 +    RexNode upperBound = bb.convertExpression(window.getUpperBound());
 +    SqlNodeList orderList = window.getOrderList();
 +    if ((orderList.size() == 0) && !window.isRows()) {
 +      // A logical range requires an ORDER BY clause. Use the implicit
 +      // ordering of this relation. There must be one, otherwise it would
 +      // have failed validation.
 +      orderList = bb.scope.getOrderList();
 +      if (orderList == null) {
 +        throw new AssertionError(
 +            "Relation should have sort key for implicit ORDER BY");
 +      }
 +    }
 +    final ImmutableList.Builder<RexFieldCollation> orderKeys =
 +        ImmutableList.builder();
 +    final Set<SqlKind> flags = EnumSet.noneOf(SqlKind.class);
 +    for (SqlNode order : orderList) {
 +      flags.clear();
 +      RexNode e = bb.convertSortExpression(order, flags);
 +      orderKeys.add(new RexFieldCollation(e, flags));
 +    }
 +    try {
 +      Util.permAssert(bb.window == null, "already in window agg mode");
 +      bb.window = window;
 +      RexNode rexAgg = exprConverter.convertCall(bb, aggCall);
 +      rexAgg =
 +          rexBuilder.ensureType(
 +              validator.getValidatedNodeType(call), rexAgg, false);
 +
 +      // Walk over the tree and apply 'over' to all agg functions. This is
 +      // necessary because the returned expression is not necessarily a call
 +      // to an agg function. For example, AVG(x) becomes SUM(x) / COUNT(x).
 +      final RexShuttle visitor =
 +          new HistogramShuttle(
 +              partitionKeys.build(), orderKeys.build(),
 +              RexWindowBound.create(window.getLowerBound(), lowerBound),
 +              RexWindowBound.create(window.getUpperBound(), upperBound),
 +              window);
 +      return rexAgg.accept(visitor);
 +    } finally {
 +      bb.window = null;
 +    }
 +  }
 +
 +  /**
 +   * Converts a FROM clause into a relational expression.
 +   *
 +   * @param bb   Scope within which to resolve identifiers
 +   * @param from FROM clause of a query. Examples include:
 +   *
 +   *             <ul>
 +   *             <li>a single table ("SALES.EMP"),
 +   *             <li>an aliased table ("EMP AS E"),
 +   *             <li>a list of tables ("EMP, DEPT"),
 +   *             <li>an ANSI Join expression ("EMP JOIN DEPT ON EMP.DEPTNO =
 +   *             DEPT.DEPTNO"),
 +   *             <li>a VALUES clause ("VALUES ('Fred', 20)"),
 +   *             <li>a query ("(SELECT * FROM EMP WHERE GENDER = 'F')"),
 +   *             <li>or any combination of the above.
 +   *             </ul>
 +   */
 +  protected void convertFrom(
 +      Blackboard bb,
 +      SqlNode from) {
 +    SqlCall call;
 +    final SqlNode[] operands;
 +    switch (from.getKind()) {
 +    case AS:
 +      operands = ((SqlBasicCall) from).getOperands();
 +      convertFrom(bb, operands[0]);
 +      return;
 +
 +    case WITH_ITEM:
 +      convertFrom(bb, ((SqlWithItem) from).query);
 +      return;
 +
 +    case WITH:
 +      convertFrom(bb, ((SqlWith) from).body);
 +      return;
 +
 +    case TABLESAMPLE:
 +      operands = ((SqlBasicCall) from).getOperands();
 +      SqlSampleSpec sampleSpec = SqlLiteral.sampleValue(operands[1]);
 +      if (sampleSpec instanceof SqlSampleSpec.SqlSubstitutionSampleSpec) {
 +        String sampleName =
 +            ((SqlSampleSpec.SqlSubstitutionSampleSpec) sampleSpec)
 +                .getName();
 +        datasetStack.push(sampleName);
 +        convertFrom(bb, operands[0]);
 +        datasetStack.pop();
 +      } else if (sampleSpec instanceof SqlSampleSpec.SqlTableSampleSpec) {
 +        SqlSampleSpec.SqlTableSampleSpec tableSampleSpec =
 +            (SqlSampleSpec.SqlTableSampleSpec) sampleSpec;
 +        convertFrom(bb, operands[0]);
 +        RelOptSamplingParameters params =
 +            new RelOptSamplingParameters(
 +                tableSampleSpec.isBernoulli(),
 +                tableSampleSpec.getSamplePercentage(),
 +                tableSampleSpec.isRepeatable(),
 +                tableSampleSpec.getRepeatableSeed());
 +        bb.setRoot(new Sample(cluster, bb.root, params), false);
 +      } else {
 +        throw Util.newInternal(
 +            "unknown TABLESAMPLE type: " + sampleSpec);
 +      }
 +      return;
 +
 +    case IDENTIFIER:
 +      final SqlValidatorNamespace fromNamespace =
 +          validator.getNamespace(from).resolve();
 +      if (fromNamespace.getNode() != null) {
 +        convertFrom(bb, fromNamespace.getNode());
 +        return;
 +      }
 +      final String datasetName =
 +          datasetStack.isEmpty() ? null : datasetStack.peek();
 +      boolean[] usedDataset = {false};
 +      RelOptTable table =
 +          SqlValidatorUtil.getRelOptTable(
 +              fromNamespace,
 +              catalogReader,
 +              datasetName,
 +              usedDataset);
 +      final RelNode tableRel;
 +      if (shouldConvertTableAccess) {
 +        tableRel = toRel(table);
 +      } else {
 +        tableRel = LogicalTableScan.create(cluster, table);
 +      }
 +      bb.setRoot(tableRel, true);
 +      if (usedDataset[0]) {
 +        bb.setDataset(datasetName);
 +      }
 +      return;
 +
 +    case JOIN:
 +      final SqlJoin join = (SqlJoin) from;
 +      final Blackboard fromBlackboard =
 +          createBlackboard(validator.getJoinScope(from), null);
 +      SqlNode left = join.getLeft();
 +      SqlNode right = join.getRight();
 +      final boolean isNatural = join.isNatural();
 +      final JoinType joinType = join.getJoinType();
 +      final Blackboard leftBlackboard =
 +          createBlackboard(
 +              Util.first(validator.getJoinScope(left),
 +                  ((DelegatingScope) bb.scope).getParent()), null);
 +      final Blackboard rightBlackboard =
 +          createBlackboard(
 +              Util.first(validator.getJoinScope(right),
 +                  ((DelegatingScope) bb.scope).getParent()), null);
 +      convertFrom(leftBlackboard, left);
 +      RelNode leftRel = leftBlackboard.root;
 +      convertFrom(rightBlackboard, right);
 +      RelNode rightRel = rightBlackboard.root;
 +      JoinRelType convertedJoinType = convertJoinType(joinType);
 +      RexNode conditionExp;
 +      if (isNatural) {
 +        final List<String> columnList =
 +            SqlValidatorUtil.deriveNaturalJoinColumnList(
 +                validator.getNamespace(left).getRowType(),
 +                validator.getNamespace(right).getRowType());
 +        conditionExp = convertUsing(leftRel, rightRel, columnList);
 +      } else {
 +        conditionExp =
 +            convertJoinCondition(
 +                fromBlackboard,
 +                join.getCondition(),
 +                join.getConditionType(),
 +                leftRel,
 +                rightRel);
 +      }
 +
 +      final RelNode joinRel =
 +          createJoin(
 +              fromBlackboard,
 +              leftRel,
 +              rightRel,
 +              conditionExp,
 +              convertedJoinType);
 +      bb.setRoot(joinRel, false);
 +      return;
 +
 +    case SELECT:
 +    case INTERSECT:
 +    case EXCEPT:
 +    case UNION:
 +      final RelNode rel = convertQueryRecursive(from, false, null);
 +      bb.setRoot(rel, true);
 +      return;
 +
 +    case VALUES:
 +      convertValuesImpl(bb, (SqlCall) from, null);
 +      return;
 +
 +    case UNNEST:
 +      final SqlNode node = ((SqlCall) from).operand(0);
 +      replaceSubqueries(bb, node, RelOptUtil.Logic.TRUE_FALSE_UNKNOWN);
 +      final RelNode childRel =
 +          RelOptUtil.createProject(
 +              (null != bb.root) ? bb.root : LogicalValues.createOneRow(cluster),
 +              Collections.singletonList(bb.convertExpression(node)),
 +              Collections.singletonList(validator.deriveAlias(node, 0)),
 +              true);
 +
 +      Uncollect uncollect =
 +          new Uncollect(cluster, cluster.traitSetOf(Convention.NONE),
 +              childRel);
 +      bb.setRoot(uncollect, true);
 +      return;
 +
 +    case COLLECTION_TABLE:
 +      call = (SqlCall) from;
 +
 +      // Dig out real call; TABLE() wrapper is just syntactic.
 +      assert call.getOperandList().size() == 1;
 +      call = call.operand(0);
 +      convertCollectionTable(bb, call);
 +      return;
 +
 +    default:
 +      throw Util.newInternal("not a join operator " + from);
 +    }
 +  }
 +
 +  protected void convertCollectionTable(
 +      Blackboard bb,
 +      SqlCall call) {
 +    final SqlOperator operator = call.getOperator();
 +    if (operator == SqlStdOperatorTable.TABLESAMPLE) {
 +      final String sampleName =
 +          SqlLiteral.stringValue(call.operand(0));
 +      datasetStack.push(sampleName);
 +      SqlCall cursorCall = call.operand(1);
 +      SqlNode query = cursorCall.operand(0);
 +      RelNode converted = convertQuery(query, false, false);
 +      bb.setRoot(converted, false);
 +      datasetStack.pop();
 +      return;
 +    }
 +    replaceSubqueries(bb, call, RelOptUtil.Logic.TRUE_FALSE_UNKNOWN);
 +
 +    // Expand table macro if possible. It's more efficient than
 +    // LogicalTableFunctionScan.
 +    if (operator instanceof SqlUserDefinedTableMacro) {
 +      final SqlUserDefinedTableMacro udf =
 +          (SqlUserDefinedTableMacro) operator;
 +      final TranslatableTable table = udf.getTable(typeFactory,
 +        call.getOperandList());
 +      final RelDataType rowType = table.getRowType(typeFactory);
 +      RelOptTable relOptTable = RelOptTableImpl.create(null, rowType, table);
 +      RelNode converted = toRel(relOptTable);
 +      bb.setRoot(converted, true);
 +      return;
 +    }
 +
 +    Type elementType;
 +    if (operator instanceof SqlUserDefinedTableFunction) {
 +      SqlUserDefinedTableFunction udtf = (SqlUserDefinedTableFunction) operator;
 +      elementType = udtf.getElementType(typeFactory, call.getOperandList());
 +    } else {
 +      elementType = null;
 +    }
 +
 +    RexNode rexCall = bb.convertExpression(call);
 +    final List<RelNode> inputs = bb.retrieveCursors();
 +    Set<RelColumnMapping> columnMappings =
 +        getColumnMappings(operator);
 +    LogicalTableFunctionScan callRel =
 +        LogicalTableFunctionScan.create(
 +            cluster,
 +            inputs,
 +            rexCall,
 +            elementType,
 +            validator.getValidatedNodeType(call),
 +            columnMappings);
 +    bb.setRoot(callRel, true);
 +    afterTableFunction(bb, call, callRel);
 +  }
 +
 +  protected void afterTableFunction(
 +      SqlToRelConverter.Blackboard bb,
 +      SqlCall call,
 +      LogicalTableFunctionScan callRel) {
 +  }
 +
 +  private Set<RelColumnMapping> getColumnMappings(SqlOperator op) {
 +    SqlReturnTypeInference rti = op.getReturnTypeInference();
 +    if (rti == null) {
 +      return null;
 +    }
 +    if (rti instanceof TableFunctionReturnTypeInference) {
 +      TableFunctionReturnTypeInference tfrti =
 +          (TableFunctionReturnTypeInference) rti;
 +      return tfrti.getColumnMappings();
 +    } else {
 +      return null;
 +    }
 +  }
 +
 +  protected RelNode createJoin(
 +      Blackboard bb,
 +      RelNode leftRel,
 +      RelNode rightRel,
 +      RexNode joinCond,
 +      JoinRelType joinType) {
 +    assert joinCond != null;
 +
 +    Set<String> correlatedVariables = RelOptUtil.getVariablesUsed(rightRel);
 +    if (correlatedVariables.size() > 0) {
 +      final ImmutableBitSet.Builder requiredColumns = ImmutableBitSet.builder();
 +      final List<String> correlNames = Lists.newArrayList();
 +
 +      // All correlations must refer the same namespace since correlation
 +      // produces exactly one correlation source.
 +      // The same source might be referenced by different variables since
 +      // DeferredLookups are not de-duplicated at create time.
 +      SqlValidatorNamespace prevNs = null;
 +
 +      for (String correlName : correlatedVariables) {
 +        DeferredLookup lookup = mapCorrelToDeferred.get(correlName);
 +        RexFieldAccess fieldAccess = lookup.getFieldAccess(correlName);
 +        String originalRelName = lookup.getOriginalRelName();
 +        String originalFieldName = fieldAccess.getField().getName();
 +
 +        int[] nsIndexes = {-1};
 +        final SqlValidatorScope[] ancestorScopes = {null};
 +        SqlValidatorNamespace foundNs =
 +            lookup.bb.scope.resolve(
 +                ImmutableList.of(originalRelName),
 +                ancestorScopes,
 +                nsIndexes);
 +
 +        assert foundNs != null;
 +        assert nsIndexes.length == 1;
 +
 +        int childNamespaceIndex = nsIndexes[0];
 +
 +        SqlValidatorScope ancestorScope = ancestorScopes[0];
 +        boolean correlInCurrentScope = ancestorScope == bb.scope;
 +
 +        if (!correlInCurrentScope) {
 +          continue;
 +        }
 +
 +        if (prevNs == null) {
 +          prevNs = foundNs;
 +        } else {
 +          assert prevNs == foundNs : "All correlation variables should resolve"
 +              + " to the same namespace."
 +              + " Prev ns=" + prevNs
 +              + ", new ns=" + foundNs;
 +        }
 +
 +        int namespaceOffset = 0;
 +        if (childNamespaceIndex > 0) {
 +          // If not the first child, need to figure out the width
 +          // of output types from all the preceding namespaces
 +          assert ancestorScope instanceof ListScope;
 +          List<SqlValidatorNamespace> children =
 +              ((ListScope) ancestorScope).getChildren();
 +
 +          for (int i = 0; i < childNamespaceIndex; i++) {
 +            SqlValidatorNamespace child = children.get(i);
 +            namespaceOffset +=
 +                child.getRowType().getFieldCount();
 +          }
 +        }
 +
 +        RelDataTypeField field =
 +            catalogReader.field(foundNs.getRowType(), originalFieldName);
 +        int pos = namespaceOffset + field.getIndex();
 +
 +        assert field.getType()
 +            == lookup.getFieldAccess(correlName).getField().getType();
 +
 +        assert pos != -1;
 +
 +        if (bb.mapRootRelToFieldProjection.containsKey(bb.root)) {
 +          // bb.root is an aggregate and only projects group by
 +          // keys.
 +          Map<Integer, Integer> exprProjection =
 +              bb.mapRootRelToFieldProjection.get(bb.root);
 +
 +          // subquery can reference group by keys projected from
 +          // the root of the outer relation.
 +          if (exprProjection.containsKey(pos)) {
 +            pos = exprProjection.get(pos);
 +          } else {
 +            // correl not grouped
 +            throw Util.newInternal(
 +                "Identifier '" + originalRelName + "."
 +                + originalFieldName + "' is not a group expr");
 +          }
 +        }
 +
 +        requiredColumns.set(pos);
 +        correlNames.add(correlName);
 +      }
 +
 +      if (!correlNames.isEmpty()) {
 +        if (correlNames.size() > 1) {
 +          // The same table was referenced more than once.
 +          // So we deduplicate
 +          RelShuttle dedup =
 +              new DeduplicateCorrelateVariables(rexBuilder,
 +                  correlNames.get(0),
 +                  ImmutableSet.copyOf(Util.skip(correlNames)));
 +          rightRel = rightRel.accept(dedup);
 +        }
 +        LogicalCorrelate corr = LogicalCorrelate.create(leftRel, rightRel,
 +            new CorrelationId(correlNames.get(0)), requiredColumns.build(),
 +            SemiJoinType.of(joinType));
 +        if (!joinCond.isAlwaysTrue()) {
 +          return RelOptUtil.createFilter(corr, joinCond);
 +        }
 +        return corr;
 +      }
 +    }
 +
 +    final List<RexNode> extraLeftExprs = new ArrayList<>();
 +    final List<RexNode> extraRightExprs = new ArrayList<>();
 +    final int leftCount = leftRel.getRowType().getFieldCount();
 +    final int rightCount = rightRel.getRowType().getFieldCount();
 +    if (!containsGet(joinCond)) {
 +      joinCond = pushDownJoinConditions(
 +          joinCond, leftCount, rightCount, extraLeftExprs, extraRightExprs);
 +    }
 +    if (!extraLeftExprs.isEmpty()) {
 +      final List<RelDataTypeField> fields =
 +          leftRel.getRowType().getFieldList();
 +      leftRel = RelOptUtil.createProject(
 +          leftRel,
 +          new AbstractList<Pair<RexNode, String>>() {
 +            @Override public int size() {
 +              return leftCount + extraLeftExprs.size();
 +            }
 +
 +            @Override public Pair<RexNode, String> get(int index) {
 +              if (index < leftCount) {
 +                RelDataTypeField field = fields.get(index);
 +                return Pair.<RexNode, String>of(
 +                    new RexInputRef(index, field.getType()),
 +                    field.getName());
 +              } else {
 +                return Pair.of(extraLeftExprs.get(index - leftCount), null);
 +              }
 +            }
 +          },
 +          true);
 +    }
 +    if (!extraRightExprs.isEmpty()) {
 +      final List<RelDataTypeField> fields =
 +          rightRel.getRowType().getFieldList();
 +      final int newLeftCount = leftCount + extraLeftExprs.size();
 +      rightRel = RelOptUtil.createProject(
 +          rightRel,
 +          new AbstractList<Pair<RexNode, String>>() {
 +            @Override public int size() {
 +              return rightCount + extraRightExprs.size();
 +            }
 +
 +            @Override public Pair<RexNode, String> get(int index) {
 +              if (index < rightCount) {
 +                RelDataTypeField field = fields.get(index);
 +                return Pair.<RexNode, String>of(
 +                    new RexInputRef(index, field.getType()),
 +                    field.getName());
 +              } else {
 +                return Pair.of(
 +                    RexUtil.shift(
 +                        extraRightExprs.get(index - rightCount),
 +                        -newLeftCount),
 +                    null);
 +              }
 +            }
 +          },
 +          true);
 +    }
 +    RelNode join = createJoin(
 +        leftRel,
 +        rightRel,
 +        joinCond,
 +        joinType,
 +        ImmutableSet.<String>of());
 +    if (!extraLeftExprs.isEmpty() || !extraRightExprs.isEmpty()) {
 +      Mappings.TargetMapping mapping =
 +          Mappings.createShiftMapping(
 +              leftCount + extraLeftExprs.size()
 +                  + rightCount + extraRightExprs.size(),
 +              0, 0, leftCount,
 +              leftCount, leftCount + extraLeftExprs.size(), rightCount);
 +      return RelOptUtil.createProject(join, mapping);
 +    }
 +    return join;
 +  }
 +
 +  private static boolean containsGet(RexNode node) {
 +    try {
 +      node.accept(
 +          new RexVisitorImpl<Void>(true) {
 +            @Override public Void visitCall(RexCall call) {
 +              if (call.getOperator() == RexBuilder.GET_OPERATOR) {
 +                throw Util.FoundOne.NULL;
 +              }
 +              return super.visitCall(call);
 +            }
 +          });
 +      return false;
 +    } catch (Util.FoundOne e) {
 +      return true;
 +    }
 +  }
 +
 +  /**
 +   * Pushes down parts of a join condition. For example, given
 +   * "emp JOIN dept ON emp.deptno + 1 = dept.deptno", adds a project above
 +   * "emp" that computes the expression
 +   * "emp.deptno + 1". The resulting join condition is a simple combination
 +   * of AND, equals, and input fields.
 +   */
 +  private RexNode pushDownJoinConditions(
 +      RexNode node,
 +      int leftCount,
 +      int rightCount,
 +      List<RexNode> extraLeftExprs,
 +      List<RexNode> extraRightExprs) {
 +    switch (node.getKind()) {
 +    case AND:
 +    case OR:
 +    case EQUALS:
 +      final RexCall call = (RexCall) node;
 +      final List<RexNode> list = new ArrayList<>();
 +      List<RexNode> operands = Lists.newArrayList(call.getOperands());
 +      for (int i = 0; i < operands.size(); i++) {
 +        RexNode operand = operands.get(i);
 +        final int left2 = leftCount + extraLeftExprs.size();
 +        final int right2 = rightCount + extraRightExprs.size();
 +        final RexNode e =
 +            pushDownJoinConditions(
 +                operand,
 +                leftCount,
 +                rightCount,
 +                extraLeftExprs,
 +                extraRightExprs);
 +        final List<RexNode> remainingOperands = Util.skip(operands, i + 1);
 +        final int left3 = leftCount + extraLeftExprs.size();
 +        final int right3 = rightCount + extraRightExprs.size();
 +        fix(remainingOperands, left2, left3);
 +        fix(list, left2, left3);
 +        list.add(e);
 +      }
 +      if (!list.equals(call.getOperands())) {
 +        return call.clone(call.getType(), list);
 +      }
 +      return call;
 +    case INPUT_REF:
 +    case LITERAL:
 +      return node;
 +    default:
 +      ImmutableBitSet bits = RelOptUtil.InputFinder.bits(node);
 +      final int mid = leftCount + extraLeftExprs.size();
 +      switch (Side.of(bits, mid)) {
 +      case LEFT:
 +        fix(extraRightExprs, mid, mid + 1);
 +        extraLeftExprs.add(node);
 +        return new RexInputRef(mid, node.getType());
 +      case RIGHT:
 +        final int index2 = mid + rightCount + extraRightExprs.size();
 +        extraRightExprs.add(node);
 +        return new RexInputRef(index2, node.getType());
 +      case BOTH:
 +      case EMPTY:
 +      default:
 +        return node;
 +      }
 +    }
 +  }
 +
 +  private void fix(List<RexNode> operands, int before, int after) {
 +    if (before == after) {
 +      return;
 +    }
 +    for (int i = 0; i < operands.size(); i++) 

<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4b0ee63c/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/IIInstanceTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4b0ee63c/jdbc/pom.xml
----------------------------------------------------------------------



[05/19] incubator-kylin git commit: Update license for v0.7.2 release

Posted by lu...@apache.org.
Update license for v0.7.2 release


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/4bf9aec8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/4bf9aec8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/4bf9aec8

Branch: refs/heads/0.7-staging
Commit: 4bf9aec8fa4f81be8e54d8248b59030fe6407bc9
Parents: 091fb3d
Author: Luke Han <lu...@apache.org>
Authored: Thu Jul 9 20:37:04 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Thu Jul 9 20:37:04 2015 +0800

----------------------------------------------------------------------
 .../hydromatic/optiq/runtime/SqlFunctions.java  | 29 ++++++++--------
 .../eigenbase/sql2rel/SqlToRelConverter.java    | 36 +++++++++++---------
 .../kylin/common/debug/BackdoorToggles.java     |  4 +--
 .../kylin/common/persistence/RawResource.java   |  4 +--
 .../org/apache/kylin/common/util/Bytes.java     |  8 ++---
 .../java/org/apache/kylin/common/util/Pair.java |  9 +++--
 .../org/apache/kylin/cube/CubeSegmentsTest.java |  4 +--
 .../invertedindex/IIInstanceTest.java           |  4 +--
 .../invertedindex/invertedindex/LZFTest.java    |  4 +--
 .../apache/kylin/job/tools/RowCounterCLI.java   |  4 +--
 .../kylin/job/tools/HBaseRowDigestTest.java     |  4 +--
 .../measure/fixedlen/FixedHLLCodec.java         |  4 +--
 .../realization/IRealizationConstants.java      |  4 +--
 .../apache/kylin/monitor/ApiRequestParser.java  |  4 +--
 .../java/org/apache/kylin/monitor/Client.java   |  4 +--
 .../org/apache/kylin/monitor/ConfigUtils.java   |  4 +--
 .../org/apache/kylin/monitor/DebugClient.java   |  4 +--
 .../org/apache/kylin/monitor/FileUtils.java     |  4 +--
 .../apache/kylin/monitor/HiveJdbcClient.java    |  4 +--
 .../kylin/monitor/MonitorMetaManager.java       |  4 +--
 .../org/apache/kylin/monitor/QueryParser.java   |  4 +--
 .../org/apache/kylin/monitor/ParseLogTest.java  |  4 +--
 pom.xml                                         |  4 +--
 .../kylin/rest/filter/KylinApiFilter.java       | 17 +++++++++
 .../org/apache/kylin/jdbc/JDBCDriverTest.java   |  4 +--
 src/main/config/assemblies/source-assembly.xml  |  2 ++
 .../checkstyle/checkstyle-java-header.txt       | 21 ++++++------
 src/main/config/checkstyle/checkstyle.xml       | 21 ++----------
 .../storage/hbase/coprocessor/AggrKey.java      | 17 +++++++++
 .../hbase/coprocessor/CoprocessorConstants.java |  3 --
 .../endpoint/generated/IIProtos.java            | 20 +++++++++--
 .../coprocessor/observer/ObserverBehavior.java  | 17 +++++++++
 .../kylin/storage/filter/FilterPerfTest.java    | 17 +++++++++
 33 files changed, 182 insertions(+), 115 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/atopcalcite/src/main/java/net/hydromatic/optiq/runtime/SqlFunctions.java
----------------------------------------------------------------------
diff --git a/atopcalcite/src/main/java/net/hydromatic/optiq/runtime/SqlFunctions.java b/atopcalcite/src/main/java/net/hydromatic/optiq/runtime/SqlFunctions.java
index db99c83..97aa745 100644
--- a/atopcalcite/src/main/java/net/hydromatic/optiq/runtime/SqlFunctions.java
+++ b/atopcalcite/src/main/java/net/hydromatic/optiq/runtime/SqlFunctions.java
@@ -1,24 +1,21 @@
 /*
- * OVERRIDE POINT:
- * - divide(BigDecimal,BigDecimal), was `b0.divide(b1)`, now `b0.divide(b1, MathContext.DECIMAL64);` 
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
+*/
+
 package net.hydromatic.optiq.runtime;
 
 import net.hydromatic.avatica.ByteString;
@@ -42,6 +39,8 @@ import java.util.*;
 import java.util.regex.Pattern;
 
 /**
+ * OVERRIDE POINT:
+ * - divide(BigDecimal,BigDecimal), was `b0.divide(b1)`, now `b0.divide(b1, MathContext.DECIMAL64);`
  * Helper methods to implement SQL functions in generated code.
  *
  * <p>Not present: and, or, not (builtin operators are better, because they

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/atopcalcite/src/main/java/org/eigenbase/sql2rel/SqlToRelConverter.java
----------------------------------------------------------------------
diff --git a/atopcalcite/src/main/java/org/eigenbase/sql2rel/SqlToRelConverter.java b/atopcalcite/src/main/java/org/eigenbase/sql2rel/SqlToRelConverter.java
index dd7ee01..a6e44bf 100644
--- a/atopcalcite/src/main/java/org/eigenbase/sql2rel/SqlToRelConverter.java
+++ b/atopcalcite/src/main/java/org/eigenbase/sql2rel/SqlToRelConverter.java
@@ -1,26 +1,21 @@
 /*
- * OVERRIDE POINT:
- * - getInSubqueryThreshold(), was `20`, now `Integer.MAX_VALUE`
- * - isTrimUnusedFields(), override to false
- * - AggConverter.visit(SqlCall), skip column reading for COUNT(COL), for https://jirap.corp.ebay.com/browse/KYLIN-104
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
+*/
+
 package org.eigenbase.sql2rel;
 
 import java.lang.reflect.Type;
@@ -58,6 +53,13 @@ import com.google.common.collect.*;
 import static org.eigenbase.sql.SqlUtil.stripAs;
 import static org.eigenbase.util.Static.RESOURCE;
 
+/*
+ * OVERRIDE POINT:
+ * - getInSubqueryThreshold(), was `20`, now `Integer.MAX_VALUE`
+ * - isTrimUnusedFields(), override to false
+ * - AggConverter.visit(SqlCall), skip column reading for COUNT(COL), for https://jirap.corp.ebay.com/browse/KYLIN-104
+ */
+
 /**
  * Converts a SQL parse tree (consisting of {@link org.eigenbase.sql.SqlNode}
  * objects) into a relational algebra expression (consisting of

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java b/common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
index e67eb84..3802b18 100644
--- a/common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
+++ b/common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/common/src/main/java/org/apache/kylin/common/persistence/RawResource.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/kylin/common/persistence/RawResource.java b/common/src/main/java/org/apache/kylin/common/persistence/RawResource.java
index 131fcfe..74f88a0 100644
--- a/common/src/main/java/org/apache/kylin/common/persistence/RawResource.java
+++ b/common/src/main/java/org/apache/kylin/common/persistence/RawResource.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/common/src/main/java/org/apache/kylin/common/util/Bytes.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/kylin/common/util/Bytes.java b/common/src/main/java/org/apache/kylin/common/util/Bytes.java
index 3bbc93c..31319ae 100644
--- a/common/src/main/java/org/apache/kylin/common/util/Bytes.java
+++ b/common/src/main/java/org/apache/kylin/common/util/Bytes.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -6,15 +6,15 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
+*/
 package org.apache.kylin.common.util;
 
 import org.apache.commons.logging.Log;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/common/src/main/java/org/apache/kylin/common/util/Pair.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/kylin/common/util/Pair.java b/common/src/main/java/org/apache/kylin/common/util/Pair.java
index bd24401..142b1b1 100644
--- a/common/src/main/java/org/apache/kylin/common/util/Pair.java
+++ b/common/src/main/java/org/apache/kylin/common/util/Pair.java
@@ -1,5 +1,4 @@
-/**
- *
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -7,15 +6,15 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
+*/
 
 package org.apache.kylin.common.util;
 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/cube/src/test/java/org/apache/kylin/cube/CubeSegmentsTest.java
----------------------------------------------------------------------
diff --git a/cube/src/test/java/org/apache/kylin/cube/CubeSegmentsTest.java b/cube/src/test/java/org/apache/kylin/cube/CubeSegmentsTest.java
index fe16fc3..1299f9b 100644
--- a/cube/src/test/java/org/apache/kylin/cube/CubeSegmentsTest.java
+++ b/cube/src/test/java/org/apache/kylin/cube/CubeSegmentsTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/IIInstanceTest.java
----------------------------------------------------------------------
diff --git a/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/IIInstanceTest.java b/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/IIInstanceTest.java
index 792d674..edf9dd6 100644
--- a/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/IIInstanceTest.java
+++ b/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/IIInstanceTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/LZFTest.java
----------------------------------------------------------------------
diff --git a/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/LZFTest.java b/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/LZFTest.java
index c85fae1..4efdf23 100644
--- a/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/LZFTest.java
+++ b/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/LZFTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/job/src/main/java/org/apache/kylin/job/tools/RowCounterCLI.java
----------------------------------------------------------------------
diff --git a/job/src/main/java/org/apache/kylin/job/tools/RowCounterCLI.java b/job/src/main/java/org/apache/kylin/job/tools/RowCounterCLI.java
index 524c480..c586d4f 100644
--- a/job/src/main/java/org/apache/kylin/job/tools/RowCounterCLI.java
+++ b/job/src/main/java/org/apache/kylin/job/tools/RowCounterCLI.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/job/src/test/java/org/apache/kylin/job/tools/HBaseRowDigestTest.java
----------------------------------------------------------------------
diff --git a/job/src/test/java/org/apache/kylin/job/tools/HBaseRowDigestTest.java b/job/src/test/java/org/apache/kylin/job/tools/HBaseRowDigestTest.java
index ebca8f0..a131608 100644
--- a/job/src/test/java/org/apache/kylin/job/tools/HBaseRowDigestTest.java
+++ b/job/src/test/java/org/apache/kylin/job/tools/HBaseRowDigestTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/metadata/src/main/java/org/apache/kylin/metadata/measure/fixedlen/FixedHLLCodec.java
----------------------------------------------------------------------
diff --git a/metadata/src/main/java/org/apache/kylin/metadata/measure/fixedlen/FixedHLLCodec.java b/metadata/src/main/java/org/apache/kylin/metadata/measure/fixedlen/FixedHLLCodec.java
index f74b045..200fa1b 100644
--- a/metadata/src/main/java/org/apache/kylin/metadata/measure/fixedlen/FixedHLLCodec.java
+++ b/metadata/src/main/java/org/apache/kylin/metadata/measure/fixedlen/FixedHLLCodec.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/metadata/src/main/java/org/apache/kylin/metadata/realization/IRealizationConstants.java
----------------------------------------------------------------------
diff --git a/metadata/src/main/java/org/apache/kylin/metadata/realization/IRealizationConstants.java b/metadata/src/main/java/org/apache/kylin/metadata/realization/IRealizationConstants.java
index b09b84c..174e127 100644
--- a/metadata/src/main/java/org/apache/kylin/metadata/realization/IRealizationConstants.java
+++ b/metadata/src/main/java/org/apache/kylin/metadata/realization/IRealizationConstants.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/monitor/src/main/java/org/apache/kylin/monitor/ApiRequestParser.java
----------------------------------------------------------------------
diff --git a/monitor/src/main/java/org/apache/kylin/monitor/ApiRequestParser.java b/monitor/src/main/java/org/apache/kylin/monitor/ApiRequestParser.java
index 0321549..d634044 100644
--- a/monitor/src/main/java/org/apache/kylin/monitor/ApiRequestParser.java
+++ b/monitor/src/main/java/org/apache/kylin/monitor/ApiRequestParser.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/monitor/src/main/java/org/apache/kylin/monitor/Client.java
----------------------------------------------------------------------
diff --git a/monitor/src/main/java/org/apache/kylin/monitor/Client.java b/monitor/src/main/java/org/apache/kylin/monitor/Client.java
index eadce54..0289640 100644
--- a/monitor/src/main/java/org/apache/kylin/monitor/Client.java
+++ b/monitor/src/main/java/org/apache/kylin/monitor/Client.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/monitor/src/main/java/org/apache/kylin/monitor/ConfigUtils.java
----------------------------------------------------------------------
diff --git a/monitor/src/main/java/org/apache/kylin/monitor/ConfigUtils.java b/monitor/src/main/java/org/apache/kylin/monitor/ConfigUtils.java
index f38b701..9371ecb 100644
--- a/monitor/src/main/java/org/apache/kylin/monitor/ConfigUtils.java
+++ b/monitor/src/main/java/org/apache/kylin/monitor/ConfigUtils.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/monitor/src/main/java/org/apache/kylin/monitor/DebugClient.java
----------------------------------------------------------------------
diff --git a/monitor/src/main/java/org/apache/kylin/monitor/DebugClient.java b/monitor/src/main/java/org/apache/kylin/monitor/DebugClient.java
index a7230e6..a5aad83 100644
--- a/monitor/src/main/java/org/apache/kylin/monitor/DebugClient.java
+++ b/monitor/src/main/java/org/apache/kylin/monitor/DebugClient.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/monitor/src/main/java/org/apache/kylin/monitor/FileUtils.java
----------------------------------------------------------------------
diff --git a/monitor/src/main/java/org/apache/kylin/monitor/FileUtils.java b/monitor/src/main/java/org/apache/kylin/monitor/FileUtils.java
index 555409b..c42bab7 100644
--- a/monitor/src/main/java/org/apache/kylin/monitor/FileUtils.java
+++ b/monitor/src/main/java/org/apache/kylin/monitor/FileUtils.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/monitor/src/main/java/org/apache/kylin/monitor/HiveJdbcClient.java
----------------------------------------------------------------------
diff --git a/monitor/src/main/java/org/apache/kylin/monitor/HiveJdbcClient.java b/monitor/src/main/java/org/apache/kylin/monitor/HiveJdbcClient.java
index 71a3a68..a7d3271 100644
--- a/monitor/src/main/java/org/apache/kylin/monitor/HiveJdbcClient.java
+++ b/monitor/src/main/java/org/apache/kylin/monitor/HiveJdbcClient.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/monitor/src/main/java/org/apache/kylin/monitor/MonitorMetaManager.java
----------------------------------------------------------------------
diff --git a/monitor/src/main/java/org/apache/kylin/monitor/MonitorMetaManager.java b/monitor/src/main/java/org/apache/kylin/monitor/MonitorMetaManager.java
index c01cf66..22b0d2d 100644
--- a/monitor/src/main/java/org/apache/kylin/monitor/MonitorMetaManager.java
+++ b/monitor/src/main/java/org/apache/kylin/monitor/MonitorMetaManager.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/monitor/src/main/java/org/apache/kylin/monitor/QueryParser.java
----------------------------------------------------------------------
diff --git a/monitor/src/main/java/org/apache/kylin/monitor/QueryParser.java b/monitor/src/main/java/org/apache/kylin/monitor/QueryParser.java
index 8b910a8..5a1c8c8 100644
--- a/monitor/src/main/java/org/apache/kylin/monitor/QueryParser.java
+++ b/monitor/src/main/java/org/apache/kylin/monitor/QueryParser.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/monitor/src/test/java/org/apache/kylin/monitor/ParseLogTest.java
----------------------------------------------------------------------
diff --git a/monitor/src/test/java/org/apache/kylin/monitor/ParseLogTest.java b/monitor/src/test/java/org/apache/kylin/monitor/ParseLogTest.java
index 7b4e7b7..0b2d7a5 100644
--- a/monitor/src/test/java/org/apache/kylin/monitor/ParseLogTest.java
+++ b/monitor/src/test/java/org/apache/kylin/monitor/ParseLogTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5948762..5c75374 100644
--- a/pom.xml
+++ b/pom.xml
@@ -586,7 +586,7 @@
                     <skip>true</skip>
                 </configuration>
             </plugin>
-            <!-- Checkstyle Plugin
+            <!-- Checkstyle Plugin -->
             <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-checkstyle-plugin</artifactId>
@@ -608,7 +608,7 @@
                         </execution>
                     </executions>
                 </plugin>
-                -->
+
         </plugins>
 
     </build>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/server/src/main/java/org/apache/kylin/rest/filter/KylinApiFilter.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/filter/KylinApiFilter.java b/server/src/main/java/org/apache/kylin/rest/filter/KylinApiFilter.java
index 035b57d..257adfc 100644
--- a/server/src/main/java/org/apache/kylin/rest/filter/KylinApiFilter.java
+++ b/server/src/main/java/org/apache/kylin/rest/filter/KylinApiFilter.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.rest.filter;
 
 import com.github.isrsal.logging.RequestWrapper;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/server/src/test/java/org/apache/kylin/jdbc/JDBCDriverTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/jdbc/JDBCDriverTest.java b/server/src/test/java/org/apache/kylin/jdbc/JDBCDriverTest.java
index 81e24ae..23cb7ea 100644
--- a/server/src/test/java/org/apache/kylin/jdbc/JDBCDriverTest.java
+++ b/server/src/test/java/org/apache/kylin/jdbc/JDBCDriverTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/src/main/config/assemblies/source-assembly.xml
----------------------------------------------------------------------
diff --git a/src/main/config/assemblies/source-assembly.xml b/src/main/config/assemblies/source-assembly.xml
index 9d658eb..3b97600 100644
--- a/src/main/config/assemblies/source-assembly.xml
+++ b/src/main/config/assemblies/source-assembly.xml
@@ -18,7 +18,9 @@ limitations under the License.
 <assembly>
     <id>source-release</id>
     <formats>
+        <!--
         <format>zip</format>
+        -->
         <format>tar.gz</format>
     </formats>
     <fileSets>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/src/main/config/checkstyle/checkstyle-java-header.txt
----------------------------------------------------------------------
diff --git a/src/main/config/checkstyle/checkstyle-java-header.txt b/src/main/config/checkstyle/checkstyle-java-header.txt
index 2a42971..1c4b8fd 100644
--- a/src/main/config/checkstyle/checkstyle-java-header.txt
+++ b/src/main/config/checkstyle/checkstyle-java-header.txt
@@ -1,16 +1,17 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
+*/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/src/main/config/checkstyle/checkstyle.xml
----------------------------------------------------------------------
diff --git a/src/main/config/checkstyle/checkstyle.xml b/src/main/config/checkstyle/checkstyle.xml
index 8d46977..eab23dc 100644
--- a/src/main/config/checkstyle/checkstyle.xml
+++ b/src/main/config/checkstyle/checkstyle.xml
@@ -30,30 +30,15 @@ limitations under the License.
 
 <module name="Checker">
     <property name="localeLanguage" value="en"/>
+    <property name="charset" value="UTF-8"/>
+
 
     <!-- Checks for headers -->
     <!-- See http://checkstyle.sf.net/config_header.html -->
     <!-- Verify that EVERY source file has the appropriate license -->
     <module name="Header">
         <property name="headerFile" value="${checkstyle.header.file}"/>
+        <property name="fileExtensions" value="java"/>
     </module>
 
-    <!-- Setup special comments to suppress specific checks from source files -->
-    <module name="SuppressionCommentFilter">
-        <property name="offCommentFormat" value="CHECKSTYLE\: stop ([\w\|]+)"/>
-        <property name="onCommentFormat"  value="CHECKSTYLE\: resume ([\w\|]+)"/>
-        <property name="checkFormat"      value="$1"/>
-    </module>
-
-    <!-- Turn off all checks between OFF and ON -->
-    <module name="SuppressionCommentFilter">
-        <property name="offCommentFormat" value="CHECKSTYLE\: OFF"/>
-        <property name="onCommentFormat"  value="CHECKSTYLE\: ON"/>
-    </module>
-
-    <!-- Turn off checks for the next N lines. -->
-    <module name="SuppressWithNearbyCommentFilter">
-        <property name="commentFormat" value="CHECKSTYLE: +IGNORE (\d+)"/>
-        <property name="influenceFormat" value="$1"/>
-    </module>
 </module>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/AggrKey.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/AggrKey.java b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/AggrKey.java
index 7309f61..d1dc4d3 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/AggrKey.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/AggrKey.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.storage.hbase.coprocessor;
 
 import com.google.common.collect.Lists;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/CoprocessorConstants.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/CoprocessorConstants.java b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/CoprocessorConstants.java
index 7efb283..34581fc 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/CoprocessorConstants.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/CoprocessorConstants.java
@@ -18,9 +18,6 @@
 
 package org.apache.kylin.storage.hbase.coprocessor;
 
-/**
- * Created by Hongbin Ma(Binmahone) on 11/26/14.
- */
 public class CoprocessorConstants {
     public static final int SERIALIZE_BUFFER_SIZE = 65536;
     public static final int METRIC_SERIALIZE_BUFFER_SIZE = 65536;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/generated/IIProtos.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/generated/IIProtos.java b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/generated/IIProtos.java
index 66ed6c5..640dd9a 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/generated/IIProtos.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/generated/IIProtos.java
@@ -1,6 +1,20 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/protobuf/II.proto
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.storage.hbase.coprocessor.endpoint.generated;
 
 public final class IIProtos {

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/observer/ObserverBehavior.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/observer/ObserverBehavior.java b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/observer/ObserverBehavior.java
index 62c5bac..ba616f8 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/observer/ObserverBehavior.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/observer/ObserverBehavior.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.storage.hbase.coprocessor.observer;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4bf9aec8/storage/src/test/java/org/apache/kylin/storage/filter/FilterPerfTest.java
----------------------------------------------------------------------
diff --git a/storage/src/test/java/org/apache/kylin/storage/filter/FilterPerfTest.java b/storage/src/test/java/org/apache/kylin/storage/filter/FilterPerfTest.java
index e8826cd..7457b49 100644
--- a/storage/src/test/java/org/apache/kylin/storage/filter/FilterPerfTest.java
+++ b/storage/src/test/java/org/apache/kylin/storage/filter/FilterPerfTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.storage.filter;
 
 import com.google.common.collect.Iterables;



[12/19] incubator-kylin git commit: KYLIN-884 restructure docs and website

Posted by lu...@apache.org.
KYLIN-884 restructure docs and website


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/37037d04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/37037d04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/37037d04

Branch: refs/heads/0.7-staging
Commit: 37037d048922145401c417f62c9f43255b58e68e
Parents: 9f64637
Author: Luke Han <lu...@apache.org>
Authored: Fri Jul 10 14:57:08 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Fri Jul 10 14:57:08 2015 +0800

----------------------------------------------------------------------
 docs/website/README.md     | 49 +++++++++++++++++++++++++++++++++++++++--
 docs/website/docs/index.md |  5 +++++
 2 files changed, 52 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/37037d04/docs/website/README.md
----------------------------------------------------------------------
diff --git a/docs/website/README.md b/docs/website/README.md
index fbb2844..b6e7a63 100644
--- a/docs/website/README.md
+++ b/docs/website/README.md
@@ -1,2 +1,47 @@
-# kylin.io
-kylin.io site with Jekyll and markdown
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+-->
+
+# Apache Kylin website  
+This directory contains the source code for the Apache Kylin (incubating) website:
+[http://kyin.incubator.apache.org](http://kylin.incubator.apache.org/).
+
+## Setup
+
+1. `cd docs/website`
+2. `svn co https://svn.apache.org/repos/asf/incubator/kylin/site _site`
+3. `sudo apt-get install rubygems ruby2.1-dev zlib1g-dev` (linux)
+4. `sudo gem install bundler github-pages jekyll`
+5. `bundle install`
+
+## Running locally  
+Before opening a pull request or push to git repo, you can preview changes from your local box with following:
+
+1. `cd docs/website`
+2. `jekyll s`
+3. Open [http://localhost:4000](http://localhost:4000)
+
+## Pushing to site (for committer only)  
+1. `cd docs/website/_site`
+2. `svn status`
+3. You'll need to `svn add` any new files
+4. `svn commit -m 'UPDATE MESSAGE'`
+
+Within a few minutes, svnpubsub should kick in and you'll be able to
+see the results at
+[http://kylin.incubator.apache.org](http://kylin.incubator.apache.org/).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/37037d04/docs/website/docs/index.md
----------------------------------------------------------------------
diff --git a/docs/website/docs/index.md b/docs/website/docs/index.md
index b073db3..043501d 100644
--- a/docs/website/docs/index.md
+++ b/docs/website/docs/index.md
@@ -46,3 +46,8 @@ Advanced Topics
 
 2.[Job Engine Design](docs/JobEngine/Design.md)
 
+
+## Disclaimer
+
+Apache Kylin is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
+


[09/19] incubator-kylin git commit: update release notes

Posted by lu...@apache.org.
update release notes


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/23d1cb89
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/23d1cb89
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/23d1cb89

Branch: refs/heads/0.7-staging
Commit: 23d1cb8924437b40d5cde7ad04ec1cd7ab246edb
Parents: 9d8ccb1
Author: Luke Han <lu...@apache.org>
Authored: Fri Jul 10 10:25:45 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Fri Jul 10 10:25:45 2015 +0800

----------------------------------------------------------------------
 docs/release_notes.md | 50 +++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 47 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/23d1cb89/docs/release_notes.md
----------------------------------------------------------------------
diff --git a/docs/release_notes.md b/docs/release_notes.md
index 5732c09..b91f56b 100644
--- a/docs/release_notes.md
+++ b/docs/release_notes.md
@@ -17,15 +17,59 @@ limitations under the License.
 
 # Apache Kylin Release Notes
 
-## v0.7.1 (First Apache Release) - 2015-06-10
+## v0.7.2-incubating  
+_Tag:_ [kylin-0.7.2-incubating](https://github.com/apache/incubator-kylin/tree/kylin-0.7.2-incubating)
+
+
+__Detail JIRA and notes will coming after verify__
+
+** Sub-task  
+
+    * [KYLIN-812] - Upgrade to Calcite 0.9.2
+
+** Bug  
+
+    * [KYLIN-457] - "ERROR Could not instantiate appender" from log4j when tomcat startup 
+    * [KYLIN-514] - Error message is not helpful to user when doing something in Jason Editor window
+    * [KYLIN-518] - Cannot select Right join type if current join type is Left join type
+    * [KYLIN-598] - Kylin detecting hive table delim failure
+    * [KYLIN-632] - "kylin.sh stop" doesn't check whether KYLIN_HOME was set
+    * [KYLIN-660] - Make configurable of dictionary cardinality cap
+    * [KYLIN-693] - Couldn't change a cube's name after it be created
+    * [KYLIN-814] - Duplicate columns error for subqueries on fact table
+    * [KYLIN-819] - Fix necessary ColumnMetaData order for Calcite (Optic)
+    * [KYLIN-824] - Cube Build fails if lookup table doesn't have any files under HDFS location
+    * [KYLIN-829] - Cube "Actions" shows "NA"; but after expand the "access" tab, the button shows up
+    * [KYLIN-830] - Cube merge failed after migrating from v0.6 to v0.7
+    * [KYLIN-831] - Kylin report "Column 'ABC' not found in table 'TABLE' while executing SQL", when that column is FK but not define as a dimension
+    * [KYLIN-840] - HBase table compress not enabled even LZO is installed
+    * [KYLIN-847] - "select * from fact" does not work on 0.7 branch
+    * [KYLIN-848] - Couldn't resume or discard a cube job
+    * [KYLIN-849] - Couldn't query metrics on lookup table PK
+    * [KYLIN-865] - Cube has been built but couldn't query; In log it said "Realization 'CUBE.CUBE_NAME' defined under project PROJECT_NAME is not found
+    * [KYLIN-873] - cancel button does not work when [resume][discard] job
+
+## v0.7.1-incubating (First Apache Release) - 2015-06-10  
 _Tag:_ [kylin-0.7.1-incubating](https://github.com/apache/incubator-kylin/tree/kylin-0.7.1-incubating)
 
-This is first Apache Kylin release, majority changes, bug fixes and otehers as below:
+Apache Kylin v0.7.1-incubating has rolled out on June 10, 2015. This is also the first Apache release after join incubating. 
+
+To download this release, please visit: [http://kylin.incubator.apache.org/download/](http://kylin.incubator.apache.org/download/), there are source code package, binary package, ODBC driver and installation guide avaliable.
+
+Any problem or issue, please send to Apache Kylin mailing list: [dev@kylin.incubator.apache.org](mailto:dev@kylin.incubator.apache.org)
+
+Or, report to Apache Kylin JIRA project: [https://issues.apache.org/jira/browse/KYLIN](https://issues.apache.org/jira/browse/KYLIN)
+
 
 __Main Changes:__
 
 * Package renamed from com.kylinolap to org.apache.kylin
-* Binary pacakge avaliable download from: [http://kylin.incubator.apache.org/download](http://kylin.incubator.apache.org/download/)
+* Code cleaned up to apply Apache License policy
+* Easy install and setup with bunch of scripts and automation
+* Job engine refactor to be generic job manager for all jobs, and improved efficiency
+* Support Hive database other than 'default'
+* JDBC driver avaliable for client to interactive with Kylin server
+* Binary pacakge avaliable download 
 
 __New Feature__
 


[03/19] incubator-kylin git commit: Merge branch 'v0.7.2-release' of https://git-wip-us.apache.org/repos/asf/incubator-kylin into v0.7.2-release

Posted by lu...@apache.org.
Merge branch 'v0.7.2-release' of https://git-wip-us.apache.org/repos/asf/incubator-kylin into v0.7.2-release


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/6e97e246
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/6e97e246
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/6e97e246

Branch: refs/heads/0.7-staging
Commit: 6e97e24674ea2c7c9ecdafdd62e700c92f3bf095
Parents: d6a188d 16ca542
Author: Luke Han <lu...@apache.org>
Authored: Tue Jul 7 20:29:25 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Tue Jul 7 20:29:25 2015 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/kylin/common/util/CliCommandExecutor.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[10/19] incubator-kylin git commit: KYLIN-884 restructure docs and website

Posted by lu...@apache.org.
KYLIN-884 restructure docs and website


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/9392f502
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/9392f502
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/9392f502

Branch: refs/heads/0.7-staging
Commit: 9392f5022ad527325615fb754b584a0a83ad8b25
Parents: 23d1cb8
Author: Luke Han <lu...@apache.org>
Authored: Fri Jul 10 14:29:00 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Fri Jul 10 14:29:00 2015 +0800

----------------------------------------------------------------------
 docs/website/docs/index.md | 128 ++++++++++++++--------------------------
 1 file changed, 43 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9392f502/docs/website/docs/index.md
----------------------------------------------------------------------
diff --git a/docs/website/docs/index.md b/docs/website/docs/index.md
index 75e984a..b073db3 100644
--- a/docs/website/docs/index.md
+++ b/docs/website/docs/index.md
@@ -3,88 +3,46 @@ layout: docs
 title: Docs
 ---
 
-<main id="main" >
-  <div class="container" >
-    <div id="zero" class=" main" >
-      <header style=" padding:1.0em 0 4em 0">
-        <div class="container" >
-
-         
-     <div id="content-container" class="animated fadeIn">
-       
-
-<p class="content-header" >What should I use Kylin for?</p>
-<p class="content-p">
-If you want to do multi-dimension analysis on large data sets (billion+ rows) with low query latency (sub-seconds), Kylin is a good option. Kylin also provides good integration with existing BI tools (e.g Tableau).
-</p>
-
-<hr/>
- 
-<p class="content-header">Why existing SQL-on-Hadoop solutions fall short?</p>
-<p class="content-p">
-The existing SQL-on-Hadoop needs to scan partial or whole data set to answer a user query. Due to large data scan, many queries are very slow (minute+ latency).  
-</p>
-<hr/>
- 
-<p class="content-header">What is MOLAP/ROLAP?</p>
-<p class="content-p">
-MOLAP (Multi-dimensional OLAP) is to pre-compute data along different dimensions of interest and store resultant values in the cube. MOLAP is much faster but is inflexible.
-ROLAP (Relational-OLAP) is to use star or snow-flake schema to do runtime aggregation. ROLAP is flexible but much slower.
-</p>
-<hr/>
-
-<p class="content-header">How does Kylin support ROLAP/MOLAP?</p>
-<p class="content-p">
-Kylin builds data cube (MOLAP) from hive table (ROLAP) according to the metadata definition.
-If the query can be fulfilled by data cube, Kylin will route the query to data cube that is MOLAP.
-If the query can’t be fulfilled by data cube, Kylin will route the query to hive table that is ROLAP.
-Basically, you can think Kylin as HOLAP on top of MOLAP and ROLAP. 
-</p>
-<hr/>
-<p class="content-header">What does a Kylin query look like?</p>
-<p class="content-p">
-Kylin supports join, projection, filter, aggregation, groups and sub-query. For example:
-<div align="left">
-
-<pre class="prettyprint" style="margin-top:1em;">select test_cal_dt.week_beg_dt, test_category.lv1_categ, test_category.lv2_categ, test_kylin_fact.format_name, test_sites.site_name, sum(test_kylin_fact.price) as total_price, count(*) as total_count from test_kylin_fact left join test_cal_dt on test_kylin_fact.cal_dt = test_cal_dt.cal_dt left join test_category on test_kylin_fact.leaf_categ_id = test_category.leaf_categ_id and test_kylin_fact.site_id = test_category.site_id left join test_sites on test_kylin_fact.site_id = test_sites.site_id where test_kylin_fact.seller_id = 123456 or test_kylin_fact.format_name = 'New' group by test_cal_dt.week_beg_dt, test_category.lv1_categ, test_category.lv2_categ, test_kylin_fact.format_name, test_sites.site_name</pre>
-</div>
-<hr/>
-
-<p class="content-header">What Hadoop components does it work with?</p>
-<p class="content-p">
-Kylin depends on HDFS, MapReduce, Hive and HBase.
-Hive and MapReduce is used for cube building. Hive is used for pre-join and MapReduce is used for pre-aggregation.
-HDFS is used to store intermediated files during cube building.
-HBase is used to store data cube and answer the query. HBase coprocessor is also used for query processing.
-</p>
-<hr/>
-
-<!-- Migrate wiki to here 
-<p class="content-header">Where can I find the technical details about Kylin?</p>
-<p class="content-p"><a href="http://www.slideshare.net/XuJiang2/kylin-hadoop-olap-engine" target="_blank">Kylin Wiki</a></p>
-
--->
-
-     </div>
-         
-         </div><!--end of rightcontent-->
-         
-         </div><!--end of row-->
-        </div>
-        <!-- /container --> 
-        
-        
-        
-      </header>
-    </div>
-    <!-- / section --> 
-  </div>
-  <!-- /container -->
- 
-
-  
-
-      
-    </header>
-  </section>
-</main>
+Welcome to Apache Kylin
+------------  
+> Extreme OLAP Engine for Big Data
+
+Apache Kylin is an open source Distributed Analytics Engine, contributed by eBay Inc., provides SQL interface and multi-dimensional analysis (OLAP) on Hadoop supporting extremely large datasets.
+
+Installation 
+------------  
+Please follow  installation & tutorial to start with Kylin.
+
+Advanced Topics
+-------  
+####Connectivity
+1.[How to use kylin remote jdbc driver](docs/Tutorial/How to use kylin remote jdbc driver.md)
+
+2.[SQL Reference](https://github.com/apache/incubator-calcite/blob/master/doc/reference.md)
+
+####REST
+
+1.[Kylin Restful API List](docs/REST/Kylin Restful API List.md)
+
+2.[Build Cube with Restful API](docs/REST/Build Cube with Restful API.md)
+
+3.[How to consume Kylin REST API in javascript](docs/REST/How to consume Kylin REST API in javascript.md)
+
+####Operations
+1.[Kylin Metadata Store](docs/Operations/Kylin Metadata Store.md)
+
+2.[Export Kylin HBase data](docs/Operations/Export Kylin HBase data.md)
+
+3.[Advanced settings of Kylin environment](docs/Operations/Advanced settings of Kylin environment.md)
+
+####Test
+
+1.[Run Kylin test case with HBase Mini Cluster](docs/Test/Run Kylin test case with HBase Mini Cluster.md)
+
+
+####Technial Details
+
+1.[New meta data model structure](docs/TechInside/New meta data model structure.md)
+
+2.[Job Engine Design](docs/JobEngine/Design.md)
+


[18/19] incubator-kylin git commit: Fix license issue with 0.7.2 release

Posted by lu...@apache.org.
Fix license issue with 0.7.2 release


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/9de4706e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/9de4706e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/9de4706e

Branch: refs/heads/0.7-staging
Commit: 9de4706eb833ba77a6699dae54bf53026daf62b2
Parents: a3cd0e6
Author: Luke Han <lu...@apache.org>
Authored: Mon Jul 13 18:35:17 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Mon Jul 13 18:35:17 2015 +0800

----------------------------------------------------------------------
 .../invertedindex/InvertedIndexLocalTest.java   |  4 +-
 .../java/org/apache/kylin/jdbc/KylinClient.java | 17 ++++
 .../kylin/jdbc/KylinPreparedStatement.java      | 17 ++++
 .../metadata/realization/SQLDigestUtil.java     | 17 ++++
 .../metadata/tuple/CompoundTupleIterator.java   | 17 ++++
 pom.xml                                         | 86 ++------------------
 .../AdjustForWeeklyMatchedRealization.java      |  4 +-
 src/main/config/assemblies/source-assembly.xml  |  3 +-
 .../kylin/storage/hybrid/HybridInstance.java    | 17 ++++
 .../kylin/storage/hybrid/HybridManager.java     | 17 ++++
 .../storage/hybrid/HybridStorageEngine.java     | 17 ++++
 .../kylin/storage/hybrid/HybridManagerTest.java | 17 ++++
 12 files changed, 147 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/InvertedIndexLocalTest.java
----------------------------------------------------------------------
diff --git a/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/InvertedIndexLocalTest.java b/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/InvertedIndexLocalTest.java
index 45eb9b5..8ca9c60 100644
--- a/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/InvertedIndexLocalTest.java
+++ b/invertedindex/src/test/java/org/apache/kylin/invertedindex/invertedindex/InvertedIndexLocalTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/jdbc/src/main/java/org/apache/kylin/jdbc/KylinClient.java
----------------------------------------------------------------------
diff --git a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinClient.java b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinClient.java
index 3d0007e..8f6c42f 100644
--- a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinClient.java
+++ b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinClient.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.jdbc;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/jdbc/src/main/java/org/apache/kylin/jdbc/KylinPreparedStatement.java
----------------------------------------------------------------------
diff --git a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinPreparedStatement.java b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinPreparedStatement.java
index b14865b..1900969 100644
--- a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinPreparedStatement.java
+++ b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinPreparedStatement.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.jdbc;
 
 import java.io.InputStream;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/metadata/src/main/java/org/apache/kylin/metadata/realization/SQLDigestUtil.java
----------------------------------------------------------------------
diff --git a/metadata/src/main/java/org/apache/kylin/metadata/realization/SQLDigestUtil.java b/metadata/src/main/java/org/apache/kylin/metadata/realization/SQLDigestUtil.java
index 72e3b10..83052c0 100644
--- a/metadata/src/main/java/org/apache/kylin/metadata/realization/SQLDigestUtil.java
+++ b/metadata/src/main/java/org/apache/kylin/metadata/realization/SQLDigestUtil.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.metadata.realization;
 
 import com.google.common.base.Function;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/metadata/src/main/java/org/apache/kylin/metadata/tuple/CompoundTupleIterator.java
----------------------------------------------------------------------
diff --git a/metadata/src/main/java/org/apache/kylin/metadata/tuple/CompoundTupleIterator.java b/metadata/src/main/java/org/apache/kylin/metadata/tuple/CompoundTupleIterator.java
index f5d8dd6..badc720 100644
--- a/metadata/src/main/java/org/apache/kylin/metadata/tuple/CompoundTupleIterator.java
+++ b/metadata/src/main/java/org/apache/kylin/metadata/tuple/CompoundTupleIterator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.metadata.tuple;
 
 import com.google.common.base.Preconditions;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 761538c..d151ad0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -686,6 +686,7 @@
                         <configuration>
                             <numUnapprovedLicenses>0</numUnapprovedLicenses>
                             <excludes>
+                                <exclude>DEPENDENCIES</exclude>
                                 <exclude>.idea/**</exclude>
                                 <exclude>.git/**</exclude>
                                 <exclude>.settings/**</exclude>
@@ -705,6 +706,9 @@
                                 <!-- generated files -->
                                 <exclude>**/target/**</exclude>
                                 <exclude>lib/**</exclude>
+                                <!--Job's Test Data-->
+                                <exclude>job/src/test/resources/data/**</exclude>
+
                                 <!-- Kylin's website content -->
                                 <exclude>**/.sass-cache/**</exclude>
 
@@ -880,87 +884,7 @@
                             <argLine>-Xms1G -Xmx4G -XX:PermSize=128M -XX:MaxPermSize=512M</argLine>
                         </configuration>
                     </plugin>
-                    <!-- Apache-RAT checks for files without headers.
-                         If run on a messy developer's sandbox, it will fail.
-                         This serves as a reminder to only build a release in a clean
-                         sandbox! -->
-                    <plugin>
-                        <groupId>org.apache.rat</groupId>
-                        <artifactId>apache-rat-plugin</artifactId>
-                        <configuration>
-                            <numUnapprovedLicenses>0</numUnapprovedLicenses>
-                            <excludes>
-                                <exclude>.idea/**</exclude>
-                                <exclude>.git/**</exclude>
-                                <exclude>.settings/**</exclude>
-                                <!-- text files without comments -->
-                                <exclude>**/*.csv</exclude>
-                                <exclude>**/*.json</exclude>
-                                <exclude>**/*.md</exclude>
-                                <!-- binary files -->
-                                <exclude>**/*.dict</exclude>
-                                <exclude>**/*.dic</exclude>
-                                <exclude>**/*.snapshot</exclude>
-                                <exclude>**/*.pdf</exclude>
-                                <exclude>**/*.log</exclude>
-
-                                <exclude>**/.checkstyle</exclude>
-
-                                <!-- generated files -->
-                                <exclude>**/target/**</exclude>
-                                <exclude>lib/**</exclude>
-                                <!-- Kylin's website content -->
-                                <exclude>**/.sass-cache/**</exclude>
-
-                                <exclude>docs/website/**</exclude>
-
-                                <!-- tomcat package -->
-                                <exclude>tomcat/**</exclude>
-                                <!-- front end libary and generated files -->
-                                <exclude>webapp/node_modules/**</exclude>
-                                <exclude>webapp/dist/**</exclude>
-                                <exclude>webapp/app/components/**</exclude>
-                                <!-- json configuration file-->
-                                <exclude>webapp/.bowerrc</exclude>
-                                <exclude>webapp/.jshintrc</exclude>
-                                <!-- generated dict files -->
-                                <exclude>dictionary/metastore_db/**</exclude>
-
-                                <!-- MIT license -->
-                                <exclude>webapp/app/css/AdminLTE-fonts.css</exclude>
-                                <exclude>webapp/app/css/AdminLTE.css</exclude>
-
-                                <!-- jdbc log -->
-                                <exclude>jdbc/kylin_jdbc.log*</exclude>
-
-                                <!-- HBase MiniCluster Testing Data, for testing only -->
-                                <exclude>examples/test_case_data/minicluster/hbase-export.tar.gz</exclude>
-                                <exclude>examples/test_case_data/**/*.xml</exclude>
-
-                            </excludes>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <phase>verify</phase>
-                                <goals>
-                                    <goal>check</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                        <dependencies>
-                            <dependency>
-                                <groupId>org.apache.maven.doxia</groupId>
-                                <artifactId>doxia-core</artifactId>
-                                <version>1.6</version>
-                                <exclusions>
-                                    <exclusion>
-                                        <groupId>xerces</groupId>
-                                        <artifactId>xercesImpl</artifactId>
-                                    </exclusion>
-                                </exclusions>
-                            </dependency>
-                        </dependencies>
-                    </plugin>
+                    
                     <plugin>
                         <groupId>net.ju-n.maven.plugins</groupId>
                         <artifactId>checksum-maven-plugin</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/query/src/main/java/org/apache/kylin/query/routing/RoutingRules/AdjustForWeeklyMatchedRealization.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/routing/RoutingRules/AdjustForWeeklyMatchedRealization.java b/query/src/main/java/org/apache/kylin/query/routing/RoutingRules/AdjustForWeeklyMatchedRealization.java
index 8872a7d..2c2ac4a 100644
--- a/query/src/main/java/org/apache/kylin/query/routing/RoutingRules/AdjustForWeeklyMatchedRealization.java
+++ b/query/src/main/java/org/apache/kylin/query/routing/RoutingRules/AdjustForWeeklyMatchedRealization.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/src/main/config/assemblies/source-assembly.xml
----------------------------------------------------------------------
diff --git a/src/main/config/assemblies/source-assembly.xml b/src/main/config/assemblies/source-assembly.xml
index c26123e..96a56a1 100644
--- a/src/main/config/assemblies/source-assembly.xml
+++ b/src/main/config/assemblies/source-assembly.xml
@@ -16,10 +16,11 @@ See the License for the specific language governing permissions and
 limitations under the License.
 -->
 <assembly>
-    <id>source-release</id>
+    <id>src</id>
     <formats>
         <format>tar.gz</format>
     </formats>
+    
     <fileSets>
         <!-- main project directory structure -->
         <fileSet>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridInstance.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridInstance.java b/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridInstance.java
index e7071f9..5079d99 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridInstance.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridInstance.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.storage.hybrid;
 
 import com.fasterxml.jackson.annotation.JsonAutoDetect;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridManager.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridManager.java b/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridManager.java
index 8373cf1..6b4f7b9 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridManager.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridManager.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.storage.hybrid;
 
 import org.apache.commons.lang3.StringUtils;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridStorageEngine.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridStorageEngine.java b/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridStorageEngine.java
index 11ad211..8b503fb 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridStorageEngine.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hybrid/HybridStorageEngine.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.storage.hybrid;
 
 import com.google.common.collect.Lists;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9de4706e/storage/src/test/java/org/apache/kylin/storage/hybrid/HybridManagerTest.java
----------------------------------------------------------------------
diff --git a/storage/src/test/java/org/apache/kylin/storage/hybrid/HybridManagerTest.java b/storage/src/test/java/org/apache/kylin/storage/hybrid/HybridManagerTest.java
index 00b68cf..110c49f 100644
--- a/storage/src/test/java/org/apache/kylin/storage/hybrid/HybridManagerTest.java
+++ b/storage/src/test/java/org/apache/kylin/storage/hybrid/HybridManagerTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.storage.hybrid;
 
 import org.apache.kylin.common.util.JsonUtil;


[06/19] incubator-kylin git commit: only using .tar.gz for package source code

Posted by lu...@apache.org.
only using .tar.gz for package source code


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/e0c03d95
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/e0c03d95
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/e0c03d95

Branch: refs/heads/0.7-staging
Commit: e0c03d95f0374825ff8043a4fc062b30ebdece8d
Parents: 4bf9aec
Author: Luke Han <lu...@apache.org>
Authored: Thu Jul 9 20:44:35 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Thu Jul 9 20:44:35 2015 +0800

----------------------------------------------------------------------
 src/main/config/assemblies/source-assembly.xml | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/e0c03d95/src/main/config/assemblies/source-assembly.xml
----------------------------------------------------------------------
diff --git a/src/main/config/assemblies/source-assembly.xml b/src/main/config/assemblies/source-assembly.xml
index 3b97600..c26123e 100644
--- a/src/main/config/assemblies/source-assembly.xml
+++ b/src/main/config/assemblies/source-assembly.xml
@@ -18,9 +18,6 @@ limitations under the License.
 <assembly>
     <id>source-release</id>
     <formats>
-        <!--
-        <format>zip</format>
-        -->
         <format>tar.gz</format>
     </formats>
     <fileSets>


[19/19] incubator-kylin git commit: Merge branch '0.7-staging' of https://git-wip-us.apache.org/repos/asf/incubator-kylin into 0.7-staging

Posted by lu...@apache.org.
Merge branch '0.7-staging' of https://git-wip-us.apache.org/repos/asf/incubator-kylin into 0.7-staging


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/f116f2c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/f116f2c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/f116f2c4

Branch: refs/heads/0.7-staging
Commit: f116f2c410b3bc0e375c0f2f7db207d1d1ca7f98
Parents: 9de4706 96aafed
Author: Luke Han <lu...@apache.org>
Authored: Mon Jul 13 18:35:52 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Mon Jul 13 18:35:52 2015 +0800

----------------------------------------------------------------------
 server/src/main/webapp/WEB-INF/web.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------



[17/19] incubator-kylin git commit: Fix license issue with 0.7.2 release

Posted by lu...@apache.org.
Fix license issue with 0.7.2 release


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/a3cd0e63
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/a3cd0e63
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/a3cd0e63

Branch: refs/heads/0.7-staging
Commit: a3cd0e63989f97a6b64bf14660a1b97db6e2952c
Parents: 4b0ee63
Author: Luke Han <lu...@apache.org>
Authored: Mon Jul 13 17:04:07 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Mon Jul 13 17:04:07 2015 +0800

----------------------------------------------------------------------
 .../adapter/enumerable/EnumerableJoin.java      | 31 ++++++++++----------
 .../org/apache/kylin/common/lock/JobLock.java   | 17 +++++++++++
 .../apache/kylin/common/lock/MockJobLock.java   | 17 +++++++++++
 .../kylin/common/lock/ZookeeperJobLock.java     | 17 +++++++++++
 4 files changed, 67 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/a3cd0e63/atopcalcite/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableJoin.java
----------------------------------------------------------------------
diff --git a/atopcalcite/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableJoin.java b/atopcalcite/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableJoin.java
index 2b2ca8d..5de9f1c 100644
--- a/atopcalcite/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableJoin.java
+++ b/atopcalcite/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableJoin.java
@@ -1,24 +1,20 @@
 /*
- * OVERRIDE POINT:
- * - constructor was private instead of protected 
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
+*/
 package org.apache.calcite.adapter.enumerable;
 
 import org.apache.calcite.linq4j.tree.BlockBuilder;
@@ -44,6 +40,11 @@ import com.google.common.collect.ImmutableList;
 
 import java.util.Set;
 
+/*
+ * OVERRIDE POINT:
+ * - constructor was private instead of protected
+ */
+
 /** Implementation of {@link org.apache.calcite.rel.core.Join} in
  * {@link org.apache.calcite.adapter.enumerable.EnumerableConvention enumerable calling convention}. */
 public class EnumerableJoin extends EquiJoin implements EnumerableRel {

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/a3cd0e63/common/src/main/java/org/apache/kylin/common/lock/JobLock.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/kylin/common/lock/JobLock.java b/common/src/main/java/org/apache/kylin/common/lock/JobLock.java
index 7fdb64c..4736105 100644
--- a/common/src/main/java/org/apache/kylin/common/lock/JobLock.java
+++ b/common/src/main/java/org/apache/kylin/common/lock/JobLock.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.common.lock;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/a3cd0e63/common/src/main/java/org/apache/kylin/common/lock/MockJobLock.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/kylin/common/lock/MockJobLock.java b/common/src/main/java/org/apache/kylin/common/lock/MockJobLock.java
index 230d4d8..8e73d71 100644
--- a/common/src/main/java/org/apache/kylin/common/lock/MockJobLock.java
+++ b/common/src/main/java/org/apache/kylin/common/lock/MockJobLock.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.common.lock;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/a3cd0e63/common/src/main/java/org/apache/kylin/common/lock/ZookeeperJobLock.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/kylin/common/lock/ZookeeperJobLock.java b/common/src/main/java/org/apache/kylin/common/lock/ZookeeperJobLock.java
index 603894c..14c4718 100644
--- a/common/src/main/java/org/apache/kylin/common/lock/ZookeeperJobLock.java
+++ b/common/src/main/java/org/apache/kylin/common/lock/ZookeeperJobLock.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
 package org.apache.kylin.common.lock;
 
 import org.apache.commons.lang.StringUtils;


[14/19] incubator-kylin git commit: Fix license issue with 0.7.2 release

Posted by lu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4b0ee63c/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4b0ee63c/query/pom.xml
----------------------------------------------------------------------


[07/19] incubator-kylin git commit: [maven-release-plugin] prepare release kylin-0.7.2-incubating

Posted by lu...@apache.org.
[maven-release-plugin] prepare release kylin-0.7.2-incubating


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/4ccfea61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/4ccfea61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/4ccfea61

Branch: refs/heads/0.7-staging
Commit: 4ccfea61a7019cccb04ac46b390cfd79220ae463
Parents: e0c03d9
Author: Luke Han <lu...@apache.org>
Authored: Thu Jul 9 20:50:13 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Thu Jul 9 20:50:13 2015 +0800

----------------------------------------------------------------------
 atopcalcite/pom.xml   | 2 +-
 common/pom.xml        | 2 +-
 cube/pom.xml          | 2 +-
 dictionary/pom.xml    | 2 +-
 invertedindex/pom.xml | 2 +-
 jdbc/pom.xml          | 2 +-
 job/pom.xml           | 2 +-
 metadata/pom.xml      | 2 +-
 monitor/pom.xml       | 5 ++---
 pom.xml               | 4 ++--
 query/pom.xml         | 2 +-
 server/pom.xml        | 2 +-
 storage/pom.xml       | 2 +-
 13 files changed, 15 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/atopcalcite/pom.xml
----------------------------------------------------------------------
diff --git a/atopcalcite/pom.xml b/atopcalcite/pom.xml
index 8986f0c..db76ba4 100644
--- a/atopcalcite/pom.xml
+++ b/atopcalcite/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index faed39d..cf95319 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/cube/pom.xml
----------------------------------------------------------------------
diff --git a/cube/pom.xml b/cube/pom.xml
index 07f9a58..00470b2 100644
--- a/cube/pom.xml
+++ b/cube/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/dictionary/pom.xml
----------------------------------------------------------------------
diff --git a/dictionary/pom.xml b/dictionary/pom.xml
index 075fab1..6d43941 100644
--- a/dictionary/pom.xml
+++ b/dictionary/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/invertedindex/pom.xml
----------------------------------------------------------------------
diff --git a/invertedindex/pom.xml b/invertedindex/pom.xml
index 8e89ee4..699a982 100644
--- a/invertedindex/pom.xml
+++ b/invertedindex/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>kylin</artifactId>
         <groupId>org.apache.kylin</groupId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>kylin-invertedindex</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/jdbc/pom.xml
----------------------------------------------------------------------
diff --git a/jdbc/pom.xml b/jdbc/pom.xml
index 7f707c7..b193aeb 100644
--- a/jdbc/pom.xml
+++ b/jdbc/pom.xml
@@ -27,7 +27,7 @@
 	<parent>
 		<groupId>org.apache.kylin</groupId>
 		<artifactId>kylin</artifactId>
-		<version>0.7.2-incubating-SNAPSHOT</version>
+		<version>0.7.2-incubating</version>
 	</parent>
 
 	<properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/job/pom.xml
----------------------------------------------------------------------
diff --git a/job/pom.xml b/job/pom.xml
index 44a0f5f..37c2678 100644
--- a/job/pom.xml
+++ b/job/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
 
     <artifactId>kylin-job</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/metadata/pom.xml
----------------------------------------------------------------------
diff --git a/metadata/pom.xml b/metadata/pom.xml
index e842673..ffd8317 100644
--- a/metadata/pom.xml
+++ b/metadata/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/monitor/pom.xml
----------------------------------------------------------------------
diff --git a/monitor/pom.xml b/monitor/pom.xml
index a6fc87c..5931619 100644
--- a/monitor/pom.xml
+++ b/monitor/pom.xml
@@ -18,12 +18,11 @@
 -->
 
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5c75374..2c393b4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
     <groupId>org.apache.kylin</groupId>
     <artifactId>kylin</artifactId>
     <packaging>pom</packaging>
-    <version>0.7.2-incubating-SNAPSHOT</version>
+    <version>0.7.2-incubating</version>
     <name>Kylin:HadoopOLAPEngine</name>
     <url>http://kylin.incubator.apache.org</url>
     <inceptionYear>2014</inceptionYear>
@@ -147,7 +147,7 @@
         <connection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-kylin.git</connection>
         <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-kylin.git</developerConnection>
         <url>https://git-wip-us.apache.org/repos/asf/incubator-kylin.git</url>
-        <tag>apache-kylin-0.7.1-incubating</tag>
+        <tag>kylin-0.7.2-incubating</tag>
     </scm>
 
     <dependencyManagement>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/query/pom.xml
----------------------------------------------------------------------
diff --git a/query/pom.xml b/query/pom.xml
index 3881b4d..b065d00 100644
--- a/query/pom.xml
+++ b/query/pom.xml
@@ -28,7 +28,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 8500426..6a1e4b7 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -28,7 +28,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ccfea61/storage/pom.xml
----------------------------------------------------------------------
diff --git a/storage/pom.xml b/storage/pom.xml
index 0d5918a..fcb40d3 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.apache.kylin</groupId>
         <artifactId>kylin</artifactId>
-        <version>0.7.2-incubating-SNAPSHOT</version>
+        <version>0.7.2-incubating</version>
     </parent>
 
     <dependencies>


[02/19] incubator-kylin git commit: Add howto-make-release and release 0.7.1 blog and events-conference page

Posted by lu...@apache.org.
Add howto-make-release and release 0.7.1 blog and events-conference page


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/d6a188d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/d6a188d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/d6a188d6

Branch: refs/heads/0.7-staging
Commit: d6a188d6e5cff3e0b10dde174cca84bfcb02db34
Parents: 725bde5
Author: Luke Han <lu...@apache.org>
Authored: Tue Jul 7 20:29:16 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Tue Jul 7 20:29:16 2015 +0800

----------------------------------------------------------------------
 docs/website/_config.yml                        |   4 +-
 .../2015-07-02-Events-and-Conferences.md        |  25 ++
 .../2015-07-06-How-to-making-a-release.md       | 448 +++++++++++++++++++
 .../blog/2015-01-25-introduce-data-model.md     |   2 +-
 .../2015-06-10-release-v0.7.1-incubating.md     | 149 ++++++
 docs/website/download/index.cn.md               |   7 +
 docs/website/download/index.md                  |   9 +
 7 files changed, 641 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d6a188d6/docs/website/_config.yml
----------------------------------------------------------------------
diff --git a/docs/website/_config.yml b/docs/website/_config.yml
index f7eb224..bfcad4b 100644
--- a/docs/website/_config.yml
+++ b/docs/website/_config.yml
@@ -20,11 +20,11 @@ title: kylin.io
 email: dev@kylin.incubator.apache.org
 description: Apache Kylin Home
 baseurl: "" # the subpath of your site, e.g. /blog/
-url: "http://kyli.io" # the base hostname & protocol for your site
+url: "http://kylin.incubator.apache.org" # the base hostname & protocol for your site
 twitter_username: ApacheKylin
-github_username:  KylinOLAP
 
 encoding: UTF-8
+timezone: America/Dawson 
 
 # Build settings
 markdown: kramdown

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d6a188d6/docs/website/_posts/Getting Started/2015-07-02-Events-and-Conferences.md
----------------------------------------------------------------------
diff --git a/docs/website/_posts/Getting Started/2015-07-02-Events-and-Conferences.md b/docs/website/_posts/Getting Started/2015-07-02-Events-and-Conferences.md
new file mode 100644
index 0000000..55f9c54
--- /dev/null
+++ b/docs/website/_posts/Getting Started/2015-07-02-Events-and-Conferences.md	
@@ -0,0 +1,25 @@
+---
+layout: post
+title:  "Events and Conferences"
+categories: gettingstarted
+---
+
+__Coming Events__
+
+* ApacheCon EU 2015
+
+__Conferences__
+
+* [Apache Kylin - Balance Between Space and Time](https://www.youtube.com/watch?v=jgvZSFaXPgI), [slides](http://www.slideshare.net/DebashisSaha/apache-kylin-balance-between-space-and-time-hadop-summit-2015) ([video](https://www.youtube.com/watch?v=jgvZSFaXPgI), [slides](http://www.slideshare.net/DebashisSaha/apache-kylin-balance-between-space-and-time-hadop-summit-2015)) by [Debashis Saha](https://twitter.com/debashis_saha) & [Luke Han](https://twitter.com/lukehq), at Hadoop Summit 2015 in San Jose, US, 2015-06-09
+* [HBaseCon 2015: Apache Kylin; Extreme OLAP Engine for Hadoop](https://vimeo.com/128152444) ([video](https://vimeo.com/128152444), [slides](http://www.slideshare.net/HBaseCon/ecosystem-session-3b)) by [Seshu Adunuthula](https://twitter.com/SeshuAd) at HBaseCon 2015 in San Francisco, US, 2015-05-07
+* [Apache Kylin - Extreme OLAP Engine for Hadoop](http://strataconf.com/big-data-conference-uk-2015/public/schedule/detail/40029) ([slides](http://www.slideshare.net/lukehan/apache-kylin-extreme-olap-engine-for-big-data)) by [Luke Han](https://twitter.com/lukehq) & [Yang Li](https://github.com/liyang-gmt8), at Strata+Hadoop World in London, UK, 2015-05-06
+* [Apache Kylin Open Source Journey](http://www.infoq.com/cn/presentations/open-source-journey-of-apache-kylin) ([slides](http://www.slideshare.net/lukehan/apache-kylin-open-source-journey-for-qcon2015-beijing)) by [Luke Han](https://twitter.com/lukehq), at QCon Beijing in Beijing, China, 2015-04-23
+* [Apache Kylin - OLAP on Hadoop](http://cio.it168.com/a2015/0418/1721/000001721404.shtml) by [Yang Li](https://github.com/liyang-gmt8), at Database Technology Conference China 2015 in Beijing, China, 2015-04-18
+* [Apache Kylin – Cubes on Hadoop](https://www.youtube.com/watch?v=U0SbrVzuOe4) ([video](https://www.youtube.com/watch?v=U0SbrVzuOe4), [slides](http://www.slideshare.net/Hadoop_Summit/apache-kylin-cubes-on-hadoop)) by [Ted Dunning](https://twitter.com/ted_dunning), at Hadoop Summit 2015 Europe in Brussels, Belgium, 2015-04-16
+* [Apache Kylin - Hadoop 上的大规模联机分析平台](http://bdtc2014.hadooper.cn/m/zone/bdtc_2014/schedule3) ([slides](http://www.slideshare.net/lukehan/apache-kylin-big-data-technology-conference-2014-beijing-v2)) by [Luke Han](https://twitter.com/lukehq), at Big Data Technology Conference China in Beijing, China, 2014-12-14
+* [Apache Kylin: OLAP Engine on Hadoop - Tech Deep Dive](http://v.csdn.hudong.com/s/article.html?arcid=15820707) ([video](http://v.csdn.hudong.com/s/article.html?arcid=15820707), [slides](http://www.slideshare.net/XuJiang2/kylin-hadoop-olap-engine)) by [Jiang Xu](https://www.linkedin.com/pub/xu-jiang/4/5a8/230), at Shanghai Big Data Summit 2014 in Shanghai, China , 2014-10-25
+
+__Meetup__
+
+* [Apache Kylin Meetup @Bay Area](http://www.meetup.com/Cloud-at-ebayinc/events/218914395/), in San Jose, US, 6:00PM - 7:30PM, Thursday, 2014-12-04
+

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d6a188d6/docs/website/_posts/How to/2015-07-06-How-to-making-a-release.md
----------------------------------------------------------------------
diff --git a/docs/website/_posts/How to/2015-07-06-How-to-making-a-release.md b/docs/website/_posts/How to/2015-07-06-How-to-making-a-release.md
new file mode 100644
index 0000000..2cf6a87
--- /dev/null
+++ b/docs/website/_posts/How to/2015-07-06-How-to-making-a-release.md	
@@ -0,0 +1,448 @@
+---
+layout: post
+title:  "How to making a release (for Kylin committers)"
+categories: howto
+---
+
+_This guide is for Apache Kylin Committers only._  
+_Shell commands is on Mac OS X as sample._  
+_For people in China, please aware using proxy to avoid potential firewall issue._  
+
+# Setup Account  
+Make sure you have avaliable account and privlidge for following applications:
+
+* Apache account: [https://id.apache.org](https://id.apache.org/)    
+* Apache Kylin git repo (main cobe base): [https://git-wip-us.apache.org/repos/asf/incubator-kylin.git](https://git-wip-us.apache.org/repos/asf/incubator-kylin.git)  
+* Apache Kylin svn repo (for website only): [https://svn.apache.org/repos/asf/incubator/kylin](https://svn.apache.org/repos/asf/incubator/kylin)  
+* Apache Nexus (maven repo): [https://repository.apache.org](https://repository.apache.org)  
+* Apache Kylin dist repo: [https://dist.apache.org/repos/dist/dev/incubator/kylin](https://dist.apache.org/repos/dist/dev/incubator/kylin)  
+
+# Setup PGP signing keys  
+Follow instructions at [http://www.apache.org/dev/release-signing](http://www.apache.org/dev/release-signing) to create a key pair  
+Install gpg (On Mac OS X as sample):  
+`brew install gpg and gpg --gen-key`
+
+Generate gpg key:  
+Reference: [https://www.gnupg.org/gph/en/manual/c14.html](https://www.gnupg.org/gph/en/manual/c14.html)  
+_All new RSA keys generated should be at least 4096 bits. Do not generate new DSA keys_  
+`gpg --gen-key`  
+
+Verify your key:  
+`gpg --list-sigs YOUR_NAME`
+
+Then add your key to your apache account, for example:  
+[https://people.apache.org/keys/committer/lukehan.asc](https://people.apache.org/keys/committer/lukehan.asc)  
+Generate ASCII Amromed Key:  
+`gpg -a --export YOUR_MAIL_ADDRESS > YOUR_NAME.asc &`
+
+Upload key to public server:  
+`gpg --send-keys YOUR_KEY_HASH`
+
+or Submit key via web:  
+Open and Submit to [http://pool.sks-keyservers.net:11371](http://pool.sks-keyservers.net:11371) (you can pickup any avaliable public key server)  
+Once your key submitted to server, you can verify using following command:  
+`gpg --recv-keys YOUR_KEY_HASH`
+
+for example:  
+`gpg --recv-keys 027DC364`
+
+Add your public key to the KEYS file by following instructions in the KEYS file.:  
+_KEYS file location:_ __${incubator-kylin}/KEYS__  
+For example:  
+`(gpg --list-sigs YOURNAME && gpg --armor --export YOURNAME) >> KEYS`
+
+Commit your changes.
+
+# Prepare artifacts for release  
+__Before you start:__
+
+* Set up signing keys as described above.
+* Make sure you are using JDK 1.7 (not 1.8).
+* Make sure you are working on right release version number.
+* Make sure that every “resolved” JIRA case (including duplicates) has a fix version assigned.
+
+__Making a snapshot__  
+{% highlight bash %}
+# Set passphrase variable without putting it into shell history
+$ read -s GPG_PASSPHRASE
+
+# Make sure that there are no junk files in the sandbox
+$ git clean -xn
+$ mvn clean
+
+$ mvn -Papache-release -Dgpg.passphrase=${GPG_PASSPHRASE} install
+{% endhighlight %}
+When the dry-run has succeeded, change install to deploy.
+
+__Verify licenses__  
+Run Apache RAT to check licenses issue:  
+{% highlight bash %}
+mvn -Papache-release clean rat:rat
+{% endhighlight %}
+
+Fix license issue if any.
+
+__Making a release__
+
+Create a release branch named after the release, e.g. v0.7.2-release, and push it to Apache.  
+{% highlight bash %}
+$ git checkout -b vX.Y.Z-release
+$ git push -u origin vX.Y.Z-release
+{% endhighlight %}
+We will use the branch for the entire the release process. Meanwhile, we do not allow commits to the master branch. After the release is final, we can use `git merge --ff-only` to append the changes on the release branch onto the master branch. (Apache does not allow reverts to the master branch, which makes it difficult to clean up the kind of messy commits that inevitably happen while you are trying to finalize a release.)
+
+Now, set up your environment and do a dry run. The dry run will not commit any changes back to git and gives you the opportunity to verify that the release process will complete as expected.
+
+If any of the steps fail, clean up (see below), fix the problem, and start again from the top.  
+{% highlight bash %}
+# Set passphrase variable without putting it into shell history
+$ read -s GPG_PASSPHRASE
+
+# Make sure that there are no junk files in the sandbox
+$ git clean -xn
+$ mvn clean
+
+# Do a dry run of the release:prepare step, which sets version numbers.
+$ mvn -DdryRun=true -DskipTests -DreleaseVersion=X.Y.Z-incubating -DdevelopmentVersion=X.Y.Z+1-incubating-SNAPSHOT -Papache-release -Darguments="-Dgpg.passphrase=${GPG_PASSPHRASE}" release:prepare 2>&1 | tee /tmp/prepare-dry.log
+{% endhighlight %}
+
+__Check the artifacts:__
+
+* In the `target` directory should be these 8 files, among others:
+  * apache-kylin-X.Y.Z-incubating-src.tar.gz
+  * apache-kylin-X.Y.Z-incubating-src.tar.gz.asc
+  * apache-kylin-X.Y.Z-incubating-src.tar.gz.md5
+  * apache-kylin-X.Y.Z-incubating-src.tar.gz.sha1
+  * apache-kylin-X.Y.Z-incubating-src.zip
+  * apache-kylin-X.Y.Z-incubating-src.zip.asc
+  * apache-kylin-X.Y.Z-incubating-src.zip.md5
+  * apache-kylin-X.Y.Z-incubating-src.zip.sha1
+* Note that the file names start `apache-kylin-` and include
+  `incubating` in the version.
+* In the two source distros `.tar.gz` and `.zip`, check that all files belong to a directory called
+  `apache-kylin-X.Y.Z-incubating-src`.
+* That directory must contain files `DISCLAIMER`, `NOTICE`, `LICENSE`, `README.md`
+* Check PGP, per [this](https://httpd.apache.org/dev/verification.html)
+
+__Run real release:__
+Now, run the release for real.  
+{% highlight bash %}
+# Prepare sets the version numbers, creates a tag, and pushes it to git.
+$ mvn -DskipTests -Papache-release -Darguments="-Dgpg.passphrase=${GPG_PASSPHRASE} -DskipTests" clean release:prepare
+
+# Perform checks out the tagged version, builds, and deploys to the staging repository
+$ mvn -DskipTests -Papache-release -Darguments="-Dgpg.passphrase=${GPG_PASSPHRASE} -DskipTests" release:perform
+{% endhighlight %}
+
+__Verify the staged artifacts in the Nexus repository:__  
+* Go to [https://repository.apache.org/](https://repository.apache.org/) and login
+* Under `Build Promotion`, click `Staging Repositories`
+* In the `Staging Repositories` tab there should be a line with profile `org.apache.kylin`
+* Navigate through the artifact tree and make sure the .jar, .pom, .asc files are present
+* Check the box on in the first column of the row,
+  and press the 'Close' button to publish the repository at
+  https://repository.apache.org/content/repositories/orgapachekylin-1006
+  (or a similar URL)
+
+__Upload to staging area:__  
+Upload the artifacts via subversion to a staging area, https://dist.apache.org/repos/dist/dev/incubator/kylin/apache-kylin-X.Y.Z-incubating-rcN:
+{% highlight bash %}
+# Create a subversion workspace, if you haven't already
+$ mkdir -p ~/dist/dev
+$ pushd ~/dist/dev
+$ svn co https://dist.apache.org/repos/dist/dev/incubator/kylin
+$ popd
+
+# Move the files into a directory
+$ cd target
+$ mkdir ~/dist/dev/kylin/apache-kylin-X.Y.Z-incubating-rcN
+$ mv apache-kylin-* ~/dist/dev/kylin/apache-kylin-X.Y.Z-incubating-rcN
+
+# Check in
+$ cd ~/dist/dev/kylin
+$ svn add apache-kylin-X.Y.Z-incubating-rcN
+$ svn commit -m 'Upload release artifacts to staging'
+{% endhighlight %}
+
+__Cleaning up after a failed release attempt:__
+{% highlight bash %}
+# Make sure that the tag you are about to generate does not already
+# exist (due to a failed release attempt)
+$ git tag
+
+# If the tag exists, delete it locally and remotely
+$ git tag -d apache-kylin-X.Y.Z-incubating
+$ git push origin :refs/tags/apache-kylin-X.Y.Z-incubating
+
+# Remove modified files
+$ mvn release:clean
+
+# Check whether there are modified files and if so, go back to the
+# original git commit
+$ git status
+$ git reset --hard HEAD
+{% endhighlight %}
+
+# Validate a release
+{% highlight bash %}
+# Check that the signing key (e.g. 2AD3FAE3) is pushed
+$ gpg --recv-keys key
+
+# Check keys
+$ curl -O https://dist.apache.org/repos/dist/release/incubator/kylin/KEYS
+
+# Sign/check md5 and sha1 hashes
+# (Assumes your O/S has 'md5' and 'sha1' commands.)
+function checkHash() {
+  cd "$1"
+  for i in *.{zip,pom,gz}; do
+    if [ ! -f $i ]; then
+      continue
+    fi
+    if [ -f $i.md5 ]; then
+      if [ "$(cat $i.md5)" = "$(md5 -q $i)" ]; then
+        echo $i.md5 present and correct
+      else
+        echo $i.md5 does not match
+      fi
+    else
+      md5 -q $i > $i.md5
+      echo $i.md5 created
+    fi
+    if [ -f $i.sha1 ]; then
+      if [ "$(cat $i.sha1)" = "$(sha1 -q $i)" ]; then
+        echo $i.sha1 present and correct
+      else
+        echo $i.sha1 does not match
+      fi
+    else
+      sha1 -q $i > $i.sha1
+      echo $i.sha1 created
+    fi
+  done
+}
+$ checkHash apache-kylin-X.Y.Z-incubating-rcN
+{% endhighlight %}
+
+
+# Apache voting process  
+
+__Vote on Apache Kylin dev mailing list__  
+Release vote on dev list:  
+
+{% highlight text %}
+To: dev@kylin.incubator.apache.org
+Subject: [VOTE] Release apache-kylin-X.Y.Z-incubating (release candidate N)
+
+Hi all,
+
+I have created a build for Apache Kylin X.Y.Z-incubating, release candidate N.
+
+Changes highlights:
+...
+
+Thanks to everyone who has contributed to this release.
+Here’s release notes:
+https://github.com/apache/incubator-kylin/blob/XXX/docs/release_notes.md
+
+The commit to be voted upon:
+
+https://github.com/apache/incubator-kylin/commit/xxx
+
+Its hash is xxx.
+
+The artifacts to be voted on are located here:
+https://dist.apache.org/repos/dist/dev/incubator/kylin/apache-kylin-X.Y.Z-incubating-rcN/
+
+The hashes of the artifacts are as follows:
+src.zip.md5 xxx
+src.zip.sha1 xxx
+src.tar.gz.md5 xxx
+src.tar.gz.sha1 xxx
+
+A staged Maven repository is available for review at:
+https://repository.apache.org/content/repositories/orgapachekylin-XXXX/
+
+Release artifacts are signed with the following key:
+https://people.apache.org/keys/committer/lukehan.asc
+
+Please vote on releasing this package as Apache Kylin X.Y.Z-incubating.
+
+The vote is open for the next 72 hours and passes if a majority of
+at least three +1 PPMC votes are cast.
+
+[ ] +1 Release this package as Apache Kylin X.Y.Z-incubating
+[ ]  0 I don't feel strongly about it, but I'm okay with the release
+[ ] -1 Do not release this package because...
+
+
+Here is my vote:
+
++1 (binding)
+
+Luke
+
+{% endhighlight %}
+
+After vote finishes, send out the result:  
+{% highlight text %}
+Subject: [RESULT] [VOTE] Release apache-kylin-X.Y.Z-incubating (release candidate N)
+To: dev@kylin.incubator.apache.org
+
+Thanks to everyone who has tested the release candidate and given
+their comments and votes.
+
+The tally is as follows.
+
+N binding +1s:
+
+N non-binding +1s:
+
+No 0s or -1s.
+
+Therefore I am delighted to announce that the proposal to release
+Apache-Kylin-X.Y.Z-incubating has passed.
+
+I'll now start a vote on the general list. Those of you in the IPMC,
+please recast your vote on the new thread.
+
+Luke
+
+{% endhighlight %}
+
+__Vote on Apache incubator general mailing list__   
+Use the [Apache URL shortener](http://s.apache.org) to generate
+shortened URLs for the vote proposal and result emails. Examples:
+[http://s.apache.org/kylin-0.7.1-vote_rc3](http://s.apache.org/kylin-0.7.1-vote_rc3) and
+[http://s.apache.org/kylin-0.7.1-result_rc3](http://s.apache.org/kylin-0.7.1-result_rc3).
+
+{% highlight text %}
+To: general@incubator.apache.org
+Subject: [VOTE] Release Apache Kylin X.Y.Z (incubating)
+
+Hi all,
+
+The Apache Kylin community has voted on and approved a proposal to release
+Apache Kylin X.Y.Z (incubating).
+
+Proposal:
+http://s.apache.org/kylin-X.Y.Z-vote_rcN
+
+Vote result:
+N binding +1 votes
+N non-binding +1 votes
+No -1 votes
+http://s.apache.org/kylin-X.Y.Z-result_rcN
+
+
+The commit to be voted upon:
+https://github.com/apache/incubator-kylin/commit/XXX
+
+Its hash is XXX.
+
+The artifacts to be voted on are located here:
+https://dist.apache.org/repos/dist/dev/incubator/kylin/apache-kylin-X.Y.Z-incubating-rcN/
+
+The hashes of the artifacts are as follows:
+src.zip.md5 XXX
+src.zip.sha1 XXX
+src.tar.gz.md5 XXX
+src.tar.gz.sha1 XXX
+
+A staged Maven repository is available for review at:
+https://repository.apache.org/content/repositories/orgapachekylin-NNNN/
+
+Release artifacts are signed with the following key:
+https://people.apache.org/keys/committer/lukehan.asc
+
+Pursuant to the Releases section of the Incubation Policy and with
+the endorsement of our mentors we would now like to request
+the permission of the Incubator PMC to publish the release. The vote
+is open for 72 hours, or until the necessary number of votes (3 +1)
+is reached.
+
+[ ] +1 Release this package
+[ ]  0 I don't feel strongly about it, but I'm okay with the release
+[ ] -1 Do not release this package because...
+
+
+Luke Han, on behalf of Apache Kylin PPMC
+{% endhighlight %}
+
+After vote finishes, send out the result:
+{% highlight text %}
+To: general@incubator.apache.org
+Subject: [RESULT] [VOTE] Release Apache Kylin X.Y.Z (incubating)
+
+This vote passes with N +1s and no 0 or -1 votes:
+
++1 <name> (binding or no-binding)
+
+Thanks everyone. We’ll now roll the release out to the mirrors.
+
+Luke Han, on behalf of Apache Kylin PPMC
+{% endhighlight %}
+
+# Publishing a release  
+After a successful release vote, we need to push the release
+out to mirrors, and other tasks.
+
+In JIRA, search for
+[all issues resolved in this release](https://issues.apache.org/jira/issues/?jql=project%20%3D%20KYLIN%20),
+and do a bulk update changing their status to "Closed",
+with a change comment
+"Resolved in release X.Y.Z-incubating (YYYY-MM-DD)"
+(fill in release number and date appropriately).  
+__Uncheck "Send mail for this update".__
+
+Promote the staged nexus artifacts.
+
+* Go to [https://repository.apache.org/](https://repository.apache.org/) and login
+* Under "Build Promotion" click "Staging Repositories"
+* In the line with "orgapachekylin-xxxx", check the box
+* Press "Release" button
+
+Check the artifacts into svn.
+{% highlight bash %}
+# Get the release candidate.
+$ mkdir -p ~/dist/dev
+$ cd ~/dist/dev
+$ svn co https://dist.apache.org/repos/dist/dev/incubator/kylin
+
+# Copy the artifacts. Note that the copy does not have '-rcN' suffix.
+$ mkdir -p ~/dist/release
+$ cd ~/dist/release
+$ svn co https://dist.apache.org/repos/dist/release/incubator/kylin
+$ cd kylin
+$ cp -rp ../../dev/kylin/apache-kylin-X.Y.Z-incubating-rcN apache-kylin-X.Y.Z-incubating
+$ svn add apache-kylin-X.Y.Z-incubating
+
+# Check in.
+svn commit -m 'checkin release artifacts'
+{% endhighlight %}
+
+Svnpubsub will publish to
+[https://dist.apache.org/repos/dist/release/incubator/kylin](https://dist.apache.org/repos/dist/release/incubator/kylin) and propagate to
+[http://www.apache.org/dyn/closer.cgi/incubator/kylin](http://www.apache.org/dyn/closer.cgi/incubator/kylin) within 24 hours.
+
+If there are now more than 2 releases, clear out the oldest ones:
+
+{% highlight bash %}
+cd ~/dist/release/kylin
+svn rm apache-kylin-X.Y.Z-incubating
+svn commit -m 'Remove old release'
+{% endhighlight %}
+
+The old releases will remain available in the
+[release archive](http://archive.apache.org/dist/incubator/kylin/).
+
+
+
+Release same version in JIRA, check [Change Log](https://issues.apache.org/jira/browse/KYLIN/?selectedTab=com.atlassian.jira.jira-projects-plugin:changelog-panel) for the latest released version.
+
+# Publishing the web site
+_TBD_
+
+# Thanks  
+This guide drafted with reference from [Apache Calcite](http://calcite.incubator.apache.org) Howto doc, Thank you very much.
+

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d6a188d6/docs/website/_posts/blog/2015-01-25-introduce-data-model.md
----------------------------------------------------------------------
diff --git a/docs/website/_posts/blog/2015-01-25-introduce-data-model.md b/docs/website/_posts/blog/2015-01-25-introduce-data-model.md
index 517aced..6f23a10 100644
--- a/docs/website/_posts/blog/2015-01-25-introduce-data-model.md
+++ b/docs/website/_posts/blog/2015-01-25-introduce-data-model.md
@@ -1,7 +1,7 @@
 ---
 layout: post-blog
 title:  "Introduce Data Model of Cube Designer"
-date:   2015-01-25 22:28:00
+date:   2015-01-25 12:28:00
 author: Luke Han
 categories: blog
 ---

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d6a188d6/docs/website/_posts/blog/2015-06-10-release-v0.7.1-incubating.md
----------------------------------------------------------------------
diff --git a/docs/website/_posts/blog/2015-06-10-release-v0.7.1-incubating.md b/docs/website/_posts/blog/2015-06-10-release-v0.7.1-incubating.md
new file mode 100644
index 0000000..c695490
--- /dev/null
+++ b/docs/website/_posts/blog/2015-06-10-release-v0.7.1-incubating.md
@@ -0,0 +1,149 @@
+---
+layout: post-blog
+title:  "Release v0.7.1-incubating"
+date:   2015-06-10 12:28:00
+author: Luke Han
+categories: blog
+---
+
+Apache Kylin v0.7.1-incubating has rolled out on June 10, 2015. This is also the first Apache release after join incubating. 
+
+To download this release, please visit: [http://kylin.incubator.apache.org/download/](http://kylin.incubator.apache.org/download/), there are source code package, binary package, ODBC driver and installation guide avaliable.
+
+Any problem or issue, please send to Apache Kylin mailing list: [dev@kylin.incubator.apache.org](mailto:dev@kylin.incubator.apache.org)
+
+Or, report to Apache Kylin JIRA project: [https://issues.apache.org/jira/browse/KYLIN](https://issues.apache.org/jira/browse/KYLIN)
+
+__Main Changes:__
+
+* Package renamed from com.kylinolap to org.apache.kylin
+* Code cleaned up to apply Apache License policy
+* Easy install and setup with bunch of scripts and automation
+* Job engine refactor to be generic job manager for all jobs, and improved efficiency
+* Support Hive database other than 'default'
+* JDBC driver avaliable for client to interactive with Kylin server
+* Binary pacakge avaliable download 
+
+__New Feature__
+
+    * [KYLIN-327] - Binary distribution 
+    * [KYLIN-368] - Move MailService to Common module
+    * [KYLIN-540] - Data model upgrade for legacy cube descs
+    * [KYLIN-576] - Refactor expansion rate expression
+
+__Task__
+
+    * [KYLIN-361] - Rename package name with Apache Kylin
+    * [KYLIN-531] - Rename package name to org.apache.kylin
+    * [KYLIN-533] - Job Engine Refactoring
+    * [KYLIN-585] - Simplify deployment
+    * [KYLIN-586] - Add Apache License header in each source file
+    * [KYLIN-587] - Remove hard copy of javascript libraries
+    * [KYLIN-624] - Add dimension and metric info into DataModel
+    * [KYLIN-650] - Move all document from github wiki to code repository (using md file)
+    * [KYLIN-669] - Release v0.7.1 as first apache release
+
+__Sub-task__
+
+    * [KYLIN-670] - Update pom with "incubating" in version number
+    * [KYLIN-737] - Generate and sign release package for review and vote
+    * [KYLIN-795] - Release after success vote
+
+__Bug__
+
+    * [KYLIN-132] - Job framework
+    * [KYLIN-194] - Dict & ColumnValueContainer does not support number comparison, they do string comparison right now
+    * [KYLIN-220] - Enable swap column of Rowkeys in Cube Designer
+    * [KYLIN-230] - Error when create HTable
+    * [KYLIN-255] - Error when a aggregated function appear twice in select clause
+    * [KYLIN-383] - Sample Hive EDW database name should be replaced by "default" in the sample
+    * [KYLIN-399] - refreshed segment not correctly published to cube
+    * [KYLIN-412] - No exception or message when sync up table which can't access
+    * [KYLIN-421] - Hive table metadata issue
+    * [KYLIN-436] - Can't sync Hive table metadata from other database rather than "default"
+    * [KYLIN-508] - Too high cardinality is not suitable for dictionary!
+    * [KYLIN-509] - Order by on fact table not works correctly
+    * [KYLIN-517] - Always delete the last one of Add Lookup page buttom even if deleting the first join condition
+    * [KYLIN-524] - Exception will throw out if dimension is created on a lookup table, then deleting the lookup table.
+    * [KYLIN-547] - Create cube failed if column dictionary sets false and column length value greater than 0
+    * [KYLIN-556] - error tip enhance when cube detail return empty
+    * [KYLIN-570] - Need not to call API before sending login request
+    * [KYLIN-571] - Dimensions lost when creating cube though Joson Editor
+    * [KYLIN-572] - HTable size is wrong
+    * [KYLIN-581] - unable to build cube
+    * [KYLIN-583] - Dependency of Hive conf/jar in II branch will affect auto deploy
+    * [KYLIN-588] - Error when run package.sh
+    * [KYLIN-593] - angular.min.js.map and angular-resource.min.js.map are missing in kylin.war
+    * [KYLIN-594] - Making changes in build and packaging with respect to apache release process
+    * [KYLIN-595] - Kylin JDBC driver should not assume Kylin server listen on either 80 or 443
+    * [KYLIN-605] - Issue when install Kylin on a CLI which does not have yarn Resource Manager
+    * [KYLIN-614] - find hive dependency shell fine is unable to set the hive dependency correctly
+    * [KYLIN-615] - Unable add measures in Kylin web UI
+    * [KYLIN-619] - Cube build fails with hive+tez
+    * [KYLIN-620] - Wrong duration number
+    * [KYLIN-621] - SecurityException when running MR job
+    * [KYLIN-627] - Hive tables' partition column was not sync into Kylin
+    * [KYLIN-628] - Couldn't build a new created cube
+    * [KYLIN-629] - Kylin failed to run mapreduce job if there is no mapreduce.application.classpath in mapred-site.xml
+    * [KYLIN-630] - ArrayIndexOutOfBoundsException when merge cube segments 
+    * [KYLIN-638] - kylin.sh stop not working
+    * [KYLIN-639] - Get "Table 'xxxx' not found while executing SQL" error after a cube be successfully built
+    * [KYLIN-640] - sum of float not working
+    * [KYLIN-642] - Couldn't refresh cube segment
+    * [KYLIN-643] - JDBC couldn't connect to Kylin: "java.sql.SQLException: Authentication Failed"
+    * [KYLIN-644] - join table as null error when build the cube
+    * [KYLIN-652] - Lookup table alias will be set to null
+    * [KYLIN-657] - JDBC Driver not register into DriverManager
+    * [KYLIN-658] - java.lang.IllegalArgumentException: Cannot find rowkey column XXX in cube CubeDesc
+    * [KYLIN-659] - Couldn't adjust the rowkey sequence when create cube
+    * [KYLIN-666] - Select float type column got class cast exception
+    * [KYLIN-681] - Failed to build dictionary if the rowkey's dictionary property is "date(yyyy-mm-dd)"
+    * [KYLIN-682] - Got "No aggregator for func 'MIN' and return type 'decimal(19,4)'" error when build cube
+    * [KYLIN-684] - Remove holistic distinct count and multiple column distinct count from sample cube
+    * [KYLIN-691] - update tomcat download address in download-tomcat.sh
+    * [KYLIN-696] - Dictionary couldn't recognize a value and throw IllegalArgumentException: "Not a valid value"
+    * [KYLIN-703] - UT failed due to unknown host issue
+    * [KYLIN-711] - UT failure in REST module
+    * [KYLIN-739] - Dimension as metrics does not work with PK-FK derived column
+    * [KYLIN-761] - Tables are not shown in the "Query" tab, and couldn't run SQL query after cube be built
+
+__Improvement__
+
+    * [KYLIN-168] - Installation fails if multiple ZK
+    * [KYLIN-182] - Validation Rule: columns used in Join condition should have same datatype
+    * [KYLIN-204] - Kylin web not works properly in IE
+    * [KYLIN-217] - Enhance coprocessor with endpoints 
+    * [KYLIN-251] - job engine refactoring
+    * [KYLIN-261] - derived column validate when create cube
+    * [KYLIN-317] - note: grunt.json need to be configured when add new javascript or css file
+    * [KYLIN-324] - Refactor metadata to support InvertedIndex
+    * [KYLIN-407] - Validation: There's should no Hive table column using "binary" data type
+    * [KYLIN-445] - Rename cube_desc/cube folder
+    * [KYLIN-452] - Automatically create local cluster for running tests
+    * [KYLIN-498] - Merge metadata tables 
+    * [KYLIN-532] - Refactor data model in kylin front end
+    * [KYLIN-539] - use hbase command to launch tomcat
+    * [KYLIN-542] - add project property feature for cube
+    * [KYLIN-553] - From cube instance, couldn't easily find the project instance that it belongs to
+    * [KYLIN-563] - Wrap kylin start and stop with a script 
+    * [KYLIN-567] - More flexible validation of new segments
+    * [KYLIN-569] - Support increment+merge job
+    * [KYLIN-578] - add more generic configuration for ssh
+    * [KYLIN-601] - Extract content from kylin.tgz to "kylin" folder
+    * [KYLIN-616] - Validation Rule: partition date column should be in dimension columns
+    * [KYLIN-634] - Script to import sample data and cube metadata
+    * [KYLIN-636] - wiki/On-Hadoop-CLI-installation is not up to date
+    * [KYLIN-637] - add start&end date for hbase info in cubeDesigner
+    * [KYLIN-714] - Add Apache RAT to pom.xml
+    * [KYLIN-753] - Make the dependency on hbase-common to "provided"
+    * [KYLIN-758] - Updating port forwarding issue Hadoop Installation on Hortonworks Sandbox.
+    * [KYLIN-779] - [UI] jump to cube list after create cube
+    * [KYLIN-796] - Add REST API to trigger storage cleanup/GC
+
+__Wish__
+
+    * [KYLIN-608] - Distinct count for ii storage
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d6a188d6/docs/website/download/index.cn.md
----------------------------------------------------------------------
diff --git a/docs/website/download/index.cn.md b/docs/website/download/index.cn.md
index 8065863..7862e6b 100644
--- a/docs/website/download/index.cn.md
+++ b/docs/website/download/index.cn.md
@@ -31,5 +31,12 @@ Apache Kylin ODBC驱动:
   * [Kylin ODBC Driver](http://kylin.incubator.apache.org/download/KylinODBC.zip)
   * _Source Code will be migrated to Apache Source Repo in next release_
 
+__开发版本 (v0.7.x)__
+
+最新的开发版本二进制包:
+
+  * [kylin-v0.7.2-incubating-SNAPSHOT](http://kylin.incubator.apache.org/download/kylin-0.7.2-incubating-SNAPSHOT.tar.gz)
+  * 更新日期: 2015-06-30
+  * Commit ID: e7fcc20d8ab6f824eb6b88b8f8fa133e284dc34f
 
 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d6a188d6/docs/website/download/index.md
----------------------------------------------------------------------
diff --git a/docs/website/download/index.md b/docs/website/download/index.md
index 0b12329..a8ec55f 100644
--- a/docs/website/download/index.md
+++ b/docs/website/download/index.md
@@ -2,6 +2,7 @@
 layout: download
 title: Download
 ---
+
 __Latest Release__
 
 The latest release of Apache Kylin can be downloaded from the ASF:
@@ -31,5 +32,13 @@ And ODBC Driver could be find here:
   * [Kylin ODBC Driver](http://kylin.incubator.apache.org/download/KylinODBC.zip)
   * _Source Code will be migrated to Apache Source Repo in next release_
 
+__Development Version (v0.7.x)__
+
+Here's latest development version binary package:
+
+  * [kylin-v0.7.2-incubating-SNAPSHOT](http://kylin.incubator.apache.org/download/kylin-0.7.2-incubating-SNAPSHOT.tar.gz)
+  * Updated Date: 2015-06-30
+  * Commit ID: e7fcc20d8ab6f824eb6b88b8f8fa133e284dc34f
+
 
 


[13/19] incubator-kylin git commit: KYLIN-884 update docs index file

Posted by lu...@apache.org.
KYLIN-884 update docs index file


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/b6eaf1a0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/b6eaf1a0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/b6eaf1a0

Branch: refs/heads/0.7-staging
Commit: b6eaf1a03a0bad4af2e7303e1c2ae8683be7a88d
Parents: 37037d0
Author: Luke Han <lu...@apache.org>
Authored: Mon Jul 13 16:25:19 2015 +0800
Committer: Luke Han <lu...@apache.org>
Committed: Mon Jul 13 16:25:19 2015 +0800

----------------------------------------------------------------------
 docs/website/blog/index.html~ |  64 ------------------
 docs/website/blog/index.md~   |  43 ------------
 docs/website/docs/index.cn.md | 134 +++++++++++++------------------------
 3 files changed, 48 insertions(+), 193 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/b6eaf1a0/docs/website/blog/index.html~
----------------------------------------------------------------------
diff --git a/docs/website/blog/index.html~ b/docs/website/blog/index.html~
deleted file mode 100644
index b287c89..0000000
--- a/docs/website/blog/index.html~
+++ /dev/null
@@ -1,64 +0,0 @@
----
-layout: default
-title: Blog
----
-
-<!--
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
--->
-
-
-<main id="main" >
-<section id="first" class="main">
-    <header style="padding:2em 0 4em 0;">
-      <div class="container" >
-        <h4 class="section-title"><span> Kylin Technical Blog </span></h4>
-         <!-- second-->
-          <div id="content-container" class="animated fadeIn">
-            <div >
-            <!--
-            <p class="aboutkylin" style="font-size:1.2em">Comming Soon...</p>
-            -->
-             <ul class="post-list">
-            {% for category in site.categories %}     <!-- categories -->
-            {% if category[0]  != 'blog' %}
-            {% for post in category[1] %}
-            <li>
-            <!--
-            <span align="left" class="content-header">{{ post.date | date: "%b %-d, %Y" }}</span>
-            -->
-        <h2 align="left">
-          <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
-        </h2>
-      </li>
-    {% endfor %}
-    {% endif %}
-    {% endfor %}
-  </ul>
-
-  <p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>
-          </div>
-        </div>
-      </div>
-      <!-- /container --> 
-      
-    </header>
-  </section>
-
-  
-    
-</main>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/b6eaf1a0/docs/website/blog/index.md~
----------------------------------------------------------------------
diff --git a/docs/website/blog/index.md~ b/docs/website/blog/index.md~
deleted file mode 100644
index 28a57e1..0000000
--- a/docs/website/blog/index.md~
+++ /dev/null
@@ -1,43 +0,0 @@
----
-layout: default
-title: Blog
----
-
-
-<main id="main" >
-<section id="first" class="main">
-    <header style="padding:2em 0 4em 0;">
-      <div class="container" >
-        <h4 class="section-title"><span> Kylin Technical Blog </span></h4>
-         <!-- second-->
-          <div id="content-container" class="animated fadeIn">
-            <div >
-            <!--
-            <p class="aboutkylin" style="font-size:1.2em">Comming Soon...</p>
-            -->
-             <ul class="post-list">
-            <!-- {% for post in site.posts %} -->
-            <li>
-            <!--
-            <span align="left" class="content-header">{{ post.date | date: "%b %-d, %Y" }}</span>
-            -->
-            <p>{{post.url}}</p>
-        <h2 align="left">
-          <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
-        </h2>
-      </li>
-    {% endfor %}
-  </ul>
-
-  <p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>
-          </div>
-        </div>
-      </div>
-      <!-- /container --> 
-      
-    </header>
-  </section>
-
-  
-    
-</main>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/b6eaf1a0/docs/website/docs/index.cn.md
----------------------------------------------------------------------
diff --git a/docs/website/docs/index.cn.md b/docs/website/docs/index.cn.md
index 699b571..de09a90 100644
--- a/docs/website/docs/index.cn.md
+++ b/docs/website/docs/index.cn.md
@@ -1,90 +1,52 @@
 ---
 layout: docs-cn
-title: Docs
+title: 文档
 ---
 
-<main id="main" >
-  <div class="container" >
-    <div id="zero" class=" main" >
-      <header style=" padding:1.0em 0 4em 0">
-        <div class="container" >
-
-         
-     <div id="content-container" class="animated fadeIn">
-       
-
-<p class="content-header" >What should I use Kylin for?</p>
-<p class="content-p">
-If you want to do multi-dimension analysis on large data sets (billion+ rows) with low query latency (sub-seconds), Kylin is a good option. Kylin also provides good integration with existing BI tools (e.g Tableau).
-</p>
-
-<hr/>
- 
-<p class="content-header">Why existing SQL-on-Hadoop solutions fall short?</p>
-<p class="content-p">
-The existing SQL-on-Hadoop needs to scan partial or whole data set to answer a user query. Due to large data scan, many queries are very slow (minute+ latency).  
-</p>
-<hr/>
- 
-<p class="content-header">What is MOLAP/ROLAP?</p>
-<p class="content-p">
-MOLAP (Multi-dimensional OLAP) is to pre-compute data along different dimensions of interest and store resultant values in the cube. MOLAP is much faster but is inflexible.
-ROLAP (Relational-OLAP) is to use star or snow-flake schema to do runtime aggregation. ROLAP is flexible but much slower.
-</p>
-<hr/>
-
-<p class="content-header">How does Kylin support ROLAP/MOLAP?</p>
-<p class="content-p">
-Kylin builds data cube (MOLAP) from hive table (ROLAP) according to the metadata definition.
-If the query can be fulfilled by data cube, Kylin will route the query to data cube that is MOLAP.
-If the query can’t be fulfilled by data cube, Kylin will route the query to hive table that is ROLAP.
-Basically, you can think Kylin as HOLAP on top of MOLAP and ROLAP. 
-</p>
-<hr/>
-<p class="content-header">What does a Kylin query look like?</p>
-<p class="content-p">
-Kylin supports join, projection, filter, aggregation, groups and sub-query. For example:
-<div align="left">
-
-<pre class="prettyprint" style="margin-top:1em;">select test_cal_dt.week_beg_dt, test_category.lv1_categ, test_category.lv2_categ, test_kylin_fact.format_name, test_sites.site_name, sum(test_kylin_fact.price) as total_price, count(*) as total_count from test_kylin_fact left join test_cal_dt on test_kylin_fact.cal_dt = test_cal_dt.cal_dt left join test_category on test_kylin_fact.leaf_categ_id = test_category.leaf_categ_id and test_kylin_fact.site_id = test_category.site_id left join test_sites on test_kylin_fact.site_id = test_sites.site_id where test_kylin_fact.seller_id = 123456 or test_kylin_fact.format_name = 'New' group by test_cal_dt.week_beg_dt, test_category.lv1_categ, test_category.lv2_categ, test_kylin_fact.format_name, test_sites.site_name</pre>
-</div>
-<hr/>
-
-<p class="content-header">What Hadoop components does it work with?</p>
-<p class="content-p">
-Kylin depends on HDFS, MapReduce, Hive and HBase.
-Hive and MapReduce is used for cube building. Hive is used for pre-join and MapReduce is used for pre-aggregation.
-HDFS is used to store intermediated files during cube building.
-HBase is used to store data cube and answer the query. HBase coprocessor is also used for query processing.
-</p>
-<hr/>
-
-<!-- Migrate wiki to here 
-<p class="content-header">Where can I find the technical details about Kylin?</p>
-<p class="content-p"><a href="http://www.slideshare.net/XuJiang2/kylin-hadoop-olap-engine" target="_blank">Kylin Wiki</a></p>
-
--->
-
-     </div>
-         
-         </div><!--end of rightcontent-->
-         
-         </div><!--end of row-->
-        </div>
-        <!-- /container --> 
-        
-        
-        
-      </header>
-    </div>
-    <!-- / section --> 
-  </div>
-  <!-- /container -->
- 
-
-  
-
-      
-    </header>
-  </section>
-</main>
+Welcome to Apache Kylin
+------------  
+> Extreme OLAP Engine for Big Data
+
+Apache Kylin is an open source Distributed Analytics Engine, contributed by eBay Inc., provides SQL interface and multi-dimensional analysis (OLAP) on Hadoop supporting extremely large datasets.
+
+Installation 
+------------  
+Please follow  installation & tutorial to start with Kylin.
+
+Advanced Topics
+-------  
+####Connectivity
+1.[How to use kylin remote jdbc driver](docs/Tutorial/How to use kylin remote jdbc driver.md)
+
+2.[SQL Reference](https://github.com/apache/incubator-calcite/blob/master/doc/reference.md)
+
+####REST
+
+1.[Kylin Restful API List](docs/REST/Kylin Restful API List.md)
+
+2.[Build Cube with Restful API](docs/REST/Build Cube with Restful API.md)
+
+3.[How to consume Kylin REST API in javascript](docs/REST/How to consume Kylin REST API in javascript.md)
+
+####Operations
+1.[Kylin Metadata Store](docs/Operations/Kylin Metadata Store.md)
+
+2.[Export Kylin HBase data](docs/Operations/Export Kylin HBase data.md)
+
+3.[Advanced settings of Kylin environment](docs/Operations/Advanced settings of Kylin environment.md)
+
+####Test
+
+1.[Run Kylin test case with HBase Mini Cluster](docs/Test/Run Kylin test case with HBase Mini Cluster.md)
+
+
+####Technial Details
+
+1.[New meta data model structure](docs/TechInside/New meta data model structure.md)
+
+2.[Job Engine Design](docs/JobEngine/Design.md)
+
+
+## Disclaimer
+
+Apache Kylin is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.