Github user nongli commented on the pull request:
https://github.com/apache/spark/pull/10735#issuecomment-171731955
/* 007 */
/* 008 */ private Expression[] expressions;
/* 009 */ private boolean initRange0;
/* 010 */ private long partitionEnd1;
/* 011 */ private long number2;
/* 012 */ private boolean overflow3;
/* 013 */ private UnsafeRow unsafeRow = new UnsafeRow(0);
--> Do we need this? Seems we can just make the super class one protected.
/* 014 */
/* 015 */ public GeneratedIterator(Expression[] exprs) {
/* 016 */ expressions = exprs;
/* 017 */ initRange0 = false;
/* 018 */ partitionEnd1 = 0L;
/* 019 */ number2 = 0L;
/* 020 */ overflow3 = false;
/* 021 */ }
/* 022 */
/* 023 */ protected void processNext() {
/* 024 */
-- Can we split this section out? Prepare()/Open(). It's annoying to do
this check every next. The check is probably cheap but it bloats the function
size and having more structure I think makes it easy to understand.
/* 025 */ if (!initRange0) {
/* 026 */ if (input.hasNext()) {
/* 027 */ // number2 and partitionEnd1
/* 051 */ } else {
/* 052 */ return;
/* 053 */ }
/* 054 */ initRange0 = true;
/* 055 */ }
/* 056 */
Can we do better with variable naming? It might be nicer if it was prefixed
with the operator it came from. This is going to be hard to reason about.
/* 057 */ while (!overflow3 && number2 < partitionEnd1) {
/* 058 */ long value4 = number2;
/* 059 */ number2 += 1L;
/* 060 */ if (number2 < value4 ^ 1L < 0) {
/* 061 */ overflow3 = true;
/* 062 */ }
/* 063 */
/* 070 */ long primitive8 = -1L;
/* 071 */ primitive8 = value4 & 1L;
/* 074 */ boolean primitive6 = false;
/* 075 */ primitive6 = primitive8 == 1L;
/* 076 */ if (!false && primitive6) {
/* 081 */ currentRow = unsafeRow;
/* 082 */ return;
/* 085 */ }
/* 087 */ }
/* 089 */ }
*/
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]