15 package com.cloudera.impala.catalog;
19 import org.apache.hadoop.hive.metastore.api.StorageDescriptor;
22 import com.cloudera.impala.thrift.TTableRowFormat;
23 import com.google.common.base.Preconditions;
38 private RowFormat(String fieldDelimiter, String lineDelimiter, String escapeChar,
55 public RowFormat(String fieldDelimiter, String lineDelimiter, String escapeChar) {
56 this(fieldDelimiter, lineDelimiter, escapeChar,
true);
76 return value == null ? null :
new StringLiteral(value).getUnescapedValue();
80 TTableRowFormat tableRowFormat =
new TTableRowFormat();
84 return tableRowFormat;
88 if (tableRowFormat == null) {
93 return new RowFormat(tableRowFormat.getField_terminator(),
94 tableRowFormat.getLine_terminator(), tableRowFormat.getEscaped_by(),
false);
101 Preconditions.checkNotNull(sd);
102 Map<String, String> params = sd.getSerdeInfo().getParameters();
103 return new RowFormat(params.get(
"field.delim"), params.get(
"line.delim"),
104 params.get(
"escape.delim"));