Example #1
0
 public TTableRowFormat toThrift() {
   TTableRowFormat tableRowFormat = new TTableRowFormat();
   tableRowFormat.setField_terminator(getFieldDelimiter());
   tableRowFormat.setLine_terminator(getLineDelimiter());
   tableRowFormat.setEscaped_by(getEscapeChar());
   return tableRowFormat;
 }
Example #2
0
 public static RowFormat fromThrift(TTableRowFormat tableRowFormat) {
   if (tableRowFormat == null) {
     return RowFormat.DEFAULT_ROW_FORMAT;
   }
   // When creating a RowFormat from thrift, don't unescape the values, they should have
   // already been unescaped.
   return new RowFormat(
       tableRowFormat.getField_terminator(),
       tableRowFormat.getLine_terminator(),
       tableRowFormat.getEscaped_by(),
       false);
 }