tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject [1/2] tajo git commit: TAJO-1304: Can not found TextFile in catalog. (jinho)
Date Thu, 15 Jan 2015 05:34:16 GMT
Repository: tajo
Updated Branches:
  refs/heads/index_support a69f7b0bb -> 5866c36de


TAJO-1304: Can not found TextFile in catalog. (jinho)

Closes #349


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

Branch: refs/heads/index_support
Commit: 1bf71f6f5b2b4dae01ed72c33e2c910804d4071f
Parents: 9553edc
Author: jhkim <jhkim@apache.org>
Authored: Thu Jan 15 11:16:25 2015 +0900
Committer: jhkim <jhkim@apache.org>
Committed: Thu Jan 15 11:16:25 2015 +0900

----------------------------------------------------------------------
 CHANGES                                            |  2 ++
 .../java/org/apache/tajo/catalog/CatalogUtil.java  | 12 +-----------
 .../apache/tajo/catalog/store/AbstractDBStore.java |  6 ++++--
 .../org/apache/tajo/catalog/store/MemStore.java    |  2 +-
 .../tajo/cli/tsql/commands/DescTableCommand.java   |  3 ++-
 .../apache/tajo/engine/query/TestCTASQuery.java    | 17 +++++++++++++++--
 .../queries/TestCTASQuery/CtasWithTextFile.sql     | 12 ++++++++++++
 .../queries/TestCTASQuery/testCtasWithTextFile.sql |  1 +
 .../TestCTASQuery/testCtasWithTextFile.result      |  5 +++++
 .../org/apache/tajo/storage/StorageManager.java    | 16 ++++++----------
 .../src/main/resources/storage-default.xml         | 10 +++++-----
 .../apache/tajo/storage/hbase/HBaseFragment.java   |  3 ++-
 .../main/java/org/apache/tajo/storage/CSVFile.java |  2 +-
 .../apache/tajo/storage/fragment/FileFragment.java |  3 ++-
 .../tajo/storage/text/DelimitedTextFile.java       |  2 +-
 .../src/test/resources/storage-default.xml         | 10 +++++-----
 16 files changed, 65 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 52ae50c..e33ca6f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -164,6 +164,8 @@ Release 0.9.1 - unreleased
 
   BUG FIXES
 
+    TAJO-1304: Can not found TextFile in catalog. (jinho)
+
     TAJO-1299: TB and PB representations in StorageUnit are overflow.
     (jihun)
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
index bb15ec1..45609d0 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
@@ -265,18 +265,8 @@ public class CatalogUtil {
   public static String getStoreTypeString(final StoreType type) {
     if (type == StoreType.TEXTFILE) {
       return TEXTFILE_NAME;
-    } else if (type == StoreType.CSV ||
-               type == StoreType.RAW ||
-               type == StoreType.ROWFILE ||
-               type == StoreType.RCFILE ||
-               type == StoreType.PARQUET ||
-               type == StoreType.SEQUENCEFILE ||
-               type == StoreType.AVRO ||
-               type == StoreType.JSON ||
-               type == StoreType.HBASE) {
-      return type.name();
     } else {
-      return null;
+      return type.name();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
b/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
index bcd846e..04694b0 100644
--- a/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
+++ b/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
@@ -765,7 +765,7 @@ public abstract class AbstractDBStore extends CatalogConstants implements
Catalo
         pstmt.setString(2, tableName);
         pstmt.setString(3, TableType.EXTERNAL_TABLE.name());
         pstmt.setString(4, table.getPath());
-        pstmt.setString(5, table.getMeta().getStoreType().name());
+        pstmt.setString(5, CatalogUtil.getStoreTypeString(table.getMeta().getStoreType()));
         pstmt.executeUpdate();
         pstmt.close();
       } else {
@@ -779,7 +779,7 @@ public abstract class AbstractDBStore extends CatalogConstants implements
Catalo
         pstmt.setInt(1, dbid);
         pstmt.setString(2, tableName);
         pstmt.setString(3, TableType.BASE_TABLE.name());
-        pstmt.setString(4, table.getMeta().getStoreType().name());
+        pstmt.setString(4, CatalogUtil.getStoreTypeString(table.getMeta().getStoreType()));
         pstmt.executeUpdate();
         pstmt.close();
       }
@@ -1375,6 +1375,7 @@ public abstract class AbstractDBStore extends CatalogConstants implements
Catalo
       } else {
         tableBuilder.setPath(res.getString(4).trim());
       }
+
       storeType = CatalogUtil.getStoreType(res.getString(5).trim());
 
       res.close();
@@ -1409,6 +1410,7 @@ public abstract class AbstractDBStore extends CatalogConstants implements
Catalo
       // Geting Table Properties
       //////////////////////////////////////////
       CatalogProtos.TableProto.Builder metaBuilder = CatalogProtos.TableProto.newBuilder();
+
       metaBuilder.setStoreType(storeType);
       sql = "SELECT key_, value_ FROM " + TB_OPTIONS + " WHERE " + COL_TABLES_PK + " = ?";
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/MemStore.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/MemStore.java
b/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/MemStore.java
index 51f65ee..9e77f5c 100644
--- a/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/MemStore.java
+++ b/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/MemStore.java
@@ -368,7 +368,7 @@ public class MemStore implements CatalogStore {
         builder.setName(tableName);
         builder.setPath(tableDesc.getPath());
         builder.setTableType(tableDesc.getIsExternal()?"EXTERNAL":"BASE");
-        builder.setStoreType(tableDesc.getMeta().getStoreType().toString());
+        builder.setStoreType(CatalogUtil.getStoreTypeString(tableDesc.getMeta().getStoreType()));
         
         tableList.add(builder.build());
         tableId++;

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-client/src/main/java/org/apache/tajo/cli/tsql/commands/DescTableCommand.java
----------------------------------------------------------------------
diff --git a/tajo-client/src/main/java/org/apache/tajo/cli/tsql/commands/DescTableCommand.java
b/tajo-client/src/main/java/org/apache/tajo/cli/tsql/commands/DescTableCommand.java
index 5eebc2b..b7d9334 100644
--- a/tajo-client/src/main/java/org/apache/tajo/cli/tsql/commands/DescTableCommand.java
+++ b/tajo-client/src/main/java/org/apache/tajo/cli/tsql/commands/DescTableCommand.java
@@ -21,6 +21,7 @@ package org.apache.tajo.cli.tsql.commands;
 import org.apache.commons.lang.CharUtils;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.tajo.TajoConstants;
+import org.apache.tajo.catalog.CatalogUtil;
 import org.apache.tajo.catalog.Column;
 import org.apache.tajo.catalog.TableDesc;
 import org.apache.tajo.catalog.partition.PartitionMethodDesc;
@@ -79,7 +80,7 @@ public class DescTableCommand extends TajoShellCommand {
     StringBuilder sb = new StringBuilder();
     sb.append("\ntable name: ").append(desc.getName()).append("\n");
     sb.append("table path: ").append(desc.getPath()).append("\n");
-    sb.append("store type: ").append(desc.getMeta().getStoreType()).append("\n");
+    sb.append("store type: ").append(CatalogUtil.getStoreTypeString(desc.getMeta().getStoreType())).append("\n");
     if (desc.getStats() != null) {
 
       long row = desc.getStats().getNumRows();

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-core/src/test/java/org/apache/tajo/engine/query/TestCTASQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestCTASQuery.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestCTASQuery.java
index 0e89803..e93d214 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestCTASQuery.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestCTASQuery.java
@@ -28,12 +28,11 @@ import org.apache.tajo.TajoConstants;
 import org.apache.tajo.TajoTestingCluster;
 import org.apache.tajo.catalog.CatalogService;
 import org.apache.tajo.catalog.CatalogUtil;
-import org.apache.tajo.util.CommonTestingUtil;
-import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.catalog.TableDesc;
 import org.apache.tajo.catalog.partition.PartitionMethodDesc;
 import org.apache.tajo.catalog.proto.CatalogProtos;
 import org.apache.tajo.storage.StorageConstants;
+import org.apache.tajo.util.KeyValueSet;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -197,6 +196,20 @@ public class TestCTASQuery extends QueryTestCaseBase {
   }
 
   @Test
+  public final void testCtasWithTextFile() throws Exception {
+    ResultSet res = executeFile("CtasWithTextFile.sql");
+    res.close();
+
+    ResultSet res2 = executeQuery();
+    resultSetToString(res2);
+    res2.close();
+
+    TableDesc desc =  client.getTableDesc(CatalogUtil.normalizeIdentifier(res2.getMetaData().getTableName(1)));
+    assertNotNull(desc);
+    assertEquals(CatalogProtos.StoreType.TEXTFILE, desc.getMeta().getStoreType());
+  }
+
+  @Test
   public final void testCtasWithOptions() throws Exception {
     ResultSet res = executeFile("CtasWithOptions.sql");
     res.close();

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-core/src/test/resources/queries/TestCTASQuery/CtasWithTextFile.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestCTASQuery/CtasWithTextFile.sql b/tajo-core/src/test/resources/queries/TestCTASQuery/CtasWithTextFile.sql
new file mode 100644
index 0000000..5581d16
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestCTASQuery/CtasWithTextFile.sql
@@ -0,0 +1,12 @@
+create table testCtasWithTextFile (col1 float, col2 float) using text as
+select
+  sum(l_orderkey) as total1,
+  avg(l_partkey) as total2
+from
+  lineitem
+group by
+  l_quantity
+order by
+  l_quantity
+limit
+  3;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-core/src/test/resources/queries/TestCTASQuery/testCtasWithTextFile.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestCTASQuery/testCtasWithTextFile.sql b/tajo-core/src/test/resources/queries/TestCTASQuery/testCtasWithTextFile.sql
new file mode 100644
index 0000000..f81442b
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestCTASQuery/testCtasWithTextFile.sql
@@ -0,0 +1 @@
+select * from testCtasWithTextFile;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-core/src/test/resources/results/TestCTASQuery/testCtasWithTextFile.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestCTASQuery/testCtasWithTextFile.result
b/tajo-core/src/test/resources/results/TestCTASQuery/testCtasWithTextFile.result
new file mode 100644
index 0000000..ea78854
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestCTASQuery/testCtasWithTextFile.result
@@ -0,0 +1,5 @@
+col1,col2,key
+-------------------------------
+1.0,1.0,17.0
+1.0,1.0,36.0
+2.0,2.0,38.0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/StorageManager.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/StorageManager.java
b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/StorageManager.java
index c9f493d..3b56249 100644
--- a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/StorageManager.java
+++ b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/StorageManager.java
@@ -25,10 +25,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.*;
 import org.apache.tajo.*;
-import org.apache.tajo.catalog.Schema;
-import org.apache.tajo.catalog.SortSpec;
-import org.apache.tajo.catalog.TableDesc;
-import org.apache.tajo.catalog.TableMeta;
+import org.apache.tajo.catalog.*;
 import org.apache.tajo.catalog.proto.CatalogProtos;
 import org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto;
 import org.apache.tajo.catalog.proto.CatalogProtos.StoreType;
@@ -336,7 +333,7 @@ public abstract class StorageManager {
   public static synchronized StorageManager getStorageManager (
       TajoConf tajoConf, StoreType storeType, String managerKey) throws IOException {
     synchronized (storageManagers) {
-      String storeKey = storeType + managerKey;
+      String storeKey = CatalogUtil.getStoreTypeString(storeType) + managerKey;
       StorageManager manager = storageManagers.get(storeKey);
       if (manager == null) {
         String typeName = "hdfs";
@@ -465,12 +462,11 @@ public abstract class StorageManager {
 
     Class<? extends Appender> appenderClass;
 
-    String handlerName = meta.getStoreType().name().toLowerCase();
+    String handlerName = CatalogUtil.getStoreTypeString(meta.getStoreType()).toLowerCase();
     appenderClass = APPENDER_HANDLER_CACHE.get(handlerName);
     if (appenderClass == null) {
       appenderClass = conf.getClass(
-          String.format("tajo.storage.appender-handler.%s.class",
-              meta.getStoreType().name().toLowerCase()), null, Appender.class);
+          String.format("tajo.storage.appender-handler.%s.class", handlerName), null, Appender.class);
       APPENDER_HANDLER_CACHE.put(handlerName, appenderClass);
     }
 
@@ -550,11 +546,11 @@ public abstract class StorageManager {
    * @throws java.io.IOException
    */
   public Class<? extends Scanner> getScannerClass(CatalogProtos.StoreType storeType)
throws IOException {
-    String handlerName = storeType.name().toLowerCase();
+    String handlerName = CatalogUtil.getStoreTypeString(storeType).toLowerCase();
     Class<? extends Scanner> scannerClass = SCANNER_HANDLER_CACHE.get(handlerName);
     if (scannerClass == null) {
       scannerClass = conf.getClass(
-          String.format("tajo.storage.scanner-handler.%s.class",storeType.name().toLowerCase()),
null, Scanner.class);
+          String.format("tajo.storage.scanner-handler.%s.class", handlerName), null, Scanner.class);
       SCANNER_HANDLER_CACHE.put(handlerName, scannerClass);
     }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-storage/tajo-storage-common/src/main/resources/storage-default.xml
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-common/src/main/resources/storage-default.xml b/tajo-storage/tajo-storage-common/src/main/resources/storage-default.xml
index abea9de..aa078a7 100644
--- a/tajo-storage/tajo-storage-common/src/main/resources/storage-default.xml
+++ b/tajo-storage/tajo-storage-common/src/main/resources/storage-default.xml
@@ -39,12 +39,12 @@
   <!--- Registered Scanner Handler -->
   <property>
     <name>tajo.storage.scanner-handler</name>
-    <value>textfile,csv,json,raw,rcfile,row,parquet,sequencefile,avro,hbase</value>
+    <value>text,csv,json,raw,rcfile,row,parquet,sequencefile,avro,hbase</value>
   </property>
 
   <!--- Fragment Class Configurations -->
   <property>
-    <name>tajo.storage.fragment.textfile.class</name>
+    <name>tajo.storage.fragment.text.class</name>
     <value>org.apache.tajo.storage.fragment.FileFragment</value>
   </property>
   <property>
@@ -86,7 +86,7 @@
 
   <!--- Scanner Handler -->
   <property>
-    <name>tajo.storage.scanner-handler.textfile.class</name>
+    <name>tajo.storage.scanner-handler.text.class</name>
     <value>org.apache.tajo.storage.text.DelimitedTextFile$DelimitedTextFileScanner</value>
   </property>
 
@@ -138,11 +138,11 @@
   <!--- Appender Handler -->
   <property>
     <name>tajo.storage.appender-handler</name>
-    <value>textfile,csv,raw,rcfile,row,parquet,sequencefile,avro,hbase</value>
+    <value>text,csv,raw,rcfile,row,parquet,sequencefile,avro,hbase</value>
   </property>
 
   <property>
-    <name>tajo.storage.appender-handler.textfile.class</name>
+    <name>tajo.storage.appender-handler.text.class</name>
     <value>org.apache.tajo.storage.text.DelimitedTextFile$DelimitedTextFileAppender</value>
   </property>
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-storage/tajo-storage-hbase/src/main/java/org/apache/tajo/storage/hbase/HBaseFragment.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-hbase/src/main/java/org/apache/tajo/storage/hbase/HBaseFragment.java
b/tajo-storage/tajo-storage-hbase/src/main/java/org/apache/tajo/storage/hbase/HBaseFragment.java
index 2674511..9ea0bf6 100644
--- a/tajo-storage/tajo-storage-hbase/src/main/java/org/apache/tajo/storage/hbase/HBaseFragment.java
+++ b/tajo-storage/tajo-storage-hbase/src/main/java/org/apache/tajo/storage/hbase/HBaseFragment.java
@@ -23,6 +23,7 @@ import com.google.gson.annotations.Expose;
 import com.google.protobuf.ByteString;
 import com.google.protobuf.InvalidProtocolBufferException;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.tajo.catalog.CatalogUtil;
 import org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto;
 import org.apache.tajo.catalog.proto.CatalogProtos.StoreType;
 import org.apache.tajo.storage.fragment.Fragment;
@@ -156,7 +157,7 @@ public class HBaseFragment implements Fragment, Comparable<HBaseFragment>,
Clone
     FragmentProto.Builder fragmentBuilder = FragmentProto.newBuilder();
     fragmentBuilder.setId(this.tableName);
     fragmentBuilder.setContents(builder.buildPartial().toByteString());
-    fragmentBuilder.setStoreType(StoreType.HBASE.name());
+    fragmentBuilder.setStoreType(CatalogUtil.getStoreTypeString(StoreType.HBASE));
     return fragmentBuilder.build();
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/CSVFile.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/CSVFile.java
b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/CSVFile.java
index d4dde28..dd5366c 100644
--- a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/CSVFile.java
+++ b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/CSVFile.java
@@ -226,7 +226,7 @@ public class CSVFile {
           deflateFilter = null;
         }
       } finally {
-        IOUtils.cleanup(LOG, os, fos, outputStream);
+        IOUtils.cleanup(LOG, os, fos);
         if (compressor != null) {
           CodecPool.returnCompressor(compressor);
           compressor = null;

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/fragment/FileFragment.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/fragment/FileFragment.java
b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/fragment/FileFragment.java
index ac413ca..ab1c808 100644
--- a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/fragment/FileFragment.java
+++ b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/fragment/FileFragment.java
@@ -24,6 +24,7 @@ import com.google.protobuf.ByteString;
 import com.google.protobuf.InvalidProtocolBufferException;
 import org.apache.hadoop.fs.BlockLocation;
 import org.apache.hadoop.fs.Path;
+import org.apache.tajo.catalog.CatalogUtil;
 import org.apache.tajo.catalog.proto.CatalogProtos.StoreType;
 import org.apache.tajo.storage.StorageFragmentProtos.*;
 import org.apache.tajo.util.TUtil;
@@ -230,7 +231,7 @@ public class FileFragment implements Fragment, Comparable<FileFragment>,
Cloneab
 
     FragmentProto.Builder fragmentBuilder = FragmentProto.newBuilder();
     fragmentBuilder.setId(this.tableName);
-    fragmentBuilder.setStoreType(StoreType.CSV.name());
+    fragmentBuilder.setStoreType(CatalogUtil.getStoreTypeString(StoreType.CSV));
     fragmentBuilder.setContents(builder.buildPartial().toByteString());
     return fragmentBuilder.build();
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/text/DelimitedTextFile.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/text/DelimitedTextFile.java
b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/text/DelimitedTextFile.java
index ac7c549..ebf9608 100644
--- a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/text/DelimitedTextFile.java
+++ b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/text/DelimitedTextFile.java
@@ -242,7 +242,7 @@ public class DelimitedTextFile {
           deflateFilter = null;
         }
       } finally {
-        IOUtils.cleanup(LOG, fos, os, outputStream);
+        IOUtils.cleanup(LOG, os, fos);
         if (compressor != null) {
           CodecPool.returnCompressor(compressor);
           compressor = null;

http://git-wip-us.apache.org/repos/asf/tajo/blob/1bf71f6f/tajo-storage/tajo-storage-hdfs/src/test/resources/storage-default.xml
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-hdfs/src/test/resources/storage-default.xml b/tajo-storage/tajo-storage-hdfs/src/test/resources/storage-default.xml
index adddf66..da49d1d 100644
--- a/tajo-storage/tajo-storage-hdfs/src/test/resources/storage-default.xml
+++ b/tajo-storage/tajo-storage-hdfs/src/test/resources/storage-default.xml
@@ -38,12 +38,12 @@
   <!--- Registered Scanner Handler -->
   <property>
     <name>tajo.storage.scanner-handler</name>
-    <value>textfile,csv,json,raw,rcfile,row,parquet,sequencefile,avro</value>
+    <value>text,csv,json,raw,rcfile,row,parquet,sequencefile,avro</value>
   </property>
 
   <!--- Fragment Class Configurations -->
   <property>
-    <name>tajo.storage.fragment.textfile.class</name>
+    <name>tajo.storage.fragment.text.class</name>
     <value>org.apache.tajo.storage.fragment.FileFragment</value>
   </property>
   <property>
@@ -81,7 +81,7 @@
 
   <!--- Scanner Handler -->
   <property>
-    <name>tajo.storage.scanner-handler.textfile.class</name>
+    <name>tajo.storage.scanner-handler.text.class</name>
     <value>org.apache.tajo.storage.text.DelimitedTextFile$DelimitedTextFileScanner</value>
   </property>
 
@@ -128,11 +128,11 @@
   <!--- Appender Handler -->
   <property>
     <name>tajo.storage.appender-handler</name>
-    <value>textfile,csv,raw,rcfile,row,parquet,sequencefile,avro</value>
+    <value>text,csv,raw,rcfile,row,parquet,sequencefile,avro</value>
   </property>
 
   <property>
-    <name>tajo.storage.appender-handler.textfile.class</name>
+    <name>tajo.storage.appender-handler.text.class</name>
     <value>org.apache.tajo.storage.text.DelimitedTextFile$DelimitedTextFileAppender</value>
   </property>
 


Mime
View raw message