PHOENIX-3842 Turn off all BloomFilter for Phoenix tables (Lars Hofhansl)

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

Branch: refs/heads/4.x-HBase-1.1
Commit: 9838dcfc53472a1491bff9fcfc9c071e901cd9bd
Parents: b5312b4
Author: Andrew Purtell <apurt...@apache.org>
Authored: Wed May 10 17:45:58 2017 -0700
Committer: Andrew Purtell <apurt...@apache.org>
Committed: Wed May 10 17:46:25 2017 -0700

----------------------------------------------------------------------
 .../apache/phoenix/end2end/CreateTableIT.java   | 22 ++++++++++++++++++++
 .../query/ConnectionQueryServicesImpl.java      |  2 ++
 2 files changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9838dcfc/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
index 96ba71d..f10c6d9 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
@@ -35,6 +35,7 @@ import java.util.Properties;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.regionserver.BloomType;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.jdbc.PhoenixConnection;
@@ -114,6 +115,9 @@ public class CreateTableIT extends BaseClientManagedTimeIT {
         }
         HBaseAdmin admin = driver.getConnectionQueryServices(getUrl(), 
props).getAdmin();
         assertNotNull(admin.getTableDescriptor(Bytes.toBytes(tableName)));
+        HColumnDescriptor[] columnFamilies = 
admin.getTableDescriptor(Bytes.toBytes(tableName)).getColumnFamilies();
+        assertEquals(BloomType.NONE, columnFamilies[0].getBloomFilterType());
+
         props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
         try (Connection conn = DriverManager.getConnection(getUrl(), props);) {
             conn.createStatement().execute(ddl);
@@ -384,6 +388,24 @@ public class CreateTableIT extends BaseClientManagedTimeIT 
{
        assertEquals(10000, columnFamilies[0].getTimeToLive());
     }
     
+    @Test
+    public void testCreateTableColumnFamilyHBaseAttribs8() throws Exception {
+        String ddl = "create table IF NOT EXISTS TEST8 ("
+                + " id char(1) NOT NULL,"
+                + " col1 integer NOT NULL,"
+                + " col2 bigint NOT NULL,"
+                + " CONSTRAINT NAME_PK PRIMARY KEY (id, col1, col2)"
+                + " ) BLOOMFILTER = 'ROW', SALT_BUCKETS = 4";
+        long ts = nextTimestamp();
+        Properties props = new Properties();
+        props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, 
Long.toString(ts));
+        Connection conn = DriverManager.getConnection(getUrl(), props);
+        conn.createStatement().execute(ddl);
+        HBaseAdmin admin = driver.getConnectionQueryServices(getUrl(), 
props).getAdmin();
+        HColumnDescriptor[] columnFamilies = 
admin.getTableDescriptor(Bytes.toBytes("TEST8")).getColumnFamilies();
+        assertEquals(BloomType.ROW, columnFamilies[0].getBloomFilterType());
+    }
+    
     
     /**
      * Test to ensure that NOT NULL constraint isn't added to a non primary 
key column.

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9838dcfc/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index 0ca5995..463819c 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -120,6 +120,7 @@ import org.apache.hadoop.hbase.ipc.BlockingRpcCallback;
 import org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory;
 import org.apache.hadoop.hbase.ipc.ServerRpcController;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto;
+import org.apache.hadoop.hbase.regionserver.BloomType;
 import org.apache.hadoop.hbase.regionserver.IndexHalfStoreFileReaderGenerator;
 import org.apache.hadoop.hbase.security.AccessDeniedException;
 import org.apache.hadoop.hbase.util.ByteStringer;
@@ -734,6 +735,7 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
                         QueryServices.DEFAULT_KEEP_DELETED_CELLS_ATTRIB, 
QueryServicesOptions.DEFAULT_KEEP_DELETED_CELLS));
             }
             
columnDesc.setDataBlockEncoding(SchemaUtil.DEFAULT_DATA_BLOCK_ENCODING);
+            columnDesc.setBloomFilterType(BloomType.NONE);
             for (Entry<String,Object> entry : family.getSecond().entrySet()) {
                 String key = entry.getKey();
                 Object value = entry.getValue();

Reply via email to