code: public static void main(String[] args) throws AnalysisException {
      // $example on:init_session$
      SparkSession spark = SparkSession
        .builder()
        .appName("Java Spark SQL basic example")
        .config("spark.some.config.option", "some-value")
        .getOrCreate();
      // $example off:init_session$
  
      runBasicDataFrameExample(spark);
      runDatasetCreationExample(spark);
      runInferSchemaExample(spark);
      runProgrammaticSchemaExample(spark);
  
      spark.stop();
    }
docs: $example off:create_ds$