Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PARQUET-1749: Use Java 8 Streams for Empty PrimitiveIterator #734

Merged
merged 1 commit into from
Jan 26, 2020

Conversation

belugabehr
Copy link
Contributor

Make sure you have checked all steps below.

Jira

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

Commits

  • My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain Javadoc that explain what it does

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM:

MacBook-Pro-van-Fokko:~ fokkodriesprong$ scala
Welcome to Scala 2.13.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_172).
Type in expressions for evaluation. Or try :help.

scala> import java.util.stream.IntStream
import java.util.stream.IntStream

scala> val EMPTY = IntStream.empty().iterator();
EMPTY: java.util.PrimitiveIterator.OfInt = java.util.Spliterators$2Adapter@9d3c67

scala> EMPTY.next()
java.util.NoSuchElementException
  at java.util.Spliterators$2Adapter.nextInt(Spliterators.java:733)
  at java.util.PrimitiveIterator$OfInt.next(PrimitiveIterator.java:128)
  ... 28 elided

scala> EMPTY.hasNext()
res5: Boolean = false

@belugabehr
Copy link
Contributor Author

@Fokko Thanks for posting the reproduction. I appreciate your extra effort.

@Fokko Fokko merged commit 438cb3c into apache:master Jan 26, 2020
shangxinli pushed a commit to shangxinli/parquet-mr that referenced this pull request Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants