Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 bfd9ab750 -> 6f18b38fa
Revert "PHOENIX-3930 Move BaseQueryIT to ParallelStatsDisabledIT" This reverts commit 68be489280d9c4298ccef8213a055347379d9494. Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/6f18b38f Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/6f18b38f Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/6f18b38f Branch: refs/heads/4.x-HBase-0.98 Commit: 6f18b38fa32c5e55e9995d4713e4e66617a919fd Parents: bfd9ab7 Author: James Taylor <[email protected]> Authored: Fri Jun 9 12:05:33 2017 -0700 Committer: James Taylor <[email protected]> Committed: Fri Jun 9 12:05:33 2017 -0700 ---------------------------------------------------------------------- .../phoenix/end2end/AggregateQueryIT.java | 2 +- .../org/apache/phoenix/end2end/BaseQueryIT.java | 60 +++++++++----- .../apache/phoenix/end2end/CaseStatementIT.java | 2 +- .../apache/phoenix/end2end/CastAndCoerceIT.java | 2 +- .../end2end/ClientTimeArithmeticQueryIT.java | 42 +++++----- .../end2end/ColumnProjectionOptimizationIT.java | 1 + .../org/apache/phoenix/end2end/GroupByIT.java | 39 ++++++--- .../apache/phoenix/end2end/MutableQueryIT.java | 14 +++- .../org/apache/phoenix/end2end/NotQueryIT.java | 2 +- .../phoenix/end2end/PointInTimeQueryIT.java | 37 ++++++--- .../end2end/QueryDatabaseMetaDataIT.java | 85 +++++++------------- .../org/apache/phoenix/end2end/QueryIT.java | 2 +- .../org/apache/phoenix/end2end/ScanQueryIT.java | 2 +- .../java/org/apache/phoenix/query/BaseTest.java | 9 +++ 14 files changed, 167 insertions(+), 132 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateQueryIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateQueryIT.java index 9a82e4b..a205814 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateQueryIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateQueryIT.java @@ -46,7 +46,7 @@ import org.junit.Test; public class AggregateQueryIT extends BaseQueryIT { public AggregateQueryIT(String indexDDL, boolean mutable, boolean columnEncoded) { - super(indexDDL, mutable, columnEncoded, false); + super(indexDDL, mutable, columnEncoded); } @Test http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java index 2c2ea9c..9a58b5b 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java @@ -30,16 +30,18 @@ import java.util.Map; import java.util.Properties; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.Pair; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.schema.PTableImpl; import org.apache.phoenix.util.ByteUtil; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.PropertiesUtil; import org.apache.phoenix.util.ReadOnlyProps; +import org.junit.AfterClass; +import org.junit.Before; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -59,7 +61,7 @@ import com.google.common.collect.Maps; */ @RunWith(Parameterized.class) -public abstract class BaseQueryIT extends ParallelStatsDisabledIT { +public abstract class BaseQueryIT extends BaseClientManagedTimeIT { protected static final String tenantId = getOrganizationId(); protected static final String ATABLE_INDEX_NAME = "ATABLE_IDX"; protected static final long BATCH_SIZE = 3; @@ -77,19 +79,26 @@ public abstract class BaseQueryIT extends ParallelStatsDisabledIT { "CREATE LOCAL INDEX %s ON %s (a_integer) INCLUDE (" + " A_STRING, " + " B_STRING, " + " A_DATE)", "" }; - + @BeforeClass - @Shadower(classBeingShadowed = ParallelStatsDisabledIT.class) + @Shadower(classBeingShadowed = BaseClientManagedTimeIT.class) public static void doSetup() throws Exception { - Map<String,String> props = Maps.newHashMapWithExpectedSize(5); - // Must update config before starting server - props.put(QueryServices.STATS_USE_CURRENT_TIME_ATTRIB, Boolean.FALSE.toString()); + doSetup(null); + } + + protected static void doSetup(Map<String,String> customProps) throws Exception { + Map<String,String> props = getDefaultProps(); + if(customProps != null) { + props.putAll(customProps); + } // Make a small batch size to test multiple calls to reserve sequences props.put(QueryServices.SEQUENCE_CACHE_SIZE_ATTRIB, Long.toString(BATCH_SIZE)); // Must update config before starting server setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); } + private static Map<Pair<String, String>, Pair<String, String>> namesByParams = Maps.newHashMapWithExpectedSize(10); + protected long ts; protected Date date; private String indexDDL; @@ -97,7 +106,7 @@ public abstract class BaseQueryIT extends ParallelStatsDisabledIT { protected String tableName; protected String indexName; - public BaseQueryIT(String idxDdl, boolean mutable, boolean columnEncoded, boolean keepDeletedCells) { + public BaseQueryIT(String idxDdl, boolean mutable, boolean columnEncoded) { StringBuilder optionBuilder = new StringBuilder(); if (!columnEncoded) { optionBuilder.append("COLUMN_ENCODED_BYTES=0"); @@ -110,28 +119,37 @@ public abstract class BaseQueryIT extends ParallelStatsDisabledIT { optionBuilder.append(",IMMUTABLE_STORAGE_SCHEME="+PTableImpl.ImmutableStorageScheme.ONE_CELL_PER_COLUMN); } } - if (keepDeletedCells) { - if (optionBuilder.length()>0) - optionBuilder.append(","); - optionBuilder.append(HColumnDescriptor.KEEP_DELETED_CELLS + "=true"); - } this.tableDDLOptions = optionBuilder.toString(); try { this.ts = nextTimestamp(); - this.tableName = initATableValues(generateUniqueName(), tenantId, getDefaultSplits(tenantId), date=new Date(System.currentTimeMillis()), ts, getUrl(), tableDDLOptions); - this.indexName = generateUniqueName(); - if (idxDdl.length() > 0) { - this.indexDDL = String.format(idxDdl, indexName, tableName); - Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); - Connection conn = DriverManager.getConnection(getUrl(), props); - conn.createStatement().execute(this.indexDDL); + Pair<String, String> runParam = new Pair<>(idxDdl, tableDDLOptions); + Pair<String, String> tableIndexNames = namesByParams.get(runParam); + if (tableIndexNames == null) { + this.tableName = initATableValues(null, tenantId, getDefaultSplits(tenantId), date=new Date(System.currentTimeMillis()), ts, getUrl(), tableDDLOptions); + this.indexName = generateUniqueName(); + namesByParams.put(runParam, new Pair<>(tableName, indexName)); + if (idxDdl.length() > 0) { + this.indexDDL = String.format(idxDdl, indexName, tableName); + Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); + props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); + Connection conn = DriverManager.getConnection(getUrl(), props); + conn.createStatement().execute(this.indexDDL); + } + } else { + this.tableName = tableIndexNames.getFirst(); + this.indexName = tableIndexNames.getSecond(); + initATableValues(this.tableName, tenantId, getDefaultSplits(tenantId), date=new Date(System.currentTimeMillis()), ts, getUrl(), tableDDLOptions); } } catch (Exception e) { throw new RuntimeException(e); } } + @Before + public void init() throws Exception { + this.ts = nextTimestamp(); + } + @Parameters(name="indexDDL={0},mutable={1},columnEncoded={2}") public static Collection<Object> data() { List<Object> testCases = Lists.newArrayList(); http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java index ee18152..31b08db 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java @@ -56,7 +56,7 @@ import com.google.common.collect.Lists; public class CaseStatementIT extends BaseQueryIT { public CaseStatementIT(String indexDDL, boolean mutable, boolean columnEncoded) { - super(indexDDL, mutable, columnEncoded, false); + super(indexDDL, mutable, columnEncoded); } @Parameters(name="CaseStatementIT_{index}") // name is used by failsafe as file name in reports http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/CastAndCoerceIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CastAndCoerceIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CastAndCoerceIT.java index e574286..bab18d5 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CastAndCoerceIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CastAndCoerceIT.java @@ -44,7 +44,7 @@ import org.junit.runners.Parameterized.Parameters; public class CastAndCoerceIT extends BaseQueryIT { public CastAndCoerceIT(String indexDDL, boolean mutable, boolean columnEncoded) { - super(indexDDL, mutable, columnEncoded, false); + super(indexDDL, mutable, columnEncoded); } @Parameters(name="CastAndCoerceIT_{index}") // name is used by failsafe as file name in reports http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/ClientTimeArithmeticQueryIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ClientTimeArithmeticQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ClientTimeArithmeticQueryIT.java index c981bb5..3330a08 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ClientTimeArithmeticQueryIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ClientTimeArithmeticQueryIT.java @@ -61,7 +61,7 @@ import com.google.common.collect.Lists; public class ClientTimeArithmeticQueryIT extends BaseQueryIT { public ClientTimeArithmeticQueryIT(String indexDDL, boolean mutable, boolean columnEncoded) { - super(indexDDL, mutable, columnEncoded, false); + super(indexDDL, mutable, columnEncoded); } @Parameters(name="ClientTimeArithmeticQueryIT_{index}") // name is used by failsafe as file name in reports @@ -650,23 +650,23 @@ public class ClientTimeArithmeticQueryIT extends BaseQueryIT { conn = DriverManager.getConnection(getUrl(), props); conn.createStatement() .execute( - "create table " + tableName + " (ts timestamp primary key)"); + "create table timestamp_table (ts timestamp primary key)"); conn.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 30)); conn = DriverManager.getConnection(getUrl(), props); - stmt = conn.prepareStatement("upsert into " + tableName + " values (?)"); + stmt = conn.prepareStatement("upsert into timestamp_table values (?)"); stmt.setTimestamp(1, new Timestamp(1995 - 1900, 4, 2, 1, 1, 1, 1)); stmt.execute(); conn.commit(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 60)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT ts FROM " + tableName + ""); + rs = conn.createStatement().executeQuery("SELECT ts FROM timestamp_table"); assertTrue(rs.next()); assertEquals("1995-05-02 01:01:01.000000001",rs.getTimestamp(1).toString()); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 70)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT ts + 1 FROM " + tableName + ""); + rs = conn.createStatement().executeQuery("SELECT ts + 1 FROM timestamp_table"); assertTrue(rs.next()); assertEquals("1995-05-03 01:01:01.000000001",rs.getTimestamp(1).toString()); } @@ -683,23 +683,23 @@ public class ClientTimeArithmeticQueryIT extends BaseQueryIT { conn = DriverManager.getConnection(getUrl(), props); conn.createStatement() .execute( - "create table " + tableName + " (ts timestamp primary key)"); + "create table timestamp_table (ts timestamp primary key)"); conn.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 30)); conn = DriverManager.getConnection(getUrl(), props); - stmt = conn.prepareStatement("upsert into " + tableName + " values (?)"); + stmt = conn.prepareStatement("upsert into timestamp_table values (?)"); stmt.setTimestamp(1, new Timestamp(1995 - 1900, 4, 2, 1, 1, 1, 1)); stmt.execute(); conn.commit(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 60)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT ts FROM " + tableName); + rs = conn.createStatement().executeQuery("SELECT ts FROM timestamp_table"); assertTrue(rs.next()); assertEquals("1995-05-02 01:01:01.000000001",rs.getTimestamp(1).toString()); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 70)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT ts - 1 FROM " + tableName); + rs = conn.createStatement().executeQuery("SELECT ts - 1 FROM timestamp_table"); assertTrue(rs.next()); assertEquals("1995-05-01 01:01:01.000000001",rs.getTimestamp(1).toString()); } @@ -716,24 +716,24 @@ public class ClientTimeArithmeticQueryIT extends BaseQueryIT { conn = DriverManager.getConnection(getUrl(), props); conn.createStatement() .execute( - "create table " + tableName + " (ts time primary key)"); + "create table time_table (ts time primary key)"); conn.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 30)); conn = DriverManager.getConnection(getUrl(), props); - stmt = conn.prepareStatement("upsert into " + tableName + " values (?)"); + stmt = conn.prepareStatement("upsert into time_table values (?)"); Time time = new Time(1995 - 1900, 4, 2); stmt.setTime(1, time); stmt.execute(); conn.commit(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 60)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT ts FROM " + tableName); + rs = conn.createStatement().executeQuery("SELECT ts FROM time_table"); assertTrue(rs.next()); assertEquals(time.getTime(),rs.getTimestamp(1).getTime()); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 70)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT ts + 1 FROM " + tableName); + rs = conn.createStatement().executeQuery("SELECT ts + 1 FROM time_table"); assertTrue(rs.next()); assertEquals(time.getTime() + MILLIS_IN_DAY,rs.getTimestamp(1).getTime()); } @@ -750,24 +750,24 @@ public class ClientTimeArithmeticQueryIT extends BaseQueryIT { conn = DriverManager.getConnection(getUrl(), props); conn.createStatement() .execute( - "create table " + tableName + " (ts time primary key)"); + "create table time_table (ts time primary key)"); conn.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 30)); conn = DriverManager.getConnection(getUrl(), props); - stmt = conn.prepareStatement("upsert into " + tableName + " values (?)"); + stmt = conn.prepareStatement("upsert into time_table values (?)"); Time time = new Time(1995 - 1900, 4, 2); stmt.setTime(1, time); stmt.execute(); conn.commit(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 60)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT ts FROM " + tableName + ""); + rs = conn.createStatement().executeQuery("SELECT ts FROM time_table"); assertTrue(rs.next()); assertEquals(time.getTime(),rs.getTimestamp(1).getTime()); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 70)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT ts - 1 FROM " + tableName); + rs = conn.createStatement().executeQuery("SELECT ts - 1 FROM time_table"); assertTrue(rs.next()); assertEquals(time.getTime() - MILLIS_IN_DAY,rs.getTimestamp(1).getTime()); } @@ -784,23 +784,23 @@ public class ClientTimeArithmeticQueryIT extends BaseQueryIT { conn = DriverManager.getConnection(getUrl(), props); conn.createStatement() .execute( - "create table " + tableName + " (ts date primary key)"); + "create table date_table (ts date primary key)"); conn.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 30)); conn = DriverManager.getConnection(getUrl(), props); - stmt = conn.prepareStatement("upsert into " + tableName + " values (?)"); + stmt = conn.prepareStatement("upsert into date_table values (?)"); stmt.setDate(1, new Date(1995 - 1900, 4, 2)); stmt.execute(); conn.commit(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 60)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT ts FROM " + tableName); + rs = conn.createStatement().executeQuery("SELECT ts FROM date_table"); assertTrue(rs.next()); assertEquals("1995-05-02",rs.getDate(1).toString()); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 70)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT ts - 1 FROM " + tableName); + rs = conn.createStatement().executeQuery("SELECT ts - 1 FROM date_table"); assertTrue(rs.next()); assertEquals("1995-05-01",rs.getDate(1).toString()); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnProjectionOptimizationIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnProjectionOptimizationIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnProjectionOptimizationIT.java index 3d808d2..4b7c119 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnProjectionOptimizationIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnProjectionOptimizationIT.java @@ -62,6 +62,7 @@ import org.junit.Test; public class ColumnProjectionOptimizationIT extends BaseClientManagedTimeIT { + private String tableName; @Test public void testSelect() throws Exception { long ts = nextTimestamp(); http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByIT.java index 5daf4de..7f64fee 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByIT.java @@ -35,21 +35,26 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import java.util.Collection; +import java.util.Map; import java.util.Properties; +import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.PropertiesUtil; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; +import com.google.common.collect.Maps; + @RunWith(Parameterized.class) public class GroupByIT extends BaseQueryIT { public GroupByIT(String indexDDL, boolean mutable, boolean columnEncoded) { - super(indexDDL, mutable, columnEncoded, true); + super(indexDDL, mutable, columnEncoded); } @Parameters(name="GroupByIT_{index}") // name is used by failsafe as file name in reports @@ -57,6 +62,14 @@ public class GroupByIT extends BaseQueryIT { return QueryIT.data(); } + @BeforeClass + @Shadower(classBeingShadowed = BaseQueryIT.class) + public static void doSetup() throws Exception { + Map<String,String> props = Maps.newHashMapWithExpectedSize(3); + props.put(QueryServices.DEFAULT_KEEP_DELETED_CELLS_ATTRIB, "true"); + BaseQueryIT.doSetup(props); + } + @Test public void testNoWhereScan() throws Exception { String query = "SELECT y_integer FROM " + tableName; @@ -443,19 +456,19 @@ public class GroupByIT extends BaseQueryIT { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10)); Connection conn = DriverManager.getConnection(getUrl(), props); - String ddl = "create table " + tableName + "(\"time\" integer not null, hostname varchar not null,usage float,period integer constraint pk PRIMARY KEY(\"time\", hostname))"; + String ddl = "create table test1(\"time\" integer not null, hostname varchar not null,usage float,period integer constraint pk PRIMARY KEY(\"time\", hostname))"; conn.createStatement().execute(ddl); conn.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 30)); conn = DriverManager.getConnection(getUrl(), props); - PreparedStatement stmt = conn.prepareStatement("upsert into " + tableName + " values(1439853462,'qa9',8.27,1439853462)"); + PreparedStatement stmt = conn.prepareStatement("upsert into test1 values(1439853462,'qa9',8.27,1439853462)"); stmt.execute(); - stmt = conn.prepareStatement("upsert into " + tableName + " values(1439853461,'qa9',8.27,1439853362)"); + stmt = conn.prepareStatement("upsert into test1 values(1439853461,'qa9',8.27,1439853362)"); stmt.execute(); - stmt = conn.prepareStatement("upsert into " + tableName + " values(1439853461,'qa9',5.27,1439853461)"); + stmt = conn.prepareStatement("upsert into test1 values(1439853461,'qa9',5.27,1439853461)"); stmt.execute(); - stmt = conn.prepareStatement("upsert into " + tableName + " values(1439853451,'qa9',4.27,1439853451)"); + stmt = conn.prepareStatement("upsert into test1 values(1439853451,'qa9',4.27,1439853451)"); stmt.execute(); conn.commit(); conn.close(); @@ -463,7 +476,7 @@ public class GroupByIT extends BaseQueryIT { props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 40)); conn = DriverManager.getConnection(getUrl(), props); ResultSet rs; - stmt = conn.prepareStatement("select \"time\"/10 as tm, hostname, avg(usage) from " + tableName + " group by hostname, tm"); + stmt = conn.prepareStatement("select \"time\"/10 as tm, hostname, avg(usage) from test1 group by hostname, tm"); rs = stmt.executeQuery(); assertTrue(rs.next()); assertEquals(143985345, rs.getInt(1)); @@ -479,19 +492,19 @@ public class GroupByIT extends BaseQueryIT { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10)); Connection conn = DriverManager.getConnection(getUrl(), props); - String ddl = "create table " + tableName + "(\"time\" integer not null, hostname varchar not null,usage float,period integer constraint pk PRIMARY KEY(\"time\", hostname))"; + String ddl = "create table test1(\"time\" integer not null, hostname varchar not null,usage float,period integer constraint pk PRIMARY KEY(\"time\", hostname))"; conn.createStatement().execute(ddl); conn.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 30)); conn = DriverManager.getConnection(getUrl(), props); - PreparedStatement stmt = conn.prepareStatement("upsert into " + tableName + " values(1439853462,'qa9',8.27,1439853462)"); + PreparedStatement stmt = conn.prepareStatement("upsert into test1 values(1439853462,'qa9',8.27,1439853462)"); stmt.execute(); - stmt = conn.prepareStatement("upsert into " + tableName + " values(1439853461,'qa9',8.27,1439853362)"); + stmt = conn.prepareStatement("upsert into test1 values(1439853461,'qa9',8.27,1439853362)"); stmt.execute(); - stmt = conn.prepareStatement("upsert into " + tableName + " values(1439853461,'qa9',5.27,1439853461)"); + stmt = conn.prepareStatement("upsert into test1 values(1439853461,'qa9',5.27,1439853461)"); stmt.execute(); - stmt = conn.prepareStatement("upsert into " + tableName + " values(1439853451,'qa9',4.27,1439853451)"); + stmt = conn.prepareStatement("upsert into test1 values(1439853451,'qa9',4.27,1439853451)"); stmt.execute(); conn.commit(); conn.close(); @@ -499,7 +512,7 @@ public class GroupByIT extends BaseQueryIT { props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 40)); conn = DriverManager.getConnection(getUrl(), props); ResultSet rs; - stmt = conn.prepareStatement("select period/10 as tm, hostname, avg(usage) from " + tableName + " group by hostname, tm"); + stmt = conn.prepareStatement("select period/10 as tm, hostname, avg(usage) from test1 group by hostname, tm"); rs = stmt.executeQuery(); assertTrue(rs.next()); assertEquals(143985345, rs.getInt(1)); http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutableQueryIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutableQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutableQueryIT.java index 50153bb..da36288 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutableQueryIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutableQueryIT.java @@ -39,14 +39,18 @@ import java.sql.ResultSet; import java.util.Arrays; import java.util.Collection; import java.util.List; +import java.util.Map; import java.util.Properties; +import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.PropertiesUtil; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runners.Parameterized.Parameters; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; public class MutableQueryIT extends BaseQueryIT { @@ -62,8 +66,16 @@ public class MutableQueryIT extends BaseQueryIT { return testCases; } + @BeforeClass + @Shadower(classBeingShadowed = BaseQueryIT.class) + public static void doSetup() throws Exception { + Map<String,String> props = Maps.newHashMapWithExpectedSize(3); + props.put(QueryServices.DEFAULT_KEEP_DELETED_CELLS_ATTRIB, Boolean.TRUE.toString()); + BaseQueryIT.doSetup(props); + } + public MutableQueryIT(String indexDDL, boolean mutable, boolean columnEncoded) { - super(indexDDL, mutable, columnEncoded, true); + super(indexDDL, mutable, columnEncoded); } @Test http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/NotQueryIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NotQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NotQueryIT.java index 70a15c7..036d278 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NotQueryIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NotQueryIT.java @@ -53,7 +53,7 @@ import com.google.common.primitives.Floats; public class NotQueryIT extends BaseQueryIT { public NotQueryIT(String indexDDL, boolean mutable, boolean columnEncoded) { - super(indexDDL, mutable, columnEncoded, false); + super(indexDDL, mutable, columnEncoded); } @Parameters(name="NotQueryIT_{index}") // name is used by failsafe as file name in reports http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java index d3d19ee..bb1eabe 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PointInTimeQueryIT.java @@ -25,33 +25,44 @@ import static org.junit.Assert.fail; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; +import java.util.Map; import java.util.Properties; +import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.schema.SequenceNotFoundException; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.PropertiesUtil; +import org.junit.BeforeClass; import org.junit.Test; +import com.google.common.collect.Maps; + public class PointInTimeQueryIT extends BaseQueryIT { public PointInTimeQueryIT(String indexDDL, boolean mutable, boolean columnEncoded) { - super(indexDDL, mutable, columnEncoded, true); + super(indexDDL, mutable, columnEncoded); } + @BeforeClass + @Shadower(classBeingShadowed = BaseQueryIT.class) + public static void doSetup() throws Exception { + Map<String,String> props = Maps.newHashMapWithExpectedSize(3); + props.put(QueryServices.DEFAULT_KEEP_DELETED_CELLS_ATTRIB, Boolean.TRUE.toString()); + BaseQueryIT.doSetup(props); + } + @Test public void testPointInTimeSequence() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); Connection conn; ResultSet rs; - - String seqName = generateUniqueName(); props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts+5)); conn = DriverManager.getConnection(getUrl(), props); - conn.createStatement().execute("CREATE SEQUENCE " + seqName + ""); + conn.createStatement().execute("CREATE SEQUENCE s"); try { - conn.createStatement().executeQuery("SELECT next value for " + seqName + " FROM " + tableName + " LIMIT 1"); + conn.createStatement().executeQuery("SELECT next value for s FROM " + tableName + " LIMIT 1"); fail(); } catch (SequenceNotFoundException e) { conn.close(); @@ -59,22 +70,22 @@ public class PointInTimeQueryIT extends BaseQueryIT { props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts+10)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT next value for " + seqName + " FROM " + tableName + " LIMIT 1"); + rs = conn.createStatement().executeQuery("SELECT next value for s FROM " + tableName + " LIMIT 1"); assertTrue(rs.next()); assertEquals(1, rs.getInt(1)); conn.close(); props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts+7)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT next value for " + seqName + " FROM " + tableName + " LIMIT 1"); + rs = conn.createStatement().executeQuery("SELECT next value for s FROM " + tableName + " LIMIT 1"); assertTrue(rs.next()); assertEquals(2, rs.getInt(1)); conn.close(); props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts+15)); conn = DriverManager.getConnection(getUrl(), props); - conn.createStatement().execute("DROP SEQUENCE " + seqName + ""); - rs = conn.createStatement().executeQuery("SELECT next value for " + seqName + " FROM " + tableName + " LIMIT 1"); + conn.createStatement().execute("DROP SEQUENCE s"); + rs = conn.createStatement().executeQuery("SELECT next value for s FROM " + tableName + " LIMIT 1"); assertTrue(rs.next()); assertEquals(3, rs.getInt(1)); conn.close(); @@ -82,24 +93,24 @@ public class PointInTimeQueryIT extends BaseQueryIT { props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts+20)); conn = DriverManager.getConnection(getUrl(), props); try { - rs = conn.createStatement().executeQuery("SELECT next value for " + seqName + " FROM " + tableName + " LIMIT 1"); + rs = conn.createStatement().executeQuery("SELECT next value for s FROM " + tableName + " LIMIT 1"); fail(); } catch (SequenceNotFoundException e) { conn.close(); } - conn.createStatement().execute("CREATE SEQUENCE " + seqName); + conn.createStatement().execute("CREATE SEQUENCE s"); conn.close(); props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts+25)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT next value for " + seqName + " FROM " + tableName + " LIMIT 1"); + rs = conn.createStatement().executeQuery("SELECT next value for s FROM " + tableName + " LIMIT 1"); assertTrue(rs.next()); assertEquals(1, rs.getInt(1)); conn.close(); props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts+6)); conn = DriverManager.getConnection(getUrl(), props); - rs = conn.createStatement().executeQuery("SELECT next value for " + seqName + " FROM " + tableName + " LIMIT 1"); + rs = conn.createStatement().executeQuery("SELECT next value for s FROM " + tableName + " LIMIT 1"); assertTrue(rs.next()); assertEquals(4, rs.getInt(1)); conn.close(); http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java index cfb2dcf..6b3778a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java @@ -49,10 +49,10 @@ import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.util.Map; import java.util.Properties; import org.apache.hadoop.hbase.HColumnDescriptor; -import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTableInterface; @@ -79,30 +79,24 @@ import org.apache.phoenix.schema.types.PInteger; import org.apache.phoenix.schema.types.PLong; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.PropertiesUtil; +import org.apache.phoenix.util.ReadOnlyProps; import org.apache.phoenix.util.SchemaUtil; import org.apache.phoenix.util.StringUtil; import org.apache.phoenix.util.TestUtil; +import org.junit.BeforeClass; import org.junit.Test; public class QueryDatabaseMetaDataIT extends BaseClientManagedTimeIT { - private static void createMDTestTable(Connection conn, String tableName, String extraProps) throws SQLException { - String ddl = "create table if not exists " + tableName + - " (id char(1) primary key,\n" + - " a.col1 integer,\n" + - " b.col2 bigint,\n" + - " b.col3 decimal,\n" + - " b.col4 decimal(5),\n" + - " b.col5 decimal(6,3))\n" + - " a." + HConstants.VERSIONS + "=" + 1 + "," + "a." + HColumnDescriptor.DATA_BLOCK_ENCODING + "='" + DataBlockEncoding.NONE + "'"; - if (extraProps != null && extraProps.length() > 0) { - ddl += "," + extraProps; - } - conn.createStatement().execute(ddl); - + @BeforeClass + @Shadower(classBeingShadowed = BaseClientManagedTimeIT.class) + public static void doSetup() throws Exception { + Map<String,String> props = getDefaultProps(); + props.put(QueryServices.DEFAULT_KEEP_DELETED_CELLS_ATTRIB, "true"); + setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); } - + @Test public void testTableMetadataScan() throws SQLException { long ts = nextTimestamp(); @@ -310,14 +304,10 @@ public class QueryDatabaseMetaDataIT extends BaseClientManagedTimeIT { @Test public void testColumnMetadataScan() throws SQLException { long ts = nextTimestamp(); + ensureTableCreated(getUrl(), MDTEST_NAME, MDTEST_NAME, ts); Properties props = new Properties(); - props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 2)); - Connection conn = DriverManager.getConnection(getUrl(), props); - createMDTestTable(conn, MDTEST_NAME, ""); - conn.close(); - props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); - conn = DriverManager.getConnection(getUrl(), props); + Connection conn = DriverManager.getConnection(getUrl(), props); DatabaseMetaData dbmd = conn.getMetaData(); ResultSet rs; rs = dbmd.getColumns(null, "", MDTEST_NAME, null); @@ -499,15 +489,11 @@ public class QueryDatabaseMetaDataIT extends BaseClientManagedTimeIT { @Test public void testPrimaryKeyMetadataScan() throws SQLException { long ts = nextTimestamp(); - Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); - Connection conn = DriverManager.getConnection(getUrl(), props); - createMDTestTable(conn, MDTEST_NAME, ""); - conn.close(); - + ensureTableCreated(getUrl(), MDTEST_NAME, MDTEST_NAME, ts); ensureTableCreated(getUrl(), CUSTOM_ENTITY_DATA_FULL_NAME, CUSTOM_ENTITY_DATA_FULL_NAME, ts); + Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); - conn = DriverManager.getConnection(getUrl(), props); + Connection conn = DriverManager.getConnection(getUrl(), props); DatabaseMetaData dbmd = conn.getMetaData(); ResultSet rs; rs = dbmd.getPrimaryKeys(null, "", MDTEST_NAME); @@ -610,9 +596,7 @@ public class QueryDatabaseMetaDataIT extends BaseClientManagedTimeIT { props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); Connection conn = DriverManager.getConnection(getUrl(), props); createGroupByTestTable(conn, GROUPBYTEST_NAME); - createMDTestTable(conn, MDTEST_NAME, ""); - conn.close(); - + ensureTableCreated(getUrl(), MDTEST_NAME, MDTEST_NAME, ts); ensureTableCreated(getUrl(), PTSDB_NAME, PTSDB_NAME, ts); ensureTableCreated(getUrl(), CUSTOM_ENTITY_DATA_FULL_NAME, CUSTOM_ENTITY_DATA_FULL_NAME, ts); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); @@ -671,7 +655,7 @@ public class QueryDatabaseMetaDataIT extends BaseClientManagedTimeIT { public void testCreateDropTable() throws Exception { long ts = nextTimestamp(); String tenantId = getOrganizationId(); - initATableValues(ATABLE_NAME, tenantId, getDefaultSplits(tenantId), null, ts, getUrl(), HColumnDescriptor.KEEP_DELETED_CELLS + "=" + Boolean.TRUE); + initATableValues(ATABLE_NAME, tenantId, getDefaultSplits(tenantId), null, ts, getUrl(), null); ensureTableCreated(getUrl(), BTABLE_NAME, BTABLE_NAME, ts-2); ensureTableCreated(getUrl(), PTSDB_NAME, PTSDB_NAME, ts-2); @@ -711,10 +695,7 @@ public class QueryDatabaseMetaDataIT extends BaseClientManagedTimeIT { @Test public void testCreateOnExistingTable() throws Exception { - long ts = nextTimestamp(); - Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); - PhoenixConnection pconn = DriverManager.getConnection(getUrl(), props).unwrap(PhoenixConnection.class); + PhoenixConnection pconn = DriverManager.getConnection(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES)).unwrap(PhoenixConnection.class); String tableName = MDTEST_NAME; String schemaName = MDTEST_SCHEMA_NAME; byte[] cfA = Bytes.toBytes(SchemaUtil.normalizeIdentifier("a")); @@ -738,13 +719,11 @@ public class QueryDatabaseMetaDataIT extends BaseClientManagedTimeIT { } admin.createTable(descriptor); - ts = nextTimestamp(); - props = new Properties(); - props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 2)); - props.setProperty(QueryServices.DEFAULT_KEEP_DELETED_CELLS_ATTRIB, Boolean.TRUE.toString()); - PhoenixConnection conn0 = DriverManager.getConnection(getUrl(), props).unwrap(PhoenixConnection.class); - createMDTestTable(conn0,tableName, "a." + HColumnDescriptor.KEEP_DELETED_CELLS + "=" + Boolean.TRUE); - conn0.close(); + long ts = nextTimestamp(); + Properties props = new Properties(); + props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); + PhoenixConnection conn1 = DriverManager.getConnection(getUrl(), props).unwrap(PhoenixConnection.class); + ensureTableCreated(getUrl(), tableName, tableName, ts); descriptor = admin.getTableDescriptor(htableName); assertEquals(3,descriptor.getColumnFamilies().length); @@ -766,9 +745,6 @@ public class QueryDatabaseMetaDataIT extends BaseClientManagedTimeIT { assertTrue(descriptor.hasCoprocessor(ServerCachingEndpointImpl.class.getName())); admin.close(); - props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); - props.setProperty(QueryServices.DEFAULT_KEEP_DELETED_CELLS_ATTRIB, Boolean.TRUE.toString()); - PhoenixConnection conn1 = DriverManager.getConnection(getUrl(), props).unwrap(PhoenixConnection.class); int rowCount = 5; String upsert = "UPSERT INTO " + tableName + "(id,col1,col2) VALUES(?,?,?)"; PreparedStatement ps = conn1.prepareStatement(upsert); @@ -1149,11 +1125,9 @@ public class QueryDatabaseMetaDataIT extends BaseClientManagedTimeIT { public void testDropAllKVCols() throws Exception { ResultSet rs; long ts = nextTimestamp(); - Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); - Connection conn = DriverManager.getConnection(getUrl(), props); - createMDTestTable(conn, MDTEST_NAME, ""); - conn.close(); + ensureTableCreated(getUrl(), MDTEST_NAME, MDTEST_NAME, null, ts, null); + + Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 2)); Connection conn2 = DriverManager.getConnection(getUrl(), props); @@ -1197,12 +1171,9 @@ public class QueryDatabaseMetaDataIT extends BaseClientManagedTimeIT { @Test public void testNewerTableDisallowed() throws Exception { long ts = nextTimestamp(); - Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); - Connection conn = DriverManager.getConnection(getUrl(), props); - conn.createStatement().execute("create table " + ATABLE_NAME + "(k varchar primary key, x_integer INTEGER, y_integer INTEGER)"); - conn.close(); + ensureTableCreated(getUrl(), ATABLE_NAME, ATABLE_NAME, null, ts, null); + Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); Connection conn5 = DriverManager.getConnection(getUrl(), props); conn5.createStatement().executeUpdate("ALTER TABLE " + ATABLE_NAME + " DROP COLUMN x_integer"); http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java index a06c961..1084f14 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java @@ -63,7 +63,7 @@ import org.junit.Test; public class QueryIT extends BaseQueryIT { public QueryIT(String indexDDL, boolean mutable, boolean columnEncoded) { - super(indexDDL, mutable, columnEncoded, false); + super(indexDDL, mutable, columnEncoded); } @Test http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/it/java/org/apache/phoenix/end2end/ScanQueryIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ScanQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ScanQueryIT.java index 4f9eb86..b0ce8cd 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ScanQueryIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ScanQueryIT.java @@ -63,7 +63,7 @@ public class ScanQueryIT extends BaseQueryIT { } public ScanQueryIT(String indexDDL, boolean mutable, boolean columnEncoded) { - super(indexDDL, mutable, columnEncoded, false); + super(indexDDL, mutable, columnEncoded); } @Test http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f18b38f/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java index bd1e0d2..e444700 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java @@ -44,6 +44,7 @@ import static org.apache.phoenix.util.TestUtil.E_VALUE; import static org.apache.phoenix.util.TestUtil.FUNKY_NAME; import static org.apache.phoenix.util.TestUtil.HBASE_DYNAMIC_COLUMNS; import static org.apache.phoenix.util.TestUtil.HBASE_NATIVE; +import static org.apache.phoenix.util.TestUtil.MDTEST_NAME; import static org.apache.phoenix.util.TestUtil.MULTI_CF_NAME; import static org.apache.phoenix.util.TestUtil.PARENTID1; import static org.apache.phoenix.util.TestUtil.PARENTID2; @@ -309,6 +310,14 @@ public abstract class BaseTest { " \"1\".\"value\" integer,\n" + " \"1\".\"_blah^\" varchar)" ); + builder.put(MDTEST_NAME,"create table " + MDTEST_NAME + + " (id char(1) primary key,\n" + + " a.col1 integer,\n" + + " b.col2 bigint,\n" + + " b.col3 decimal,\n" + + " b.col4 decimal(5),\n" + + " b.col5 decimal(6,3))\n" + + " a." + HConstants.VERSIONS + "=" + 1 + "," + "a." + HColumnDescriptor.DATA_BLOCK_ENCODING + "='" + DataBlockEncoding.NONE + "'"); builder.put(MULTI_CF_NAME,"create table " + MULTI_CF_NAME + " (id char(15) not null primary key,\n" + " a.unique_user_count integer,\n" +
