Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 ed30d1ff1 -> 4beb182db refs/heads/4.x-HBase-1.1 b5312b4bf -> 9838dcfc5 refs/heads/4.x-HBase-1.2 ae76def9a -> 6b4647805 refs/heads/master 37d0a4a03 -> f6fbb0dc9
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/4beb182d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/4beb182d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/4beb182d Branch: refs/heads/4.x-HBase-0.98 Commit: 4beb182db738e0770c0feea138c5460b43769212 Parents: ed30d1f 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:45:58 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/4beb182d/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/4beb182d/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 7d65d5a..16db802 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; @@ -735,6 +736,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();