<?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>question Cannot run multiple lines PySpark in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-run-multiple-lines-PySpark/m-p/173277#M58028</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to get through the HANDS-ON TOUR OF APACHE SPARK IN 5 MINUTES tutorial with the python interpreter, but when I try to run multiple columns like this part:&lt;/P&gt;&lt;P&gt; %pyspark&lt;/P&gt;&lt;P&gt;myLines=sc.textFile('hdfs://sandbox.hortonworks.com/tmp/Hortonworks') &lt;/P&gt;&lt;P&gt;myLinesFiltered=myLines.filter(lambdax:len(x)&amp;gt;0)&lt;/P&gt;&lt;P&gt;count=myLinesFiltered.count()&lt;/P&gt;&lt;P&gt;print count&lt;/P&gt;&lt;P&gt;I got syntax error at the end of the second line. If I run it line by line it works fine, but if I try to run two lines, I always get syntax error, no matter what I run.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Zsoka&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2017 17:08:05 GMT</pubDate>
    <dc:creator>zsokaevakovacs</dc:creator>
    <dc:date>2017-03-24T17:08:05Z</dc:date>
    <item>
      <title>Cannot run multiple lines PySpark</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-run-multiple-lines-PySpark/m-p/173277#M58028</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to get through the HANDS-ON TOUR OF APACHE SPARK IN 5 MINUTES tutorial with the python interpreter, but when I try to run multiple columns like this part:&lt;/P&gt;&lt;P&gt; %pyspark&lt;/P&gt;&lt;P&gt;myLines=sc.textFile('hdfs://sandbox.hortonworks.com/tmp/Hortonworks') &lt;/P&gt;&lt;P&gt;myLinesFiltered=myLines.filter(lambdax:len(x)&amp;gt;0)&lt;/P&gt;&lt;P&gt;count=myLinesFiltered.count()&lt;/P&gt;&lt;P&gt;print count&lt;/P&gt;&lt;P&gt;I got syntax error at the end of the second line. If I run it line by line it works fine, but if I try to run two lines, I always get syntax error, no matter what I run.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Zsoka&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 17:08:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-run-multiple-lines-PySpark/m-p/173277#M58028</guid>
      <dc:creator>zsokaevakovacs</dc:creator>
      <dc:date>2017-03-24T17:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot run multiple lines PySpark</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-run-multiple-lines-PySpark/m-p/173278#M58029</link>
      <description>&lt;P&gt;There is an open Apache bug for this:&lt;/P&gt;&lt;P&gt;PySpark Doesn't Support Multi-Line Statements&lt;/P&gt;&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/ZEPPELIN-84" target="_blank"&gt;https://issues.apache.org/jira/browse/ZEPPELIN-84&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 23:23:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-run-multiple-lines-PySpark/m-p/173278#M58029</guid>
      <dc:creator>namaheshwari</dc:creator>
      <dc:date>2017-03-24T23:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot run multiple lines PySpark</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-run-multiple-lines-PySpark/m-p/173279#M58030</link>
      <description>&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/ZEPPELIN-84"&gt;https://issues.apache.org/jira/browse/ZEPPELIN-84&lt;/A&gt; is regarding breaking a statement in multiple lines. &lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/16411/zsokaevakovacs.html" nodeid="16411"&gt;@Zsoka Kovacs&lt;/A&gt;, you should be able to run below paragraph. Do not give extra \n in between and make sure there are no extra chars copied at the end of the line.&lt;/P&gt;&lt;P&gt;{code}&lt;/P&gt;&lt;P&gt;%pyspark&lt;/P&gt;&lt;P&gt;myLines=sc.textFile('/tmp/Hortonworks')&lt;/P&gt;&lt;P&gt;myLinesFiltered=myLines.filter(lambdax:len(x)&amp;gt;0)&lt;/P&gt;&lt;P&gt;count=myLinesFiltered.count()&lt;/P&gt;&lt;P&gt;print count&lt;/P&gt;&lt;P&gt;{code}&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2017 04:59:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-run-multiple-lines-PySpark/m-p/173279#M58030</guid>
      <dc:creator>yvora</dc:creator>
      <dc:date>2017-03-25T04:59:30Z</dc:date>
    </item>
  </channel>
</rss>

