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)); } } }
public StorageFormatFactory() { Map<String, StorageFormatDescriptor> localStorageFormats = new HashMap<String, StorageFormatDescriptor>(); for (StorageFormatDescriptor descriptor : ServiceLoader.load(StorageFormatDescriptor.class)) { for (String name : descriptor.getNames()) { name = name.trim().toUpperCase(); StorageFormatDescriptor oldDescriptor = localStorageFormats.put(name, descriptor); if (oldDescriptor != null) { String msg = "Storage Format Descriptor conflict at name '" + name + "', " + "the descriptor " + descriptor + " is overriding " + oldDescriptor; LOG.warn(msg); } } } this.storageFormats = ImmutableMap.copyOf(localStorageFormats); }
String serdeClass = descriptor.getSerde(); if (serdeClass == null) { if (descriptor instanceof RCFileStorageFormatDescriptor) { String[] names = new String[descriptor.getNames().size()]; names = descriptor.getNames().toArray(names); Object[] arguments = createTestArguments(names[0], serdeClass, descriptor.getInputFormat(), descriptor.getOutputFormat()); parameters.add(arguments);
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)); } } }
public StorageFormatFactory() { Map<String, StorageFormatDescriptor> localStorageFormats = new HashMap<String, StorageFormatDescriptor>(); for (StorageFormatDescriptor descriptor : ServiceLoader.load(StorageFormatDescriptor.class)) { for (String name : descriptor.getNames()) { name = name.trim().toUpperCase(); StorageFormatDescriptor oldDescriptor = localStorageFormats.put(name, descriptor); if (oldDescriptor != null) { String msg = "Storage Format Descriptor conflict at name '" + name + "', " + "the descriptor " + descriptor + " is overriding " + oldDescriptor; LOG.warn(msg); } } } this.storageFormats = ImmutableMap.copyOf(localStorageFormats); }
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)); } } }
/** * Returns a list of the names of storage formats. * * @return List of names of storage formats. */ public static Collection<Object[]> names() { List<Object[]> names = new ArrayList<Object[]>(); for (StorageFormatDescriptor descriptor : ServiceLoader.load(StorageFormatDescriptor.class)) { String[] formatNames = new String[descriptor.getNames().size()]; formatNames = descriptor.getNames().toArray(formatNames); String[] params = { formatNames[0] }; names.add(params); } return names; } }
sd.setInputFormat(descriptor.getInputFormat()); sd.setOutputFormat(descriptor.getOutputFormat()); sd.setInputFormat(descriptor.getInputFormat()); sd.setOutputFormat(descriptor.getOutputFormat()); 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());
public StorageFormatFactory() { Map<String, StorageFormatDescriptor> localStorageFormats = new HashMap<String, StorageFormatDescriptor>(); for (StorageFormatDescriptor descriptor : ServiceLoader.load(StorageFormatDescriptor.class)) { for (String name : descriptor.getNames()) { name = name.trim().toUpperCase(); StorageFormatDescriptor oldDescriptor = localStorageFormats.put(name, descriptor); if (oldDescriptor != null) { String msg = "Storage Format Descriptor conflict at name '" + name + "', " + "the descriptor " + descriptor + " is overriding " + oldDescriptor; LOG.warn(msg); } } } this.storageFormats = ImmutableMap.copyOf(localStorageFormats); }