phoenix git commit: PHOENIX-418 Support approximate COUNT DISTINCT (Ethan Wang)

2017-08-28 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 3f4e72324 -> 4a81d9277


PHOENIX-418 Support approximate COUNT DISTINCT (Ethan Wang)


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 4a81d9277ba93dc9d3969ac416ed2215ef73810d
Parents: 3f4e723
Author: James Taylor 
Authored: Mon Aug 28 15:17:37 2017 -0700
Committer: James Taylor 
Committed: Mon Aug 28 15:22:04 2017 -0700

--
 dev/release_files/NOTICE|   8 +
 phoenix-core/pom.xml|   5 +
 .../CountDistinctApproximateHyperLogLogIT.java  | 154 +++
 .../phoenix/expression/ExpressionType.java  |   4 +-
 ...stinctCountHyperLogLogAggregateFunction.java | 192 +++
 ...tinctCountHyperLogLogAggregateParseNode.java |  39 
 6 files changed, 401 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4a81d927/dev/release_files/NOTICE
--
diff --git a/dev/release_files/NOTICE b/dev/release_files/NOTICE
index eed1edc..b7b40c0 100644
--- a/dev/release_files/NOTICE
+++ b/dev/release_files/NOTICE
@@ -277,3 +277,11 @@ jcip-annotations
 findbugs-annotations
 
   Copyright Stephen Connolly.
+
+stream-lib
+
+  Copyright 2016 AddThis.
+  This product includes software developed by AddThis.
+  This product also includes code adapted from:
+- software copyright (c) 2014 The Apache Software Foundation., 
http://lucene.apache.org/solr/
+- software copyright (c) 2014 The Apache Software Foundation., 
http://mahout.apache.org/

http://git-wip-us.apache.org/repos/asf/phoenix/blob/4a81d927/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index 275b72f..ce44171 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -470,5 +470,10 @@
 joni
 ${joni.version}
 
+
+  com.clearspring.analytics
+  stream
+  2.9.5
+
   
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/4a81d927/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
new file mode 100644
index 000..3de1509
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
@@ -0,0 +1,154 @@
+/*
+ * 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.phoenix.end2end;
+
+import org.apache.phoenix.schema.ColumnNotFoundException;
+import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.QueryUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.sql.*;
+import java.util.Properties;
+
+import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
+import static org.junit.Assert.*;
+
+public class CountDistinctApproximateHyperLogLogIT extends 
ParallelStatsDisabledIT {
+   private String tableName;
+
+   @Before
+   public void generateTableNames() {
+   tableName = "T_" + generateUniqueName();
+   }
+
+   @Test(expected = ColumnNotFoundException.class)
+   public void testDistinctCountException() throws Exception {
+   String query = "SELECT APPROX_COUNT_DISTINCT(x) FROM " + 
tableName;
+   Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+   
+   try (Connection conn = DriverManager.getConnection(getUrl(), 
props);
+   PreparedStatement statement = 

phoenix git commit: PHOENIX-418 Support approximate COUNT DISTINCT (Ethan Wang)

2017-08-28 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 793f26a4b -> ce6810f42


PHOENIX-418 Support approximate COUNT DISTINCT (Ethan Wang)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: ce6810f42310a368183ed5c9185ab1e16f83dbd0
Parents: 793f26a
Author: James Taylor 
Authored: Mon Aug 28 15:17:37 2017 -0700
Committer: James Taylor 
Committed: Mon Aug 28 15:19:12 2017 -0700

--
 dev/release_files/NOTICE|   8 +
 phoenix-core/pom.xml|   5 +
 .../CountDistinctApproximateHyperLogLogIT.java  | 154 +++
 .../phoenix/expression/ExpressionType.java  |   4 +-
 ...stinctCountHyperLogLogAggregateFunction.java | 192 +++
 ...tinctCountHyperLogLogAggregateParseNode.java |  39 
 6 files changed, 401 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ce6810f4/dev/release_files/NOTICE
--
diff --git a/dev/release_files/NOTICE b/dev/release_files/NOTICE
index eed1edc..b7b40c0 100644
--- a/dev/release_files/NOTICE
+++ b/dev/release_files/NOTICE
@@ -277,3 +277,11 @@ jcip-annotations
 findbugs-annotations
 
   Copyright Stephen Connolly.
+
+stream-lib
+
+  Copyright 2016 AddThis.
+  This product includes software developed by AddThis.
+  This product also includes code adapted from:
+- software copyright (c) 2014 The Apache Software Foundation., 
http://lucene.apache.org/solr/
+- software copyright (c) 2014 The Apache Software Foundation., 
http://mahout.apache.org/

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ce6810f4/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index e85ab5a..333c203 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -465,5 +465,10 @@
 joni
 ${joni.version}
 
+
+  com.clearspring.analytics
+  stream
+  2.9.5
+
   
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ce6810f4/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
new file mode 100644
index 000..3de1509
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
@@ -0,0 +1,154 @@
+/*
+ * 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.phoenix.end2end;
+
+import org.apache.phoenix.schema.ColumnNotFoundException;
+import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.QueryUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.sql.*;
+import java.util.Properties;
+
+import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
+import static org.junit.Assert.*;
+
+public class CountDistinctApproximateHyperLogLogIT extends 
ParallelStatsDisabledIT {
+   private String tableName;
+
+   @Before
+   public void generateTableNames() {
+   tableName = "T_" + generateUniqueName();
+   }
+
+   @Test(expected = ColumnNotFoundException.class)
+   public void testDistinctCountException() throws Exception {
+   String query = "SELECT APPROX_COUNT_DISTINCT(x) FROM " + 
tableName;
+   Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+   
+   try (Connection conn = DriverManager.getConnection(getUrl(), 
props);
+   PreparedStatement statement = 

phoenix git commit: PHOENIX-418 Support approximate COUNT DISTINCT (Ethan Wang)

2017-08-28 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 435441ea8 -> d6381afc3


PHOENIX-418 Support approximate COUNT DISTINCT (Ethan Wang)


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

Branch: refs/heads/master
Commit: d6381afc3af976ccdbb874d4458ea17b1e8a1d32
Parents: 435441e
Author: James Taylor 
Authored: Mon Aug 28 15:17:37 2017 -0700
Committer: James Taylor 
Committed: Mon Aug 28 15:17:37 2017 -0700

--
 dev/release_files/NOTICE|   8 +
 phoenix-core/pom.xml|   5 +
 .../CountDistinctApproximateHyperLogLogIT.java  | 154 +++
 .../phoenix/expression/ExpressionType.java  |   4 +-
 ...stinctCountHyperLogLogAggregateFunction.java | 192 +++
 ...tinctCountHyperLogLogAggregateParseNode.java |  39 
 6 files changed, 401 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d6381afc/dev/release_files/NOTICE
--
diff --git a/dev/release_files/NOTICE b/dev/release_files/NOTICE
index eed1edc..b7b40c0 100644
--- a/dev/release_files/NOTICE
+++ b/dev/release_files/NOTICE
@@ -277,3 +277,11 @@ jcip-annotations
 findbugs-annotations
 
   Copyright Stephen Connolly.
+
+stream-lib
+
+  Copyright 2016 AddThis.
+  This product includes software developed by AddThis.
+  This product also includes code adapted from:
+- software copyright (c) 2014 The Apache Software Foundation., 
http://lucene.apache.org/solr/
+- software copyright (c) 2014 The Apache Software Foundation., 
http://mahout.apache.org/

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d6381afc/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index 86c92fa..82cdacc 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -470,5 +470,10 @@
 joni
 ${joni.version}
 
+
+  com.clearspring.analytics
+  stream
+  2.9.5
+
   
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d6381afc/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
new file mode 100644
index 000..3de1509
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CountDistinctApproximateHyperLogLogIT.java
@@ -0,0 +1,154 @@
+/*
+ * 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.phoenix.end2end;
+
+import org.apache.phoenix.schema.ColumnNotFoundException;
+import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.QueryUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.sql.*;
+import java.util.Properties;
+
+import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
+import static org.junit.Assert.*;
+
+public class CountDistinctApproximateHyperLogLogIT extends 
ParallelStatsDisabledIT {
+   private String tableName;
+
+   @Before
+   public void generateTableNames() {
+   tableName = "T_" + generateUniqueName();
+   }
+
+   @Test(expected = ColumnNotFoundException.class)
+   public void testDistinctCountException() throws Exception {
+   String query = "SELECT APPROX_COUNT_DISTINCT(x) FROM " + 
tableName;
+   Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+   
+   try (Connection conn = DriverManager.getConnection(getUrl(), 
props);
+   PreparedStatement statement =