Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-41811

Implement SparkSession.sql's string formatter

    XMLWordPrintableJSON

Details

    Description

      **********************************************************************
      File "/.../spark/python/pyspark/sql/connect/session.py", line 345, in pyspark.sql.connect.session.SparkSession.sql
      Failed example:
          spark.sql(
              "SELECT * FROM range(10) WHERE id > {bound1} AND id < {bound2}", bound1=7, bound2=9
          ).show()
      Exception raised:
          Traceback (most recent call last):
            File "/.../miniconda3/envs/python3.9/lib/python3.9/doctest.py", line 1336, in __run
              exec(compile(example.source, filename, "single",
            File "<doctest pyspark.sql.connect.session.SparkSession.sql[1]>", line 1, in <module>
              spark.sql(
          TypeError: sql() got an unexpected keyword argument 'bound1'
      **********************************************************************
      File "/.../spark/python/pyspark/sql/connect/session.py", line 355, in pyspark.sql.connect.session.SparkSession.sql
      Failed example:
          spark.sql(
              "SELECT {col} FROM {mydf} WHERE id IN {x}",
              col=mydf.id, mydf=mydf, x=tuple(range(4))).show()
      Exception raised:
          Traceback (most recent call last):
            File "/.../miniconda3/envs/python3.9/lib/python3.9/doctest.py", line 1336, in __run
              exec(compile(example.source, filename, "single",
            File "<doctest pyspark.sql.connect.session.SparkSession.sql[3]>", line 1, in <module>
              spark.sql(
          TypeError: sql() got an unexpected keyword argument 'col'
      

      Attachments

        Issue Links

          Activity

            People

              podongfeng Ruifeng Zheng
              gurwls223 Hyukjin Kwon
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: