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 2018/03/11 17:01:31 UTC

[1/2] phoenix git commit: PHOENIX-4640 Don't consider STATS_UPDATE_FREQ_MS_ATTRIB in TTL for server side cache (addendum)

Repository: phoenix
Updated Branches:
  refs/heads/master 759b7c56d -> 35a90e4e6


PHOENIX-4640 Don't consider STATS_UPDATE_FREQ_MS_ATTRIB in TTL for server side cache (addendum)


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

Branch: refs/heads/master
Commit: 8e73fc7dae17c93201654c72a71154eb04951f29
Parents: 759b7c5
Author: James Taylor <jt...@salesforce.com>
Authored: Fri Mar 9 22:01:51 2018 -0800
Committer: James Taylor <jt...@salesforce.com>
Committed: Sun Mar 11 09:58:54 2018 -0700

----------------------------------------------------------------------
 .../it/java/org/apache/phoenix/end2end/ParallelStatsEnabledIT.java  | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8e73fc7d/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelStatsEnabledIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelStatsEnabledIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelStatsEnabledIT.java
index 3413d57..7028db3 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelStatsEnabledIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelStatsEnabledIT.java
@@ -42,6 +42,7 @@ public abstract class ParallelStatsEnabledIT extends BaseTest {
         Map<String, String> props = Maps.newHashMapWithExpectedSize(1);
         props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(20));
         props.put(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, Long.toString(5));
+        props.put(QueryServices.MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS_ATTRIB, Long.toString(5));
         props.put(QueryServices.USE_STATS_FOR_PARALLELIZATION, Boolean.toString(true));
         setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
     }


[2/2] phoenix git commit: PHOENIX-4139 Incorrect query result for trailing duplicate GROUP BY expression (Csaba Skrabak)

Posted by ja...@apache.org.
PHOENIX-4139 Incorrect query result for trailing duplicate GROUP BY expression (Csaba Skrabak)


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

Branch: refs/heads/master
Commit: 35a90e4e6ea46105983d60d845324abaf5028d99
Parents: 8e73fc7
Author: James Taylor <jt...@salesforce.com>
Authored: Sun Mar 11 09:56:20 2018 -0700
Committer: James Taylor <jt...@salesforce.com>
Committed: Sun Mar 11 09:59:12 2018 -0700

----------------------------------------------------------------------
 .../org/apache/phoenix/end2end/AggregateIT.java | 23 ++++++++++++++++++++
 .../phoenix/schema/RowKeyValueAccessor.java     |  2 +-
 2 files changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/35a90e4e/phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateIT.java
index 09e51c5..b6c5a06 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AggregateIT.java
@@ -74,6 +74,29 @@ public class AggregateIT extends ParallelStatsDisabledIT {
     }
 
     @Test
+    public void testDuplicateTrailingAggExpr() throws Exception {
+        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+        Connection conn = DriverManager.getConnection(getUrl(), props);
+        String tableName = generateUniqueName();
+        conn.createStatement().execute("create table " + tableName +
+                "   (nam VARCHAR(20), address VARCHAR(20), id BIGINT "
+                + "constraint my_pk primary key (id))");
+        PreparedStatement statement = conn.prepareStatement("UPSERT INTO " + tableName + "(nam, address, id) values (?,?,?)");
+        statement.setString(1, "pulkit");
+        statement.setString(2, "badaun");
+        statement.setInt(3, 1);
+        statement.executeUpdate();
+        conn.commit();
+        Statement stmt = conn.createStatement();
+        ResultSet rs = stmt.executeQuery("select distinct 'harshit' as \"test_column\", trim(nam), trim(nam) from " + tableName);
+        assertTrue(rs.next());
+        assertEquals("harshit", rs.getString(1));
+        assertEquals("pulkit", rs.getString(2));
+        assertEquals("pulkit", rs.getString(3));
+        conn.close();
+    }
+
+    @Test
     public void testExpressionInGroupBy() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/35a90e4e/phoenix-core/src/main/java/org/apache/phoenix/schema/RowKeyValueAccessor.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/RowKeyValueAccessor.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/RowKeyValueAccessor.java
index cd82748..1c56d13 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/RowKeyValueAccessor.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/RowKeyValueAccessor.java
@@ -88,7 +88,7 @@ public class RowKeyValueAccessor implements Writable   {
         }
         // Remember this so that we don't bother looking for the null separator byte in this case
         this.isFixedLength = datum.getDataType().isFixedWidth();
-        this.hasSeparator = !isFixedLength && (datum != data.get(data.size()-1));
+        this.hasSeparator = !isFixedLength && iterator.hasNext();
     }
     
     RowKeyValueAccessor(int[] offsets, boolean isFixedLength, boolean hasSeparator) {