You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by Jeff Zhang <zj...@gmail.com> on 2016/07/15 04:55:17 UTC

print is mandatory for print out in pyspark interpreter ?

It is weird to me that I have to use print to get the output. Is it by
design or bug ? The behavior is strange to me as in jupyter user don't need
to use print.

e.g.

%pyspark

# no output
sc.parallelize(range(1, 10)).sum())

# output is printed
print(sc.parallelize(range(1, 10)).sum())

45


-- 
Best Regards

Jeff Zhang

Re: print is mandatory for print out in pyspark interpreter ?

Posted by Jeff Zhang <zj...@gmail.com>.
Thanks, create https://issues.apache.org/jira/browse/ZEPPELIN-1197



On Sun, Jul 17, 2016 at 11:40 AM, Jonathan Kelly <jo...@gmail.com>
wrote:

> +1
>
> On Sat, Jul 16, 2016 at 1:57 PM moon soo Lee <mo...@apache.org> wrote:
>
>> Original implementation of pyspark interpreter printed output without
>> print().
>> But the behavior changed since
>> https://github.com/apache/zeppelin/commit/956e3f74a1b2f28fd8caa25055e77f687ca8d211
>>
>> I also prefer to get output without print(). and i think it's very
>> natural behavior in any REPL. So, if we can bring behavior back that would
>> be great.
>>
>> Best,
>> moon
>>
>> On Fri, Jul 15, 2016 at 1:55 PM Jeff Zhang <zj...@gmail.com> wrote:
>>
>>> It is weird to me that I have to use print to get the output. Is it by
>>> design or bug ? The behavior is strange to me as in jupyter user don't need
>>> to use print.
>>>
>>> e.g.
>>>
>>> %pyspark
>>>
>>> # no output
>>> sc.parallelize(range(1, 10)).sum())
>>>
>>> # output is printed
>>> print(sc.parallelize(range(1, 10)).sum())
>>>
>>> 45
>>>
>>>
>>> --
>>> Best Regards
>>>
>>> Jeff Zhang
>>>
>>


-- 
Best Regards

Jeff Zhang

Re: print is mandatory for print out in pyspark interpreter ?

Posted by Jonathan Kelly <jo...@gmail.com>.
+1
On Sat, Jul 16, 2016 at 1:57 PM moon soo Lee <mo...@apache.org> wrote:

> Original implementation of pyspark interpreter printed output without
> print().
> But the behavior changed since
> https://github.com/apache/zeppelin/commit/956e3f74a1b2f28fd8caa25055e77f687ca8d211
>
> I also prefer to get output without print(). and i think it's very natural
> behavior in any REPL. So, if we can bring behavior back that would be great.
>
> Best,
> moon
>
> On Fri, Jul 15, 2016 at 1:55 PM Jeff Zhang <zj...@gmail.com> wrote:
>
>> It is weird to me that I have to use print to get the output. Is it by
>> design or bug ? The behavior is strange to me as in jupyter user don't need
>> to use print.
>>
>> e.g.
>>
>> %pyspark
>>
>> # no output
>> sc.parallelize(range(1, 10)).sum())
>>
>> # output is printed
>> print(sc.parallelize(range(1, 10)).sum())
>>
>> 45
>>
>>
>> --
>> Best Regards
>>
>> Jeff Zhang
>>
>

Re: print is mandatory for print out in pyspark interpreter ?

Posted by moon soo Lee <mo...@apache.org>.
Original implementation of pyspark interpreter printed output without
print().
But the behavior changed since
https://github.com/apache/zeppelin/commit/956e3f74a1b2f28fd8caa25055e77f687ca8d211

I also prefer to get output without print(). and i think it's very natural
behavior in any REPL. So, if we can bring behavior back that would be great.

Best,
moon

On Fri, Jul 15, 2016 at 1:55 PM Jeff Zhang <zj...@gmail.com> wrote:

> It is weird to me that I have to use print to get the output. Is it by
> design or bug ? The behavior is strange to me as in jupyter user don't need
> to use print.
>
> e.g.
>
> %pyspark
>
> # no output
> sc.parallelize(range(1, 10)).sum())
>
> # output is printed
> print(sc.parallelize(range(1, 10)).sum())
>
> 45
>
>
> --
> Best Regards
>
> Jeff Zhang
>