code: def test_json_sampling_ratio(self):
      rdd = self.spark.sparkContext.range(0, 100, 1, 1).map(
          lambda x: '{"a":0.1}' if x == 1 else '{"a":%s}' % str(x)
      )
      schema = (
          self.spark.read.option("inferSchema", True)
          .option("samplingRatio", 0.5)
          .json(rdd)
          .schema
      )
      self.assertEqual(
          schema, StructType([StructField("a", LongType(), True)])
      )
  
imports: import shutil
  import tempfile
  import uuid
  import os
  from pyspark.sql import Row
  from pyspark.sql.types import IntegerType, StructField, StructType, LongType, StringType
  from pyspark.testing.sqlutils import ReusedSQLTestCase
label_desc: Use image node_id 11 for calling the DataSourcesTestsMixin obj's underlying member method code with example usage: obj.test_json_sampling_ratio() without return types