MongoDB
 sql >> Base de données >  >> NoSQL >> MongoDB

Comment configurer Java Spark sparksession samplesize

C'est spark.mongodb.input.sampleSize

SparkSession spark = SparkSession.builder()
                .master("local[2]")
                .appName("SparkReadMgToHive")
                .config("spark.sql.warehouse.dir", warehouseLocation)
                .config("spark.mongodb.input.uri", "mongodb://localhost:27017/test.testcollection")
                .config("spark.mongodb.input.sampleSize", 50000)
                .enableHiveSupport()
                .getOrCreate();