TAJO-665: sort buffer size must be dealt as long type values. (hyoungjunkim via hyunsik)
diff --git a/CHANGES.txt b/CHANGES.txt
index 52f4543..26afdc4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -269,6 +269,9 @@
 
   BUG FIXES
 
+    TAJO-665: sort buffer size must be dealt as long type values. 
+    (hyoungjunkim via hyunsik)
+
     TAJO-427: Empty table makes IndexOutOfBoundsException at LEFT OUTER JOIN clause. (jaehwa)
 
     TAJO-650: Repartitioner::scheduleHashShuffledFetches should adjust the
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/physical/ExternalSortExec.java b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/physical/ExternalSortExec.java
index 4ceb3fc..b871133 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/physical/ExternalSortExec.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/physical/ExternalSortExec.java
@@ -69,7 +69,7 @@
   /** the defaultFanout of external sort */
   private final int defaultFanout;
   /** It's the size of in-memory table. If memory consumption exceeds it, store the memory table into a disk. */
-  private int sortBufferBytesNum;
+  private long sortBufferBytesNum;
   /** the number of available cores */
   private final int allocatedCoreNum;
   /** If there are available multiple cores, it tries parallel merge. */
@@ -193,7 +193,7 @@
    */
   private List<Path> sortAndStoreAllChunks() throws IOException {
     Tuple tuple;
-    int memoryConsumption = 0;
+    long memoryConsumption = 0;
     List<Path> chunkPaths = TUtil.newList();
 
     int chunkId = 0;