facebook/presto — pull request #911 by erichwang (2013-12-17 00:48:40+00:00)
Title: Add a summarized print of TableScanNode TupleDomain to cut down on logging size

Formatting:

Where there are a small number of range segments:

presto> explain SELECT ds, id, COUNT(1) AS count FROM table WHERE ds >= '2013-11-15' AND (type='A' OR type='B') GROUP BY ds, id;

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Output[ds, id, count]
id := id
count := count
- Aggregate[ds, id] => [ds:varchar, id:varchar, count:bigint]
count := count("expr")
- Project => [ds:varchar, id:varchar, expr:bigint]
expr := 1
- TableScan[default:default:table, original constrant=(("ds" >= '2013-11-15') AND (("type" = 'A') OR ("type" = 'B'))), domain={ds => Domain{ranges=[[2013-11-15], [2013-11-16], [2013-11-17], [2013-11-18], [2013-11-19], [2013-11-20]], nullAllowed=false}, type => Domain{ranges=[[A], [B]], nullAllowed=false}}] => [id:varchar, ds:varchar]
id := HiveColumnHandle{clientId=default, name=id, ordinalPosition=1, hiveType=STRING, hiveColumnIndex=6, partitionKey=false}
ds := HiveColumnHandle{clientId=default, name=ds, ordinalPosition=2, hiveType=STRING, hiveColumnIndex=-1, partitionKey=true}
type := HiveColumnHandle{clientId=default, name=type, ordinalPosition=3, hiveType=STRING, hiveColumnIndex=-1, partitionKey=true}

(1 row)

When there are a large number of range segments:

presto> explain SELECT ds, id, COUNT(1) AS count FROM table WHERE ds >= '2012-11-15' AND (type='A' OR type='B') GROUP BY ds, id;
Query Plan
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Output[ds, id, count]
id := id
count := count
- Aggregate[ds, id] => [ds:varchar, id:varchar, count:bigint]
count := count("expr")
- Project => [ds:varchar, id:varchar, expr:bigint]
expr := 1
- TableScan[default:default:table, original constrant=(("ds" >= '2012-11-15') AND (("type" = 'A') OR ("type" = 'B'))), domain={ds => Summarized:Domain{ranges=[[2013-08-04, 2013-12-15]], nullAllowed=false}, type => Domain{ranges=[[A], [B]], nullAllowed=false}}] => [id:varchar, ds:varchar]
id := HiveColumnHandle{clientId=default, name=id, ordinalPosition=1, hiveType=STRING, hiveColumnIndex=1, partitionKey=false}
ds := HiveColumnHandle{clientId=default, name=ds, ordinalPosition=2, hiveType=STRING, hiveColumnIndex=-1, partitionKey=true}
type := HiveColumnHandle{clientId=default, name=type, ordinalPosition=3, hiveType=STRING, hiveColumnIndex=-1, partitionKey=true}

(1 row)