SQLContext

The transformation consists of replacing an SQLContext call with the parameter used in the pyspark function. The variable spark_context is transformed to a Snowpark Session instance, making it understandable using Snowflake. Note that the transformation generates an EWI specifying that the import statement is not required.

Input Code:

from pyspark.sql.context import SQLContext
sql_context = SQLContext(spark_context)

Output Code:

#EWI: SPRKPY1007 => pyspark.sql.context.SQLContext is not required
#from pyspark.sql.context import SQLContext
pass
sql_context = spark_context#EWI: SPRKPY1007 => pyspark.sql.context.SQLContext is not required

Last updated