You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/12/05 19:03:02 UTC

[GitHub] [incubator-druid] jihoonson commented on a change in pull request #8993: add customize separator for TSV inputFormat

jihoonson commented on a change in pull request #8993: add customize separator for TSV inputFormat
URL: https://github.com/apache/incubator-druid/pull/8993#discussion_r354492519
 
 

 ##########
 File path: core/src/main/java/org/apache/druid/data/input/impl/TsvInputFormat.java
 ##########
 @@ -27,15 +27,34 @@
 
 public class TsvInputFormat extends SeparateValueInputFormat
 {
+
+  private static Format getFormat(String delimiter)
+  {
+    if (delimiter != null && delimiter.length() > 0) {
+      Format.CustomizeSV.setDelimiter(delimiter, null);
+      return Format.CustomizeSV;
+    } else {
+      return Format.TSV;
+    }
+  }
+
   @JsonCreator
   public TsvInputFormat(
       @JsonProperty("columns") @Nullable List<String> columns,
       @JsonProperty("listDelimiter") @Nullable String listDelimiter,
+      @JsonProperty("delimiter") @Nullable String delimiter,
 
 Review comment:
   Good point. I would suggest to rename the type of this input format. How about [`dsv`](https://en.wikipedia.org/wiki/Delimiter-separated_values) or `delimited`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org