Class InferSchema
- java.lang.Object
-
- com.mongodb.spark.sql.connector.schema.InferSchema
-
@NotNull public final class InferSchema extends java.lang.Object
A helper that determines theStructType
for aBsonDocument
and finds the commonStructType
for a list of BsonDocuments.All Bson types are considered convertible to Spark types. For any Bson types that doesn't have a direct conversion to a Spark type then a String type will be used.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StructType
inferSchema(CaseInsensitiveStringMap options)
Infer the schema for the collection
-
-
-
Method Detail
-
inferSchema
public static StructType inferSchema(CaseInsensitiveStringMap options)
Infer the schema for the collection- Parameters:
options
- the configuration options to determine the namespace to determine the schema for- Returns:
- the schema
-
-