phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject phoenix git commit: PHOENIX-1861 Padding character should be inverted if sort order is descending (Dumindu Buddhika)
Date Tue, 14 Apr 2015 19:26:22 GMT
Repository: phoenix
Updated Branches:
  refs/heads/master 3f6b25947 -> b0c28a2de


PHOENIX-1861 Padding character should be inverted if sort order is descending (Dumindu Buddhika)


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

Branch: refs/heads/master
Commit: b0c28a2de9b8b2807abaeddf1ec5430cc9f13c61
Parents: 3f6b259
Author: James Taylor <jtaylor@salesforce.com>
Authored: Tue Apr 14 12:26:09 2015 -0700
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Tue Apr 14 12:26:09 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/compile/WhereOptimizer.java   | 2 +-
 .../src/main/java/org/apache/phoenix/schema/PTableImpl.java        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b0c28a2d/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 e25cfbc..a5aef02 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
@@ -1210,7 +1210,7 @@ public class WhereOptimizer {
                     Integer length = getColumn().getMaxLength();
                     if (length != null) {
                         // Go through type to pad as the fill character depends on the type.
-                        type.pad(ptr, length, SortOrder.getDefault());
+                        type.pad(ptr, length, getColumn().getSortOrder());
                     }
                 }
                 byte[] key = ByteUtil.copyKeyBytesIfNecessary(ptr);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b0c28a2d/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
index 702edbd..088595b 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
@@ -703,7 +703,7 @@ public class PTableImpl implements PTable {
                 Integer	maxLength = column.getMaxLength();
             	if (!isNull && type.isFixedWidth() && maxLength != null) {
     				if (ptr.getLength() <= maxLength) {
-                        type.pad(ptr, maxLength, SortOrder.getDefault());
+                        type.pad(ptr, maxLength, column.getSortOrder());
                     } else if (ptr.getLength() > maxLength) {
                         throw new DataExceedsCapacityException(name.getString() + "." + column.getName().getString()
+ " may not exceed " + maxLength + " bytes (" + type.toObject(byteValue) + ")");
                     }


Mime
View raw message