Lars Volker has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11575 )

Change subject: IMPALA-6964: Track stats about column and page sizes in Parquet 
reader
......................................................................


Patch Set 16:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11575/16/tests/util/counters.py
File tests/util/counters.py:

http://gerrit.cloudera.org:8080/#/c/11575/16/tests/util/counters.py@19
PS16, Line 19: class SummaryStatsCounter(object):
Yeah, looks like the backend tests use the text profile in many places and we 
should rather revisit that in a future change.

> If we want to stick with the text profile, we should have a namedtuple + an 
> is_empty(counter) method where we need it

Namedtuples are tuples with names for their fields: 
https://docs.python.org/2/library/collections.html#collections.namedtuple

Using TSummaryStatsCounter instead is also good.

Then I'd just have a helper method in test scanners, right where you need it:

  def counter_is_zero(c):
    return c.max == c.min == c.avg == c.samples == 0

You could even go that with a lambda:

  counter_is_zero = lambda c: x.max == c.min == c.avg == c.samples

That does the trick in a single line and looks readable enough to me.



--
To view, visit http://gerrit.cloudera.org:8080/11575
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I322f9b324b6828df28e5caf79529085c43d7c817
Gerrit-Change-Number: 11575
Gerrit-PatchSet: 16
Gerrit-Owner: Sahil Takiar <stak...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Lars Volker <l...@cloudera.com>
Gerrit-Reviewer: Sahil Takiar <stak...@cloudera.com>
Gerrit-Comment-Date: Wed, 09 Jan 2019 22:18:48 +0000
Gerrit-HasComments: Yes

Reply via email to