[jira] [Commented] (TINKERPOP-1211) UnfoldStep should unfold arrays.

2016-11-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15636205#comment-15636205
 ] 

ASF GitHub Bot commented on TINKERPOP-1211:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/475#discussion_r86534725
  
--- Diff: CHANGELOG.asciidoc ---
@@ -26,6 +26,7 @@ 
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~
 
+* `UnfoldStep` now supports unfolding of arrays. (*breaking*)
--- End diff --

I don't really like the use of "breaking" in the CHANGELOG for our manual 
entries. The JIRA ticket will have that when we generate that list on release.  
Also, we've not done that consistently from the start of CHANGELOG. If 
something is "breaking" the better way to call attention to it is in the 
upgrade docs where we can better describe and demonstrate the change for users 
rather than a single one-liner in CHANGELOG.


> UnfoldStep should unfold arrays.
> 
>
> Key: TINKERPOP-1211
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1211
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.1.1-incubating
>Reporter: Marko A. Rodriguez
>Assignee: Marko A. Rodriguez
>  Labels: breaking
> Fix For: 3.3.0
>
>
> Currently {{UnfoldStep}} does not unfold arrays as an array does not 
> implement {{Iterable}} or {{Iterator}}. We simply need to check if the 
> current object is an array, and if so, set the flatMap-iterator to 
> {{ArrayIterator}}.
> This would be breaking, but I doubt anyone ever uses arrays or would find 
> this a problem. I'm sure anyone who wanted to {{unfold}} an array was like: 
> "wha?"



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


[jira] [Commented] (TINKERPOP-1211) UnfoldStep should unfold arrays.

2016-11-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15636166#comment-15636166
 ] 

ASF GitHub Bot commented on TINKERPOP-1211:
---

Github user asfgit closed the pull request at:

https://github.com/apache/tinkerpop/pull/475


> UnfoldStep should unfold arrays.
> 
>
> Key: TINKERPOP-1211
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1211
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.1.1-incubating
>Reporter: Marko A. Rodriguez
>  Labels: breaking
> Fix For: 3.3.0
>
>
> Currently {{UnfoldStep}} does not unfold arrays as an array does not 
> implement {{Iterable}} or {{Iterator}}. We simply need to check if the 
> current object is an array, and if so, set the flatMap-iterator to 
> {{ArrayIterator}}.
> This would be breaking, but I doubt anyone ever uses arrays or would find 
> this a problem. I'm sure anyone who wanted to {{unfold}} an array was like: 
> "wha?"



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


[jira] [Commented] (TINKERPOP-1211) UnfoldStep should unfold arrays.

2016-11-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15626914#comment-15626914
 ] 

ASF GitHub Bot commented on TINKERPOP-1211:
---

Github user twilmes commented on the issue:

https://github.com/apache/tinkerpop/pull/475
  
I grabbed the latest commit and things checked out.  Looks good.

VOTE: +1


> UnfoldStep should unfold arrays.
> 
>
> Key: TINKERPOP-1211
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1211
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.1.1-incubating
>Reporter: Marko A. Rodriguez
>  Labels: breaking
>
> Currently {{UnfoldStep}} does not unfold arrays as an array does not 
> implement {{Iterable}} or {{Iterator}}. We simply need to check if the 
> current object is an array, and if so, set the flatMap-iterator to 
> {{ArrayIterator}}.
> This would be breaking, but I doubt anyone ever uses arrays or would find 
> this a problem. I'm sure anyone who wanted to {{unfold}} an array was like: 
> "wha?"



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


[jira] [Commented] (TINKERPOP-1211) UnfoldStep should unfold arrays.

2016-11-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15626693#comment-15626693
 ] 

ASF GitHub Bot commented on TINKERPOP-1211:
---

Github user twilmes commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/475#discussion_r86026558
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/UnfoldStep.java
 ---
@@ -46,6 +47,8 @@ else if (s instanceof Iterable)
 return ((Iterable) s).iterator();
 else if (s instanceof Map)
 return ((Map) s).entrySet().iterator();
+else if (s.getClass().isArray())
+return new ArrayIterator((Object[])s);
--- End diff --

This cast will fail if the incoming array is an array of primitives.  I 
think you could do something like this which is short and to the point but 
creates an intermediate, albeit short-lived list.
`return (Iterator)Arrays.asList(s).iterator();`

I was able to reproduce the issue when I nested a primitive array inside of 
a list.  Calling `unfold` twice looks a little silly but maybe someone would do 
this if they were dealing with nested collections.

```
gremlin> __.inject([0, 1, 2, [3, 4] as int[]]).unfold().unfold()
==>0
==>1
==>2
[I cannot be cast to [Ljava.lang.Object;
Type ':help' or ':h' for help.
Display stack trace? [yN]n
gremlin> __.inject([0, 1, 2, [3, 4]]).unfold().unfold()
==>0
==>1
==>2
==>3
==>4
```


> UnfoldStep should unfold arrays.
> 
>
> Key: TINKERPOP-1211
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1211
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.1.1-incubating
>Reporter: Marko A. Rodriguez
>  Labels: breaking
>
> Currently {{UnfoldStep}} does not unfold arrays as an array does not 
> implement {{Iterable}} or {{Iterator}}. We simply need to check if the 
> current object is an array, and if so, set the flatMap-iterator to 
> {{ArrayIterator}}.
> This would be breaking, but I doubt anyone ever uses arrays or would find 
> this a problem. I'm sure anyone who wanted to {{unfold}} an array was like: 
> "wha?"



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


[jira] [Commented] (TINKERPOP-1211) UnfoldStep should unfold arrays.

2016-11-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15626225#comment-15626225
 ] 

ASF GitHub Bot commented on TINKERPOP-1211:
---

GitHub user okram opened a pull request:

https://github.com/apache/tinkerpop/pull/475

TINKERPOP-1211: UnfoldStep should unfold arrays.

https://issues.apache.org/jira/browse/TINKERPOP-1211

Unfold step now handles unfolding of arrays.

VOTE +1.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1211

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/475.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #475






> UnfoldStep should unfold arrays.
> 
>
> Key: TINKERPOP-1211
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1211
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.1.1-incubating
>Reporter: Marko A. Rodriguez
>  Labels: breaking
>
> Currently {{UnfoldStep}} does not unfold arrays as an array does not 
> implement {{Iterable}} or {{Iterator}}. We simply need to check if the 
> current object is an array, and if so, set the flatMap-iterator to 
> {{ArrayIterator}}.
> This would be breaking, but I doubt anyone ever uses arrays or would find 
> this a problem. I'm sure anyone who wanted to {{unfold}} an array was like: 
> "wha?"



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