tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject git commit: TAJO-1093: DateTimeFormat.to_char() is slower than SimpleDateFormat.format(). (bug fix)
Date Wed, 08 Oct 2014 16:58:18 GMT
Repository: tajo
Updated Branches:
  refs/heads/master 0adc754d9 -> bbd7a768a


TAJO-1093: DateTimeFormat.to_char() is slower than SimpleDateFormat.format(). (bug fix)

Closes #194


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

Branch: refs/heads/master
Commit: bbd7a768a161be0e529ef41dea325fae196a4c1d
Parents: 0adc754
Author: Hyunsik Choi <hyunsik@apache.org>
Authored: Wed Oct 8 09:53:51 2014 -0700
Committer: Hyunsik Choi <hyunsik@apache.org>
Committed: Wed Oct 8 09:53:51 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/tajo/util/datetime/DateTimeFormat.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/bbd7a768/tajo-common/src/main/java/org/apache/tajo/util/datetime/DateTimeFormat.java
----------------------------------------------------------------------
diff --git a/tajo-common/src/main/java/org/apache/tajo/util/datetime/DateTimeFormat.java b/tajo-common/src/main/java/org/apache/tajo/util/datetime/DateTimeFormat.java
index 9e25758..c0b9245 100644
--- a/tajo-common/src/main/java/org/apache/tajo/util/datetime/DateTimeFormat.java
+++ b/tajo-common/src/main/java/org/apache/tajo/util/datetime/DateTimeFormat.java
@@ -1686,7 +1686,7 @@ public class DateTimeFormat {
     tempArray = Integer.toString(tempValue).toCharArray();
     targetArraySize = Math.max(tempArray.length, size + (isPositive?0:1));
     targetArray = new char[targetArraySize];
-    if (size > 0) {
+    if (size > tempArray.length) {
       System.arraycopy(zeroStrings[size], 0, targetArray, (targetArraySize-size), size);
     }
     System.arraycopy(tempArray, 0, targetArray, (targetArraySize-tempArray.length), tempArray.length);
@@ -1718,6 +1718,7 @@ public class DateTimeFormat {
       Arrays.fill(targetArray, ' ');
       System.arraycopy(tempArray, 0, targetArray, 
           isLeftJustified?0:(targetArraySize-tempArray.length), tempArray.length);
+      result = new String(targetArray);
     }
     
     return result;


Mime
View raw message