<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Am trying to use SQL, but createOrReplaceTempView(&amp;quot;myDataView&amp;quot;)​ fails in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/am-trying-to-use-sql-but-createorreplacetempview-quot-mydataview/m-p/27161#M19041</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Am trying to use SQL, but createOrReplaceTempView("myDataView") fails.&lt;/P&gt;
&lt;P&gt;I can create and display a DataFrame fine...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;import pandas as pd
df = pd.DataFrame(['$3,000,000.00','$3,000.00', '$200.5', '$5.5'], columns = ['Amount'])
df
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I add another cell, but it fails...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;df.createOrReplaceTempView("myDataView")
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get this error..&lt;/P&gt;
&lt;P&gt;&lt;I&gt;'DataFrame' object has no attribute 'createOrReplaceTempView'&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;I see this example out there on the net allot, but don't understand why it fails for me. I am using &lt;/P&gt;
&lt;P&gt;Community edition. 6.5 (includes Apache Spark 2.4.5, Scala 2.11)&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2020 11:59:04 GMT</pubDate>
    <dc:creator>MikeBrewer</dc:creator>
    <dc:date>2020-07-13T11:59:04Z</dc:date>
    <item>
      <title>Am trying to use SQL, but createOrReplaceTempView("myDataView")​ fails</title>
      <link>https://community.databricks.com/t5/data-engineering/am-trying-to-use-sql-but-createorreplacetempview-quot-mydataview/m-p/27161#M19041</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Am trying to use SQL, but createOrReplaceTempView("myDataView") fails.&lt;/P&gt;
&lt;P&gt;I can create and display a DataFrame fine...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;import pandas as pd
df = pd.DataFrame(['$3,000,000.00','$3,000.00', '$200.5', '$5.5'], columns = ['Amount'])
df
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I add another cell, but it fails...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;df.createOrReplaceTempView("myDataView")
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get this error..&lt;/P&gt;
&lt;P&gt;&lt;I&gt;'DataFrame' object has no attribute 'createOrReplaceTempView'&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;I see this example out there on the net allot, but don't understand why it fails for me. I am using &lt;/P&gt;
&lt;P&gt;Community edition. 6.5 (includes Apache Spark 2.4.5, Scala 2.11)&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 11:59:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/am-trying-to-use-sql-but-createorreplacetempview-quot-mydataview/m-p/27161#M19041</guid>
      <dc:creator>MikeBrewer</dc:creator>
      <dc:date>2020-07-13T11:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Am trying to use SQL, but createOrReplaceTempView("myDataView")​ fails</title>
      <link>https://community.databricks.com/t5/data-engineering/am-trying-to-use-sql-but-createorreplacetempview-quot-mydataview/m-p/27162#M19042</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I never worked with pandas on spark, but a pandas dataframe is not the same as a spark dataframe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;You need to convert it to a spark dataframe first with Koalas f.e.
&lt;P&gt;&lt;A href="https://koalas.readthedocs.io/en/latest/user_guide/pandas_pyspark.html#pyspark" target="test_blank"&gt;https://koalas.readthedocs.io/en/latest/user_guide/pandas_pyspark.html#pyspark&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 12:09:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/am-trying-to-use-sql-but-createorreplacetempview-quot-mydataview/m-p/27162#M19042</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2020-07-15T12:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Am trying to use SQL, but createOrReplaceTempView("myDataView")​ fails</title>
      <link>https://community.databricks.com/t5/data-engineering/am-trying-to-use-sql-but-createorreplacetempview-quot-mydataview/m-p/27163#M19043</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;You need to convert the pandas DF to an spark DF. Enabling Apache Arrow will make this process faster.&lt;/P&gt;
&lt;P&gt;From &lt;A href="https://docs.databricks.com/spark/latest/spark-sql/spark-pandas.html:" target="test_blank"&gt;https://docs.databricks.com/spark/latest/spark-sql/spark-pandas.html:&lt;/A&gt;&lt;/P&gt;import numpy as np import pandas as pd
&lt;P&gt;&lt;/P&gt; 
&lt;B&gt; Enable Arrow-based columnar data transfers&lt;/B&gt; 
&lt;P&gt;park.conf.set("spark.sql.execution.arrow.enabled", "true")&lt;/P&gt; 
&lt;B&gt; Generate a pandas DataFrame&lt;/B&gt; 
&lt;P&gt;df = pd.DataFrame(np.random.rand(100, 3))&lt;/P&gt; 
&lt;B&gt; Create a Spark DataFrame from a pandas DataFrame using Arrow&lt;/B&gt; 
&lt;P&gt;f = spark.createDataFrame(pdf)&lt;/P&gt; 
&lt;B&gt; Convert the Spark DataFrame back to a pandas DataFrame using Arrow&lt;/B&gt; 
&lt;P&gt;esult_pdf = df.select("*").toPandas() &lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 19:15:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/am-trying-to-use-sql-but-createorreplacetempview-quot-mydataview/m-p/27163#M19043</guid>
      <dc:creator>acorson</dc:creator>
      <dc:date>2020-07-15T19:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Am trying to use SQL, but createOrReplaceTempView("myDataView")​ fails</title>
      <link>https://community.databricks.com/t5/data-engineering/am-trying-to-use-sql-but-createorreplacetempview-quot-mydataview/m-p/27164#M19044</link>
      <description>&lt;P&gt;This is worked for me. Thank you @acorson​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 17:10:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/am-trying-to-use-sql-but-createorreplacetempview-quot-mydataview/m-p/27164#M19044</guid>
      <dc:creator>sachinthana</dc:creator>
      <dc:date>2021-07-01T17:10:37Z</dc:date>
    </item>
  </channel>
</rss>

