Class InferSchema


  • @NotNull
    public final class InferSchema
    extends java.lang.Object
    A helper that determines the StructType for a BsonDocument and finds the common StructType 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 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