docstr: This verifies createOrReplaceTempView() works with a streaming dataframe. An SQL
  SELECT query on such a table results in a streaming dataframe and the streaming query works
  as expected.
docstr_tok: ["This","verifies","createOrReplaceTempView","(",")","works","with","a","streaming","dataframe",".","An","SQL","SELECT","query","on","such","a","table","results","in","a","streaming","dataframe","and","the","streaming","query","works","as","expected","."]
code: def test_streaming_with_temporary_view(self):
      """
      This verifies createOrReplaceTempView() works with a streaming dataframe. An SQL
      SELECT query on such a table results in a streaming dataframe and the streaming query works
      as expected.
      """
      with self.table("input_table", "this_query"):
          self.spark.sql(
              "CREATE TABLE input_table (value string) USING parquet"
          )
          self.spark.sql(
              "INSERT INTO input_table VALUES ('a'), ('b'), ('c')"
          )
          df = self.spark.readStream.table("input_table")
          self.assertTrue(df.isStreaming)
          # Create a temp view
          df.createOrReplaceTempView("test_view")
          # Create a select query
          view_df = self.spark.sql(
              "SELECT CONCAT('view_', value) as vv from test_view"
          )
          self.assertTrue(view_df.isStreaming)
          q = (
              view_df.writeStream.format("memory")
              .queryName("this_query")
              .start()
          )
          q.processAllAvailable()
          q.stop()
          result = self.spark.sql(
              "SELECT * FROM this_query ORDER BY vv"
          ).collect()
          self.assertEqual(
              set(
                  [
                      Row(value="view_a"),
                      Row(value="view_b"),
                      Row(value="view_c"),
                  ]
              ),
              set(result),
          )
  
imports: import os
  import shutil
  import tempfile
  import time
  from pyspark.sql import Row
  from pyspark.sql.functions import lit
  from pyspark.sql.types import StructType, StructField, IntegerType, StringType
  from pyspark.testing.sqlutils import ReusedSQLTestCase
label_desc: Use image node_id 14 for calling the StreamingTestsMixin obj's underlying member method code with example usage: obj.test_streaming_with_temporary_view() without return types