title: Pyspark: SaveTable in windows cannot handle windows path
body: <p>I am trying to save a  CSV file using a windows path (with &quot;&quot; instead of &quot;/&quot;). I think it does not works, because of the windows path.</p>
  <ol>
  <li>Is this the problem why the code does not works?</li>
  <li>Is there a workaround for the problem?</li>
  </ol>
  <p>The code:</p>
  <pre><code>from pyspark.sql import SparkSession
  from pyspark.sql.types import *
  from pyspark.sql import Row
  
  def init_spark(appname):
    spark = SparkSession.builder.appName(appname).getOrCreate()
    sc = spark.sparkContext
    return spark,sc
  
  def run_on_configs_spark():
    spark,sc = init_spark(appname=&quot;bucket_analysis&quot;)
    p_configs_RDD = sc.parallelize([1,4,5])
    p_configs_RDD=p_configs_RDD.map(mul)
    schema = StructType([StructField('a', IntegerType()), StructField('b', IntegerType())])
    df=spark.createDataFrame(p_configs_RDD,schema)
    df.write.saveAsTable(r&quot;C:\Users\yuvalr\Desktop\example_csv&quot;,format=&quot;csv&quot;)
  
  
  def mul(x):
    return (x,x**2)
  
  run_on_configs_spark()
  </code></pre>
  <p>The error code:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:/Users/yuvalr/Desktop/Git_folder/algo_sim/Bucket_analysis/Set_multiple_configurations/run_multiple_configurations.py&quot;, line 426, in &lt;module&gt;
      analysis()
    File &quot;C:/Users/yuvalr/Desktop/Git_folder/algo_sim/Bucket_analysis/Set_multiple_configurations/run_multiple_configurations.py&quot;, line 408, in analysis
      run_CDH()
    File &quot;C:/Users/yuvalr/Desktop/Git_folder/algo_sim/Bucket_analysis/Set_multiple_configurations/run_multiple_configurations.py&quot;, line 420, in run_CDH
      max_prob_for_extension=None, max_base_size_B=4096,OP_arr=[0.2],
    File &quot;C:/Users/yuvalr/Desktop/Git_folder/algo_sim/Bucket_analysis/Set_multiple_configurations/run_multiple_configurations.py&quot;, line 173, in settings_print
      dic=get_map_of_worst_seq(params)
    File &quot;C:/Users/yuvalr/Desktop/Git_folder/algo_sim/Bucket_analysis/Set_multiple_configurations/run_multiple_configurations.py&quot;, line 245, in get_map_of_worst_seq
      run_over_settings_spark_test(info_obj)
    File &quot;C:/Users/yuvalr/Desktop/Git_folder/algo_sim/Bucket_analysis/Set_multiple_configurations/run_multiple_configurations.py&quot;, line 239, in run_over_settings_spark_test
      run_on_configs_spark(configs)
    File &quot;C:\Users\yuvalr\Desktop\Git_folder\algo_sim\Bucket_analysis\Set_multiple_configurations\spark_parallelized_configs.py&quot;, line 17, in run_on_configs_spark
      df.write.saveAsTable(r&quot;C:\Users\yuvalr\Desktop\example_csv&quot;,format=&quot;csv&quot;)
    File &quot;C:\Users\yuvalr\Desktop\spark\Spark\python\pyspark\sql\readwriter.py&quot;, line 868, in saveAsTable
      self._jwrite.saveAsTable(name)
    File &quot;C:\Users\yuvalr\venv\lib\site-packages\py4j\java_gateway.py&quot;, line 1305, in __call__
      answer, self.gateway_client, self.target_id, self.name)
    File &quot;C:\Users\yuvalr\Desktop\spark\Spark\python\pyspark\sql\utils.py&quot;, line 137, in deco
      raise_from(converted)
    File &quot;&lt;string&gt;&quot;, line 3, in raise_from
  pyspark.sql.utils.ParseException: 
  mismatched input ':' expecting {&lt;EOF&gt;, '.', '-'}(line 1, pos 1)
  
  == SQL ==
  C:\Users\yuvalr\Desktop\example_csv
  -^^^
  </code></pre>