public FormatPluginConfig createConfigForTable(String tableName, Map<String, Object> storageOptions) { return optionExtractor.createConfigForTable(tableName, storageOptions); }
public List<Function> getFunctions(List<String> tableSchemaPath, SchemaConfig schemaConfig) { return optionExtractor.getFunctions(tableSchemaPath, this, schemaConfig); }
public List<Function> getFunctions(final List<String> tableSchemaPath, final FileSystemPlugin plugin, final SchemaConfig schemaConfig) { List<TableSignature> sigs = getTableSignatures(tableSchemaPath.get(tableSchemaPath.size() - 1)); return FluentIterable.from(sigs).transform(new com.google.common.base.Function<TableSignature, Function>() { @Override public Function apply(TableSignature input) { return new WithOptionsTableMacro(tableSchemaPath, input, plugin, schemaConfig); } }).toList(); } }
@Test public void test() { FormatPluginOptionExtractor e = new FormatPluginOptionExtractor(CLASSPATH_SCAN_RESULT); Collection<FormatPluginOptionsDescriptor> options = e.getOptions(); for (FormatPluginOptionsDescriptor d : options) { assertEquals(d.pluginConfigClass.getAnnotation(JsonTypeName.class).value(), d.typeName);
this.optionExtractor = new FormatPluginOptionExtractor(context.getClasspathScan()); this.matchers = Lists.newArrayList(); this.formatCreator = new FormatCreator(context, config, context.getClasspathScan(), this);
SourceTableDefinition getDatasetWithOptions(NamespaceKey datasetPath, TableInstance instance, boolean ignoreAuthErrors, String user) throws Exception{ final FormatPluginConfig fconfig = optionExtractor.createConfigForTable(instance); return getDatasetWithFormat( datasetPath, null, fconfig, DatasetRetrievalOptions.DEFAULT.toBuilder() .setIgnoreAuthzErrors(ignoreAuthErrors) .build(), user ); }
return createConfigForTable(new TableInstance(tableSignature, params));