15 package com.cloudera.impala.catalog;
17 import java.util.HashMap;
19 import org.apache.hadoop.hive.metastore.api.StorageDescriptor;
21 import com.cloudera.impala.thrift.THdfsFileFormat;
22 import com.google.common.base.Preconditions;
32 Preconditions.checkNotNull(fileFormat);
33 Preconditions.checkNotNull(rowFormat);
35 StorageDescriptor sd = null;
42 default:
throw new UnsupportedOperationException(
43 "Unsupported file format: " + fileFormat);
47 sd.getSerdeInfo().putToParameters(
52 sd.getSerdeInfo().putToParameters(
"escape.delim", rowFormat.
getEscapeChar());
55 sd.getSerdeInfo().putToParameters(
"line.delim", rowFormat.
getLineDelimiter());
62 sd.setInputFormat(
"parquet.hive.DeprecatedParquetInputFormat");
63 sd.setOutputFormat(
"parquet.hive.DeprecatedParquetOutputFormat");
65 sd.getSerdeInfo().setSerializationLib(
"parquet.hive.serde.ParquetHiveSerDe");
71 sd.setInputFormat(org.apache.hadoop.mapred.TextInputFormat.class.getName());
73 org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat.class.getName());
74 sd.getSerdeInfo().setSerializationLib(
75 org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.class.getName());
81 sd.setInputFormat(org.apache.hadoop.mapred.SequenceFileInputFormat.class.getName());
83 org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat.class.getName());
84 sd.getSerdeInfo().setSerializationLib(
85 org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.class.getName());
91 sd.setInputFormat(org.apache.hadoop.hive.ql.io.RCFileInputFormat.class.getName());
92 sd.setOutputFormat(org.apache.hadoop.hive.ql.io.RCFileOutputFormat.class.getName());
93 sd.getSerdeInfo().setSerializationLib(
94 org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe.class.getName());
101 org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat.class.getName());
103 org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat.class.getName());
104 sd.getSerdeInfo().setSerializationLib(
105 org.apache.hadoop.hive.serde2.avro.AvroSerDe.class.getName());
116 StorageDescriptor sd =
new StorageDescriptor();
117 sd.setSerdeInfo(
new org.apache.hadoop.hive.metastore.api.SerDeInfo());
118 sd.getSerdeInfo().setParameters(
new HashMap<String, String>());
121 sd.setCompressed(
false);
static StorageDescriptor createSequenceFileSd()
static StorageDescriptor createSd(THdfsFileFormat fileFormat, RowFormat rowFormat)
static StorageDescriptor createAvroSd()
static StorageDescriptor createRcFileSd()
static StorageDescriptor createGenericSd()
static StorageDescriptor createParquetFileSd()
static StorageDescriptor createTextSd()