[jira] [Commented] (FLINK-4794) partition_by_hash() crashes if no parameter is provided

2016-10-11 Thread Yakov Goldberg (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15566067#comment-15566067
 ] 

Yakov Goldberg commented on FLINK-4794:
---

So need to add proper error message to partition_by_hash()

> partition_by_hash() crashes if no parameter is provided
> ---
>
> Key: FLINK-4794
> URL: https://issues.apache.org/jira/browse/FLINK-4794
> Project: Flink
>  Issue Type: Bug
>  Components: Python API
>Reporter: Yakov Goldberg
>
> partition_by_hash() crashes if no parameter is provided.
> Looks like a line of code was missed, check distinct()
> def distinct(self, *fields): 
> f = None 
> if len(fields) == 0: 
> f = lambda x: (x,) 
> fields = (0,) 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4794) partition_by_hash() crashes if no parameter is provided

2016-10-11 Thread Chesnay Schepler (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15566057#comment-15566057
 ] 

Chesnay Schepler commented on FLINK-4794:
-

that is a bug and should be changed.

> partition_by_hash() crashes if no parameter is provided
> ---
>
> Key: FLINK-4794
> URL: https://issues.apache.org/jira/browse/FLINK-4794
> Project: Flink
>  Issue Type: Bug
>  Components: Python API
>Reporter: Yakov Goldberg
>
> partition_by_hash() crashes if no parameter is provided.
> Looks like a line of code was missed, check distinct()
> def distinct(self, *fields): 
> f = None 
> if len(fields) == 0: 
> f = lambda x: (x,) 
> fields = (0,) 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4794) partition_by_hash() crashes if no parameter is provided

2016-10-11 Thread Yakov Goldberg (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15566054#comment-15566054
 ] 

Yakov Goldberg commented on FLINK-4794:
---

Error message when using partition_by_hash() with no parameter
Traceback (most recent call last):
  File "/tmp/flink_plan-299738636/plan.py", line 382, in 
dd24 \
  File "/tmp/flink_plan-299738636/flink/plan/DataSet.py", line 505, in 
partition_by_hash
if isinstance(fields[0], TYPES.FunctionType):
IndexError: tuple index out of range

> partition_by_hash() crashes if no parameter is provided
> ---
>
> Key: FLINK-4794
> URL: https://issues.apache.org/jira/browse/FLINK-4794
> Project: Flink
>  Issue Type: Bug
>  Components: Python API
>Reporter: Yakov Goldberg
>
> partition_by_hash() crashes if no parameter is provided.
> Looks like a line of code was missed, check distinct()
> def distinct(self, *fields): 
> f = None 
> if len(fields) == 0: 
> f = lambda x: (x,) 
> fields = (0,) 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4794) partition_by_hash() crashes if no parameter is provided

2016-10-11 Thread Yakov Goldberg (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15566036#comment-15566036
 ] 

Yakov Goldberg commented on FLINK-4794:
---

Going to add error message.
But in distinct(), if no parameter is passed, parameter enforced to be 0.

> partition_by_hash() crashes if no parameter is provided
> ---
>
> Key: FLINK-4794
> URL: https://issues.apache.org/jira/browse/FLINK-4794
> Project: Flink
>  Issue Type: Bug
>  Components: Python API
>Reporter: Yakov Goldberg
>
> partition_by_hash() crashes if no parameter is provided.
> Looks like a line of code was missed, check distinct()
> def distinct(self, *fields): 
> f = None 
> if len(fields) == 0: 
> f = lambda x: (x,) 
> fields = (0,) 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4794) partition_by_hash() crashes if no parameter is provided

2016-10-11 Thread Chesnay Schepler (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15564802#comment-15564802
 ] 

Chesnay Schepler commented on FLINK-4794:
-

This is intended, assuming the appropriate java exception is thrown. The error 
message would be helpful.

There is no partition_by_hash function without parameters in the java & scala 
counterparts, if you don't pass a parameter they will throw an exception. And 
this is good; just picking an (effectively arbitrary) field will in many cases 
lead to bad behavior.

> partition_by_hash() crashes if no parameter is provided
> ---
>
> Key: FLINK-4794
> URL: https://issues.apache.org/jira/browse/FLINK-4794
> Project: Flink
>  Issue Type: Bug
>  Components: Python API
>Reporter: Yakov Goldberg
>
> partition_by_hash() crashes if no parameter is provided.
> Looks like a line of code was missed, check distinct()
> def distinct(self, *fields): 
> f = None 
> if len(fields) == 0: 
> f = lambda x: (x,) 
> fields = (0,) 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)