You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2015/10/18 02:42:30 UTC

[1/3] phoenix git commit: PHOENIX-2329 Fix Pherf Eclipse compiler errors

Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 61b30c924 -> 177b1b70d


PHOENIX-2329 Fix Pherf Eclipse compiler errors


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 5daa859bba713d52266d949c0f8e3cf4f257501b
Parents: 61b30c9
Author: James Taylor <ja...@apache.org>
Authored: Fri Oct 16 14:35:49 2015 -0700
Committer: James Taylor <jt...@salesforce.com>
Committed: Sat Oct 17 17:40:04 2015 -0700

----------------------------------------------------------------------
 .../flume/serializer/CustomSerializer.java      |  1 -
 .../java/org/apache/phoenix/pherf/Pherf.java    | 21 +++++++++++---------
 2 files changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5daa859b/phoenix-flume/src/it/java/org/apache/phoenix/flume/serializer/CustomSerializer.java
----------------------------------------------------------------------
diff --git a/phoenix-flume/src/it/java/org/apache/phoenix/flume/serializer/CustomSerializer.java b/phoenix-flume/src/it/java/org/apache/phoenix/flume/serializer/CustomSerializer.java
index e36528a..5db5fa6 100644
--- a/phoenix-flume/src/it/java/org/apache/phoenix/flume/serializer/CustomSerializer.java
+++ b/phoenix-flume/src/it/java/org/apache/phoenix/flume/serializer/CustomSerializer.java
@@ -24,7 +24,6 @@ import org.apache.flume.Context;
 import org.apache.flume.Event;
 
 public class CustomSerializer extends BaseEventSerializer {
-    
     @Override
     public void doConfigure(Context context) {
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5daa859b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/Pherf.java
----------------------------------------------------------------------
diff --git a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/Pherf.java b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/Pherf.java
index f6ed19d..cf5b6aa 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/Pherf.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/Pherf.java
@@ -18,7 +18,18 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.commons.cli.*;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.PosixParser;
 import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import org.apache.phoenix.pherf.configuration.XMLConfigParser;
 import org.apache.phoenix.pherf.jmx.MonitorManager;
@@ -34,12 +45,6 @@ import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Properties;
-
 public class Pherf {
     private static final Logger logger = LoggerFactory.getLogger(Pherf.class);
     private static final Options options = new Options();
@@ -92,7 +97,6 @@ public class Pherf {
     private final boolean preLoadData;
     private final String dropPherfTablesRegEx;
     private final boolean executeQuerySets;
-    private final boolean exportCSV;
     private final boolean isFunctional;
     private final boolean monitor;
     private final int rowCountOverride;
@@ -131,7 +135,6 @@ public class Pherf {
         executeQuerySets = command.hasOption("q");
         zookeeper = command.getOptionValue("z", "localhost");
         queryHint = command.getOptionValue("hint", null);
-        exportCSV = command.hasOption("export");
         isFunctional = command.hasOption("diff");
         listFiles = command.hasOption("listFiles");
         applySchema = !command.hasOption("disableSchemaApply");


[2/3] phoenix git commit: PHOENIX-2327 Row value constructors failed on the index, when len(table's pks) > 2 and table's 1st pk is index's last pk (Chunhui Liu, James Taylor)

Posted by ja...@apache.org.
PHOENIX-2327 Row value constructors failed on the index, when len(table's pks) > 2 and table's 1st pk is index's last pk (Chunhui Liu, James Taylor)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: e501e3067fb29a6cee0fe9e4ef9ee8a64405e603
Parents: 5daa859
Author: James Taylor <jt...@salesforce.com>
Authored: Sat Oct 17 15:25:00 2015 -0700
Committer: James Taylor <jt...@salesforce.com>
Committed: Sat Oct 17 17:40:29 2015 -0700

----------------------------------------------------------------------
 .../phoenix/end2end/RowValueConstructorIT.java  | 61 ++++++++++++++++++++
 .../apache/phoenix/compile/WhereOptimizer.java  |  7 +--
 2 files changed, 64 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e501e306/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
index 749da5d..fef105c 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
@@ -1591,4 +1591,65 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT {
         
         assertFalse(rs.next());
     }
+
+	/**
+	 * PHOENIX-2327
+	 * 
+	 * Table's pks are (pk1, pk2, ... , pkn), n >= 3
+	 * Index's pks are (pk2, ... , pkn, pk1), n >= 3
+	 * RVC is (pk2, ... , pkn, pk1), n >= 3
+	 * 
+	 * Expalin select * from t where (pk2, ... , pkn, pk1) > ('201', ..., 'n01', '101') and pk[2-n] = '[2-n]03'
+	 * 
+	 * You will Get "DEGENERATE SCAN OVER TABLE_NAME"
+	 * 
+	 * @throws java.lang.Exception
+	 */
+	@Test
+	public void testRVCLastPkIsTable1stPkIndex() throws Exception {
+		Connection conn = nextConnection(getUrl());
+		String tableName = "t";
+		String ddl = "CREATE TABLE " + tableName 
+				+ " (k1 VARCHAR, k2 VARCHAR, k3 VARCHAR, k4 VARCHAR,"
+				+ " CONSTRAINT pk PRIMARY KEY (k1,k2,k3,k4))";
+		conn.createStatement().execute(ddl);
+
+		conn = nextConnection(getUrl());
+		ddl = "CREATE INDEX  " + tableName + "_idx"
+				+ " ON " + tableName + " (k2, k3, k4, k1)";
+		conn.createStatement().execute(ddl);
+		
+		conn = nextConnection(getUrl());
+		String upsert = "UPSERT INTO " + tableName + " VALUES(?, ?, ?, ?)";
+		PreparedStatement stmt = conn.prepareStatement(upsert);
+		for (int i = 0; i < 5; i++) {
+			stmt.setString(1, "10" + i);
+			stmt.setString(2, "20" + i);
+			stmt.setString(3, "30" + i);
+			stmt.setString(4, "40" + i);
+			stmt.execute();
+		}
+		conn.commit();
+
+		conn = nextConnection(getUrl());
+		String query = "SELECT k1, k2, k3, k4 FROM " + tableName + " WHERE k2 = '203'";
+		ResultSet rs = conn.createStatement().executeQuery(query);
+		assertTrue(rs.next());
+		assertEquals("103", rs.getString(1));
+		assertEquals("203", rs.getString(2));
+		assertEquals("303", rs.getString(3));
+		assertEquals("403", rs.getString(4));
+
+		conn = nextConnection(getUrl());
+		query = "SELECT k1, k2, k3, k4 FROM " + tableName 
+				+ " WHERE (k2, k3, k4, k1) > ('201', '301', '401', '101')"
+				+ " AND k2 = '203'";
+		rs = conn.createStatement().executeQuery(query);
+		assertTrue(rs.next());
+		assertEquals("103", rs.getString(1));
+		assertEquals("203", rs.getString(2));
+		assertEquals("303", rs.getString(3));
+		assertEquals("403", rs.getString(4));
+	}
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e501e306/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
index 0a71bfb..99986a2 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
@@ -541,10 +541,6 @@ public class WhereOptimizer {
                 int span = position - initialPosition;
                 return new SingleKeySlot(new RowValueConstructorKeyPart(table.getPKColumns().get(initialPosition), rvc, span, childSlots), initialPosition, span, EVERYTHING_RANGES);
             }
-            // If we don't clear the child list, we end up passing some of
-            // the child expressions of previous matches up the tree, causing
-            // those expressions to form the scan start/stop key. PHOENIX-1753
-            childSlots.clear();
             return null;
         }
 
@@ -1118,6 +1114,9 @@ public class WhereOptimizer {
                         // If they don't intersect, we cannot have a match for the RVC, so filter it out.
                         // Otherwise, we keep it.
                         for (KeyRange keyRange : this.getKeyRanges()) {
+                            if (keyRange == KeyRange.EVERYTHING_RANGE) {
+                                return this;
+                            }
                             assert(keyRange.isSingleKey());
                             byte[] key = keyRange.getLowerRange();
                             int position = this.getPKPosition();


[3/3] phoenix git commit: PHOENIX-2333 Disable flapping MutableIndexFailureIT tests

Posted by ja...@apache.org.
PHOENIX-2333 Disable flapping MutableIndexFailureIT tests


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 177b1b70d6560a0d1b48b5c2a37a5ed31248b6cb
Parents: e501e30
Author: James Taylor <jt...@salesforce.com>
Authored: Sat Oct 17 17:00:27 2015 -0700
Committer: James Taylor <jt...@salesforce.com>
Committed: Sat Oct 17 17:40:45 2015 -0700

----------------------------------------------------------------------
 .../org/apache/phoenix/end2end/index/MutableIndexFailureIT.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/177b1b70/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
index d11c059..ee1fbc9 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
@@ -71,6 +71,7 @@ import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.StringUtil;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 /**
@@ -131,11 +132,13 @@ public class MutableIndexFailureIT extends BaseTest {
         }
     }
 
+    @Ignore("See PHOENIX-2331")
     @Test(timeout=300000)
     public void testWriteFailureDisablesLocalIndex() throws Exception {
         testWriteFailureDisablesIndex(true);
     }
  
+    @Ignore("See PHOENIX-2332")
     @Test(timeout=300000)
     public void testWriteFailureDisablesIndex() throws Exception {
         testWriteFailureDisablesIndex(false);