From 873e2a81dcf14080ec3c53c76a7137cbdcd3fd4a Mon Sep 17 00:00:00 2001 From: Keuntae Park Date: Fri, 6 Feb 2015 13:58:52 +0900 Subject: [PATCH 1/2] meta options of scanned tables are passed between Stages through DataChannel - DataChannel contains meta options of source Execution block, collected by visiting all the ScanNodes in the block. When multiple ScanNodes have different options about the same key, options of last visited ScanNode overwrite previous ones. - Each Execution block reflects incoming DataChannel in buildInputExecutor. - Meta options of the Stage are recalculated before materializing the result, which reflect all the options from DataChannels and also new ScanNode in the given Stage. Changes: - DataChannel contains all the meta options from the source Execution block, which means protocol buffer definition is also modified. - PlannerUtil provides new static method getScanOptions(), which visit all the ScanNode in the Execution block and get options. - buildInputExecutor() is modified to reflect meta options of incoming DataChannel of the given Execution block. - 'csvfile.delimiter' option sets CSVFILE_DELIMITER (not TEXT_DELIMITER) because TEXT_DELIMITER is set as '|' even when there is no explicit 'csvfile.delimiter' so that explicit 'csvfile.delimiter' should be prior to default delimiter. Without above, when two tables, one is 'csvfile.delimiter'=';' and the other has no option, are used in the same query, one is set as TEXT_DELIMITER = ';' and the other is set as TEXT_DELIMITER = '|' and compete for the meta option of the Execution block. If we give high prioritiy to the explicit meta setting, it always wins over the default value and I think it is desirable. Arguable points: - If multiple meta options conflict on one option, it just select lastly comming one. User SHOULD care about that. - (A little out of focus) Default delimiter '|' is too common character, isn't it? --- .../tajo/engine/parser/SQLAnalyzer.java | 2 +- .../engine/planner/PhysicalPlannerImpl.java | 3 ++ .../engine/planner/global/DataChannel.java | 30 ++++++++++++++++++- .../engine/planner/global/GlobalPlanner.java | 6 ++-- .../engine/planner/global/MasterPlan.java | 4 --- .../org/apache/tajo/querymaster/Stage.java | 2 +- .../src/main/proto/TajoWorkerProtocol.proto | 1 + .../tajo/engine/query/TestCTASQuery.java | 2 +- .../tajo/engine/query/TestJoinQuery.java | 14 +++++++++ .../tajo/engine/query/TestSelectQuery.java | 12 ++++++++ .../tableWithDiffDelimiter/diffDelimiter.tbl | 3 ++ .../tableWithDelimiter/tableWithDelimiter.tbl | 3 ++ .../table1_with_different_delimiter_dll.sql | 1 + .../table2_with_different_delimiter_dll.sql | 2 ++ .../testJoinWithDifferentDelimiter.sql | 1 + .../table_with_delimiter_ddl.sql | 2 ++ .../TestSelectQuery/testCustomDelimiter.sql | 1 + .../testJoinWithDifferentDelimiter.result | 5 ++++ .../testCustomDelimiter.result | 5 ++++ .../apache/tajo/plan/util/PlannerUtil.java | 20 +++++++++++++ .../java/org/apache/tajo/storage/CSVFile.java | 6 ++-- 21 files changed, 111 insertions(+), 14 deletions(-) create mode 100644 tajo-core/src/test/resources/dataset/TestJoinQuery/tableWithDiffDelimiter/diffDelimiter.tbl create mode 100644 tajo-core/src/test/resources/dataset/TestSelectQuery/tableWithDelimiter/tableWithDelimiter.tbl create mode 100644 tajo-core/src/test/resources/queries/TestJoinQuery/table1_with_different_delimiter_dll.sql create mode 100644 tajo-core/src/test/resources/queries/TestJoinQuery/table2_with_different_delimiter_dll.sql create mode 100644 tajo-core/src/test/resources/queries/TestJoinQuery/testJoinWithDifferentDelimiter.sql create mode 100644 tajo-core/src/test/resources/queries/TestSelectQuery/table_with_delimiter_ddl.sql create mode 100644 tajo-core/src/test/resources/queries/TestSelectQuery/testCustomDelimiter.sql create mode 100644 tajo-core/src/test/resources/results/TestJoinQuery/testJoinWithDifferentDelimiter.result create mode 100644 tajo-core/src/test/resources/results/TestSelectQuery/testCustomDelimiter.result diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java b/tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java index ab8e647e78..214a447618 100644 --- a/tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java +++ b/tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java @@ -1559,7 +1559,7 @@ public Map escapeTableMeta(Map map) { for (Map.Entry entry : map.entrySet()) { if (entry.getKey().equals(StorageConstants.CSVFILE_DELIMITER) || entry.getKey().equals(StorageConstants.TEXT_DELIMITER)) { //backward compatibility - params.put(StorageConstants.TEXT_DELIMITER, StringUtils.unicodeEscapedDelimiter(entry.getValue())); + params.put(StorageConstants.CSVFILE_DELIMITER, StringUtils.unicodeEscapedDelimiter(entry.getValue())); } else if (entry.getKey().equals(StorageConstants.CSVFILE_NULL) || entry.getKey().equals(StorageConstants.TEXT_NULL)) { //backward compatibility params.put(StorageConstants.TEXT_NULL, entry.getValue()); diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/PhysicalPlannerImpl.java b/tajo-core/src/main/java/org/apache/tajo/engine/planner/PhysicalPlannerImpl.java index d043a27a7f..e5cbfcaab8 100644 --- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/PhysicalPlannerImpl.java +++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/PhysicalPlannerImpl.java @@ -761,6 +761,9 @@ private PhysicalExec createRightAntiJoinPlan(TaskAttemptContext context, JoinNod */ public PhysicalExec createShuffleFileWritePlan(TaskAttemptContext ctx, ShuffleFileWriteNode plan, PhysicalExec subOp) throws IOException { + // inherit all the meta options from scanning tables + plan.getOptions().putAll(PlannerUtil.getScanOptions(plan)); + switch (plan.getShuffleType()) { case HASH_SHUFFLE: case SCATTERED_HASH_SHUFFLE: diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/DataChannel.java b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/DataChannel.java index 11548d35c1..9a4a3109d4 100644 --- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/DataChannel.java +++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/DataChannel.java @@ -23,6 +23,8 @@ import org.apache.tajo.catalog.Column; import org.apache.tajo.catalog.Schema; import org.apache.tajo.catalog.SchemaUtil; +import org.apache.tajo.plan.util.PlannerUtil; +import org.apache.tajo.util.KeyValueSet; import org.apache.tajo.util.TUtil; import static org.apache.tajo.catalog.proto.CatalogProtos.StoreType; @@ -37,6 +39,7 @@ public class DataChannel { private ShuffleType shuffleType; private Integer numOutputs = 1; private Column[] shuffleKeys; + private KeyValueSet options; private Schema schema; @@ -47,13 +50,24 @@ public DataChannel(ExecutionBlockId srcId, ExecutionBlockId targetId) { this.targetId = targetId; } + public DataChannel(ExecutionBlock src, ExecutionBlock target) { + this(src.getId(), target.getId()); + this.options = PlannerUtil.getScanOptions(src.getPlan()); + } + public DataChannel(ExecutionBlockId srcId, ExecutionBlockId targetId, ShuffleType shuffleType) { this(srcId, targetId); this.shuffleType = shuffleType; } + public DataChannel(ExecutionBlock src, ExecutionBlock target, ShuffleType shuffleType) { + this(src, target); + this.shuffleType = shuffleType; + } + public DataChannel(ExecutionBlock src, ExecutionBlock target, ShuffleType shuffleType, int numOutput) { - this(src.getId(), target.getId(), shuffleType, numOutput); + this(src, target, shuffleType); + this.numOutputs = numOutput; setSchema(src.getPlan().getOutSchema()); } @@ -85,6 +99,9 @@ public DataChannel(DataChannelProto proto) { if (proto.hasStoreType()) { this.storeType = proto.getStoreType(); } + if (proto.hasOptions()) { + this.setOptions(new KeyValueSet(proto.getOptions())); + } } public ExecutionBlockId getSrcId() { @@ -152,6 +169,14 @@ public StoreType getStoreType() { return storeType; } + public void setOptions(KeyValueSet options) { + this.options = new KeyValueSet(options); + } + + public KeyValueSet getOptions() { + return options; + } + public DataChannelProto getProto() { DataChannelProto.Builder builder = DataChannelProto.newBuilder(); builder.setSrcId(srcId.getProto()); @@ -175,6 +200,9 @@ public DataChannelProto getProto() { if(storeType != null){ builder.setStoreType(storeType); } + if(options != null) { + builder.setOptions(options.getProto()); + } return builder.build(); } diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java index 6c3e3b8157..75fbc37a50 100644 --- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java +++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java @@ -151,7 +151,7 @@ public void build(MasterPlan masterPlan) throws IOException, PlanningException { // TODO - consider two terminal types: specified output or not if (childExecBlock.getPlan() != null) { terminalBlock = masterPlan.createTerminalBlock(); - DataChannel finalChannel = new DataChannel(childExecBlock.getId(), terminalBlock.getId()); + DataChannel finalChannel = new DataChannel(childExecBlock, terminalBlock); setFinalOutputChannel(finalChannel, lastNode.getOutSchema()); masterPlan.addConnect(finalChannel); } else { // if one or more unions is terminal @@ -178,7 +178,7 @@ public static ScanNode buildInputExecutor(LogicalPlan plan, DataChannel channel) Preconditions.checkArgument(channel.getSchema() != null, "Channel schema (" + channel.getSrcId().getId() + " -> " + channel.getTargetId().getId() + ") is not initialized"); - TableMeta meta = new TableMeta(channel.getStoreType(), new KeyValueSet()); + TableMeta meta = new TableMeta(channel.getStoreType(), new KeyValueSet(channel.getOptions())); TableDesc desc = new TableDesc(channel.getSrcId().toString(), channel.getSchema(), meta, new Path("/").toUri()); ScanNode scanNode = plan.createNode(ScanNode.class); scanNode.init(desc); @@ -487,7 +487,7 @@ private void buildJoinPlanWithUnionChannel(GlobalPlanContext context, JoinNode j if (otherSideBlock == null && !left) { DataChannel oldChannel = channel; masterPlan.disconnect(oldChannel.getSrcId(), oldChannel.getTargetId()); - channel = new DataChannel(oldChannel.getSrcId(), targetBlock.getId()); + channel = new DataChannel(masterPlan.getExecBlock(oldChannel.getSrcId()), targetBlock); } channel.setSchema(childNode.getOutSchema()); channel.setShuffleType(HASH_SHUFFLE); diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/MasterPlan.java b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/MasterPlan.java index 3cca4f2943..d718bc56d3 100644 --- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/MasterPlan.java +++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/MasterPlan.java @@ -113,10 +113,6 @@ public void addConnect(DataChannel dataChannel) { } public void addConnect(ExecutionBlock src, ExecutionBlock target, ShuffleType type) { - addConnect(src.getId(), target.getId(), type); - } - - public void addConnect(ExecutionBlockId src, ExecutionBlockId target, ShuffleType type) { addConnect(new DataChannel(src, target, type)); } diff --git a/tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java b/tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java index efadaa7548..3cc23629df 100644 --- a/tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java +++ b/tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java @@ -723,7 +723,7 @@ private void finalizeStats() { } schema = channel.getSchema(); - meta = CatalogUtil.newTableMeta(storeType, new KeyValueSet()); + meta = CatalogUtil.newTableMeta(storeType, channel.getOptions()); inputStatistics = statsArray[0]; resultStatistics = statsArray[1]; } diff --git a/tajo-core/src/main/proto/TajoWorkerProtocol.proto b/tajo-core/src/main/proto/TajoWorkerProtocol.proto index b8c9575b35..355d358f0c 100644 --- a/tajo-core/src/main/proto/TajoWorkerProtocol.proto +++ b/tajo-core/src/main/proto/TajoWorkerProtocol.proto @@ -185,6 +185,7 @@ message DataChannelProto { required ShuffleType shuffleType = 4; optional SchemaProto schema = 5; + optional KeyValueSetProto options = 6; repeated ColumnProto shuffleKeys = 7; optional int32 numOutputs = 9 [default = 1]; 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 e93d214c83..b189fd45de 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 @@ -225,7 +225,7 @@ public final void testCtasWithOptions() throws Exception { KeyValueSet options = desc.getMeta().getOptions(); assertNotNull(options); - assertEquals(StringEscapeUtils.escapeJava("\u0001"), options.get(StorageConstants.TEXT_DELIMITER)); + assertEquals(StringEscapeUtils.escapeJava("\u0001"), options.get(StorageConstants.CSVFILE_DELIMITER)); } @Test diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java index ecd933dfe8..1332e78de8 100644 --- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java +++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java @@ -148,6 +148,20 @@ public final void testRightOuterJoinWithThetaJoinConditionInWhere() throws Excep cleanupQuery(res); } + @Test + public final void testJoinWithDifferentDelimiter() throws Exception { + executeDDL("table1_with_different_delimiter_dll.sql", "table1"); + executeDDL("table2_with_different_delimiter_dll.sql", "tableWithDiffDelimiter"); + try { + ResultSet res = executeQuery(); + assertResultSet(res); + cleanupQuery(res); + } finally { + executeString("DROP TABLE table1"); + executeString("DROP TABLE table2"); + } + } + @Test public final void testWhereClauseJoin1() throws Exception { ResultSet res = executeQuery(); diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java index 0df4001089..e4974def5c 100644 --- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java +++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java @@ -636,4 +636,16 @@ public void testTimezonedTable5() throws Exception { testingCluster.getConfiguration().setSystemTimezone(TimeZone.getTimeZone("GMT")); } } + + @Test + public void testCustomDelimiter() throws Exception { + try { + executeDDL("table_with_delimiter_ddl.sql", "tableWithDelimiter"); + ResultSet res = executeQuery(); + assertResultSet(res); + cleanupQuery(res); + } finally { + executeString("DROP TABLE IF EXISTS tabledelimiter"); + } + } } \ No newline at end of file diff --git a/tajo-core/src/test/resources/dataset/TestJoinQuery/tableWithDiffDelimiter/diffDelimiter.tbl b/tajo-core/src/test/resources/dataset/TestJoinQuery/tableWithDiffDelimiter/diffDelimiter.tbl new file mode 100644 index 0000000000..1a295161c4 --- /dev/null +++ b/tajo-core/src/test/resources/dataset/TestJoinQuery/tableWithDiffDelimiter/diffDelimiter.tbl @@ -0,0 +1,3 @@ +1,a|b|c,1.1 +2,d|e|f,2.2 +3,g|h|i,3.3 \ No newline at end of file diff --git a/tajo-core/src/test/resources/dataset/TestSelectQuery/tableWithDelimiter/tableWithDelimiter.tbl b/tajo-core/src/test/resources/dataset/TestSelectQuery/tableWithDelimiter/tableWithDelimiter.tbl new file mode 100644 index 0000000000..dd50cb05ca --- /dev/null +++ b/tajo-core/src/test/resources/dataset/TestSelectQuery/tableWithDelimiter/tableWithDelimiter.tbl @@ -0,0 +1,3 @@ +1;a;1.1 +2;a|b;2.4 +3;b|c|d;3.2 \ No newline at end of file diff --git a/tajo-core/src/test/resources/queries/TestJoinQuery/table1_with_different_delimiter_dll.sql b/tajo-core/src/test/resources/queries/TestJoinQuery/table1_with_different_delimiter_dll.sql new file mode 100644 index 0000000000..e17e52467d --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestJoinQuery/table1_with_different_delimiter_dll.sql @@ -0,0 +1 @@ +create external table table1 (id int, name text, score float, type text) using csv location ${table.path}; \ No newline at end of file diff --git a/tajo-core/src/test/resources/queries/TestJoinQuery/table2_with_different_delimiter_dll.sql b/tajo-core/src/test/resources/queries/TestJoinQuery/table2_with_different_delimiter_dll.sql new file mode 100644 index 0000000000..ef00ad4179 --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestJoinQuery/table2_with_different_delimiter_dll.sql @@ -0,0 +1,2 @@ +create external table table2 (id int, name text, value float) using csv +with ('csvfile.delimiter'=',') location ${table.path}; \ No newline at end of file diff --git a/tajo-core/src/test/resources/queries/TestJoinQuery/testJoinWithDifferentDelimiter.sql b/tajo-core/src/test/resources/queries/TestJoinQuery/testJoinWithDifferentDelimiter.sql new file mode 100644 index 0000000000..2780c05f9d --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestJoinQuery/testJoinWithDifferentDelimiter.sql @@ -0,0 +1 @@ +select * from table2 b join table1 a on a.id = b.id; \ No newline at end of file diff --git a/tajo-core/src/test/resources/queries/TestSelectQuery/table_with_delimiter_ddl.sql b/tajo-core/src/test/resources/queries/TestSelectQuery/table_with_delimiter_ddl.sql new file mode 100644 index 0000000000..59ab1c3976 --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestSelectQuery/table_with_delimiter_ddl.sql @@ -0,0 +1,2 @@ +create external table tabledelimiter (id int, name text, score float) using csv +with ('csvfile.delimiter'=';') location ${table.path}; \ No newline at end of file diff --git a/tajo-core/src/test/resources/queries/TestSelectQuery/testCustomDelimiter.sql b/tajo-core/src/test/resources/queries/TestSelectQuery/testCustomDelimiter.sql new file mode 100644 index 0000000000..95725b4ebc --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestSelectQuery/testCustomDelimiter.sql @@ -0,0 +1 @@ +select name, score from tabledelimiter; \ No newline at end of file diff --git a/tajo-core/src/test/resources/results/TestJoinQuery/testJoinWithDifferentDelimiter.result b/tajo-core/src/test/resources/results/TestJoinQuery/testJoinWithDifferentDelimiter.result new file mode 100644 index 0000000000..d5c6931977 --- /dev/null +++ b/tajo-core/src/test/resources/results/TestJoinQuery/testJoinWithDifferentDelimiter.result @@ -0,0 +1,5 @@ +id,name,value,id,name,score,type +------------------------------- +1,a|b|c,1.1,1,ooo,1.1,a +2,d|e|f,2.2,2,ppp,2.3,b +3,g|h|i,3.3,3,qqq,3.4,c \ No newline at end of file diff --git a/tajo-core/src/test/resources/results/TestSelectQuery/testCustomDelimiter.result b/tajo-core/src/test/resources/results/TestSelectQuery/testCustomDelimiter.result new file mode 100644 index 0000000000..48fdea0c6c --- /dev/null +++ b/tajo-core/src/test/resources/results/TestSelectQuery/testCustomDelimiter.result @@ -0,0 +1,5 @@ +name,score +------------------------------- +a,1.1 +a|b,2.4 +b|c|d,3.2 \ No newline at end of file diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/util/PlannerUtil.java b/tajo-plan/src/main/java/org/apache/tajo/plan/util/PlannerUtil.java index 0fbd3593ad..c9fc958bc3 100644 --- a/tajo-plan/src/main/java/org/apache/tajo/plan/util/PlannerUtil.java +++ b/tajo-plan/src/main/java/org/apache/tajo/plan/util/PlannerUtil.java @@ -436,6 +436,26 @@ public static LogicalNode[] findAllNodes(LogicalNode node, NodeType... type) { return founds.toArray(new LogicalNode[founds.size()]); } + /** + * Find the all options of scan node from the given node + * + * @param plan start node + * @return a KeyValueSet that contains all options + */ + public static KeyValueSet getScanOptions(LogicalNode plan) { + KeyValueSet metaOptions = new KeyValueSet(); + + if (plan != null) { + LogicalNode[] scanNodes = PlannerUtil.findAllNodes(plan, NodeType.SCAN); + for (LogicalNode scanNode: scanNodes) { + KeyValueSet options = ((ScanNode)scanNode).getTableDesc().getMeta().getOptions(); + metaOptions.putAll(options); + } + } + + return metaOptions; + } + /** * Find a parent node of a given-typed operator. * 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 dd5366c045..da452ebf48 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 @@ -83,7 +83,7 @@ public CSVAppender(Configuration conf, final TaskAttemptId taskAttemptId, this.meta = meta; this.schema = schema; this.delimiter = StringEscapeUtils.unescapeJava( - this.meta.getOption(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER)).charAt(0); + meta.getOption(StorageConstants.CSVFILE_DELIMITER, meta.getOption(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER))).charAt(0); this.columnNum = schema.size(); @@ -264,8 +264,8 @@ public CSVScanner(Configuration conf, final Schema schema, final TableMeta meta, //Delimiter this.delimiter = StringEscapeUtils.unescapeJava( - meta.getOption(StorageConstants.TEXT_DELIMITER, - meta.getOption(StorageConstants.CSVFILE_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER))).charAt(0); + meta.getOption(StorageConstants.CSVFILE_DELIMITER, + meta.getOption(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER))).charAt(0); String nullCharacters = StringEscapeUtils.unescapeJava( meta.getOption(StorageConstants.TEXT_NULL, From 95bd0557a3ed6af21aac60892cd07bb47708d4d4 Mon Sep 17 00:00:00 2001 From: Keuntae Park Date: Fri, 6 Feb 2015 14:30:54 +0900 Subject: [PATCH 2/2] test case is modified to add join, group by, order by operations also --- .../TestJoinQuery/testJoinWithDifferentDelimiter.sql | 2 +- .../TestJoinQuery/testJoinWithDifferentDelimiter.result | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tajo-core/src/test/resources/queries/TestJoinQuery/testJoinWithDifferentDelimiter.sql b/tajo-core/src/test/resources/queries/TestJoinQuery/testJoinWithDifferentDelimiter.sql index 2780c05f9d..78e486fded 100644 --- a/tajo-core/src/test/resources/queries/TestJoinQuery/testJoinWithDifferentDelimiter.sql +++ b/tajo-core/src/test/resources/queries/TestJoinQuery/testJoinWithDifferentDelimiter.sql @@ -1 +1 @@ -select * from table2 b join table1 a on a.id = b.id; \ No newline at end of file +select a.id, b.name from table2 b join table1 a on a.id = b.id group by a.id, b.name order by a.id; \ No newline at end of file diff --git a/tajo-core/src/test/resources/results/TestJoinQuery/testJoinWithDifferentDelimiter.result b/tajo-core/src/test/resources/results/TestJoinQuery/testJoinWithDifferentDelimiter.result index d5c6931977..90ba57fa58 100644 --- a/tajo-core/src/test/resources/results/TestJoinQuery/testJoinWithDifferentDelimiter.result +++ b/tajo-core/src/test/resources/results/TestJoinQuery/testJoinWithDifferentDelimiter.result @@ -1,5 +1,5 @@ -id,name,value,id,name,score,type +id,name ------------------------------- -1,a|b|c,1.1,1,ooo,1.1,a -2,d|e|f,2.2,2,ppp,2.3,b -3,g|h|i,3.3,3,qqq,3.4,c \ No newline at end of file +1,a|b|c +2,d|e|f +3,g|h|i \ No newline at end of file