protected void processStorageFormat(String name) throws SemanticException { if (name.isEmpty()) { throw new SemanticException("File format in STORED AS clause cannot be empty"); } StorageFormatDescriptor descriptor = storageFormatFactory.get(name); if (descriptor == null) { throw new SemanticException("Unrecognized file format in STORED AS clause:" + " '" + name + "'"); } inputFormat = ensureClassExists(descriptor.getInputFormat()); outputFormat = ensureClassExists(descriptor.getOutputFormat()); if (serde == null) { serde = ensureClassExists(descriptor.getSerde()); } if (serde == null) { // RCFile supports a configurable SerDe if (name.equalsIgnoreCase(IOConstants.RCFILE)) { serde = ensureClassExists(HiveConf.getVar(conf, HiveConf.ConfVars.HIVEDEFAULTRCFILESERDE)); } else { serde = ensureClassExists(HiveConf.getVar(conf, HiveConf.ConfVars.HIVEDEFAULTSERDE)); } } }
protected void processStorageFormat(String name) throws SemanticException { if (name.isEmpty()) { throw new SemanticException("File format in STORED AS clause cannot be empty"); } StorageFormatDescriptor descriptor = storageFormatFactory.get(name); if (descriptor == null) { throw new SemanticException("Unrecognized file format in STORED AS clause:" + " '" + name + "'"); } inputFormat = ensureClassExists(descriptor.getInputFormat()); outputFormat = ensureClassExists(descriptor.getOutputFormat()); if (serde == null) { serde = ensureClassExists(descriptor.getSerde()); } if (serde == null) { // RCFile supports a configurable SerDe if (name.equalsIgnoreCase(IOConstants.RCFILE)) { serde = ensureClassExists(HiveConf.getVar(conf, HiveConf.ConfVars.HIVEDEFAULTRCFILESERDE)); } else { serde = ensureClassExists(HiveConf.getVar(conf, HiveConf.ConfVars.HIVEDEFAULTSERDE)); } } }
String serdeClass = descriptor.getSerde(); if (serdeClass == null) { if (descriptor instanceof RCFileStorageFormatDescriptor) {
protected void processStorageFormat(String name) throws SemanticException { if (name.isEmpty()) { throw new SemanticException("File format in STORED AS clause cannot be empty"); } StorageFormatDescriptor descriptor = storageFormatFactory.get(name); if (descriptor == null) { throw new SemanticException("Unrecognized file format in STORED AS clause:" + " '" + name + "'"); } inputFormat = ensureClassExists(descriptor.getInputFormat()); outputFormat = ensureClassExists(descriptor.getOutputFormat()); if (serde == null) { serde = ensureClassExists(descriptor.getSerde()); } if (serde == null) { // RCFile supports a configurable SerDe if (name.equalsIgnoreCase(IOConstants.RCFILE)) { serde = ensureClassExists(HiveConf.getVar(conf, HiveConf.ConfVars.HIVEDEFAULTRCFILESERDE)); } else { serde = ensureClassExists(HiveConf.getVar(conf, HiveConf.ConfVars.HIVEDEFAULTSERDE)); } } }
sd.setInputFormat(descriptor.getInputFormat()); sd.setOutputFormat(descriptor.getOutputFormat()); sd.getSerdeInfo().setSerializationLib(descriptor.getSerde()); sd.setInputFormat(descriptor.getInputFormat()); sd.setOutputFormat(descriptor.getOutputFormat()); sd.getSerdeInfo().setSerializationLib(descriptor.getSerde());