Class PathSchemaProvider
java.lang.Object
org.apache.drill.exec.record.metadata.schema.PathSchemaProvider
- All Implemented Interfaces:
SchemaProvider
- Direct Known Subclasses:
FsMetastoreSchemaProvider
Is used to provide schema using given schema file name and path.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.fasterxml.jackson.databind.ObjectReaderReader used to read JSON schema from file into intoSchemaContainer.static final com.fasterxml.jackson.databind.ObjectWriterWriter used to write content fromSchemaContainerinto JSON file.Fields inherited from interface org.apache.drill.exec.record.metadata.schema.SchemaProvider
DEFAULT_SCHEMA_NAME -
Constructor Summary
ConstructorsConstructorDescriptionPathSchemaProvider(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) PathSchemaProvider(org.apache.hadoop.fs.Path path) -
Method Summary
Modifier and TypeMethodDescriptionprotected SchemaContainercreateTableSchema(String schema, Map<String, String> properties) voiddelete()Deletes schema.booleanexists()Checks if schema exists.read()Reads schema intoSchemaContainer.voidStores given schema definition and properties.
-
Field Details
-
READER
public static final com.fasterxml.jackson.databind.ObjectReader READERReader used to read JSON schema from file into intoSchemaContainer. Allows comment inside the JSON file. -
WRITER
public static final com.fasterxml.jackson.databind.ObjectWriter WRITERWriter used to write content fromSchemaContainerinto JSON file.
-
-
Constructor Details
-
PathSchemaProvider
- Throws:
IOException
-
PathSchemaProvider
public PathSchemaProvider(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException - Throws:
IOException
-
-
Method Details
-
delete
Description copied from interface:SchemaProviderDeletes schema.- Specified by:
deletein interfaceSchemaProvider- Throws:
IOException
-
store
public void store(String schema, Map<String, String> properties, StorageProperties storageProperties) throws IOExceptionDescription copied from interface:SchemaProviderStores given schema definition and properties.- Specified by:
storein interfaceSchemaProvider- Parameters:
schema- schema definitionproperties- map of propertiesstorageProperties- storage properties- Throws:
IOException
-
read
Description copied from interface:SchemaProviderReads schema intoSchemaContainer. Depending on implementation, can read from a file or from the given input.- Specified by:
readin interfaceSchemaProvider- Returns:
- table schema instance
- Throws:
IOException
-
exists
Description copied from interface:SchemaProviderChecks if schema exists.- Specified by:
existsin interfaceSchemaProvider- Returns:
- true if schema exists, false otherwise
- Throws:
IOException
-
createTableSchema
protected SchemaContainer createTableSchema(String schema, Map<String, String> properties) throws IOException- Throws:
IOException
-