Skip to content

Instantly share code, notes, and snippets.

@qqibrow
Created July 25, 2017 23:33
Show Gist options
  • Save qqibrow/833be45e8707b0535e5ae4e3074ff11d to your computer and use it in GitHub Desktop.
Save qqibrow/833be45e8707b0535e5ae4e3074ff11d to your computer and use it in GitHub Desktop.
158 explain plan
"Fragment 0 [SINGLE]
Output layout: [simplified_shape, expr_22, count]
Output partitioning: SINGLE []
- Output[simplified_shape, CashRate, Trips] => [simplified_shape:varchar, expr_22:double, count:bigint]
CashRate := expr_22
Trips := count
- RemoteSource[1] => [simplified_shape:varchar, expr_22:double, count:bigint]
Fragment 1 [HASH]
Output layout: [simplified_shape, expr_22, count]
Output partitioning: SINGLE []
- Project => [simplified_shape:varchar, expr_22:double, count:bigint]
expr_22 := ((1.0 * CAST(""expr_16"" AS double)) / CAST(""expr_17"" AS double))
- Aggregate(FINAL)[simplified_shape][$hashvalue] => [simplified_shape:varchar, $hashvalue:bigint, expr_16:bigint, count:bigint, expr_17:bigint]
expr_16 := ""sum""(""sum_34"")
count := ""count""(""count_36"")
expr_17 := ""count""(""count_35"")
- LocalExchange[HASH][$hashvalue] (""simplified_shape"") => simplified_shape:varchar, count_36:bigint, count_35:bigint, sum_34:bigint, $hashvalue:bigint
- RemoteSource[2] => [simplified_shape:varchar, count_36:bigint, count_35:bigint, sum_34:bigint, $hashvalue_37:bigint]
Fragment 2 [SOURCE]
Output layout: [simplified_shape, count_36, count_35, sum_34, $hashvalue_38]
Output partitioning: HASH [simplified_shape][$hashvalue_38]
- Aggregate(PARTIAL)[simplified_shape][$hashvalue_38] => [simplified_shape:varchar, $hashvalue_38:bigint, count_36:bigint, count_35:bigint, sum_34:bigint]
count_36 := ""count""(*)
count_35 := ""count""(*)
sum_34 := ""sum""(""expr_12"")
- Project => [simplified_shape:varchar, $hashvalue_38:bigint, expr_12:bigint]
$hashvalue_38 := ""combine_hash""(BIGINT '0', COALESCE(""$operator$hash_code""(""simplified_shape""), 0))
expr_12 := CAST((CASE WHEN (""is_cash_trip"" = true) THEN 1 ELSE 0 END) AS bigint)
- Filter[""st_contains""(""simplified_shape"", ""request_point"")] => [is_cash_trip:boolean, request_point:varbinary, simplified_shape:varchar]
- CrossJoin => [is_cash_trip:boolean, request_point:varbinary, simplified_shape:varchar]
- Project => [is_cash_trip:boolean, request_point:varbinary]
- Filter[((""city_id"" = BIGINT '204') AND ((CAST(""begintrip_timestamp_local"" AS date) = ""$literal$date""(BIGINT '17357')) AND (""is_completed"" = true)))] => [city_id:bigint, request_point:varbinary, begintrip_timestamp_local:timestamp, is_completed:boolean, is_cash_trip:boolean]
- TableScan[hive:hive:dwh:fact_trip, originalConstraint = (((CAST(""begintrip_timestamp_local"" AS date) = ""$literal$date""(BIGINT '17357')) AND (""datestr"" = CAST('2017-07-10' AS varchar))) AND ((true = ""is_completed"") AND (BIGINT '204' = ""city_id"")))] => [city_id:bigint, request_point:varbinary, begintrip_timestamp_local:timestamp, is_completed:boolean, is_cash_trip:boolean]
LAYOUT: hive
city_id := HiveColumnHandle{clientId=hive, name=city_id, hiveType=bigint, hiveColumnIndex=5, columnType=REGULAR}
request_point := HiveColumnHandle{clientId=hive, name=request_point, hiveType=binary, hiveColumnIndex=23, columnType=REGULAR}
begintrip_timestamp_local := HiveColumnHandle{clientId=hive, name=begintrip_timestamp_local, hiveType=timestamp, hiveColumnIndex=25, columnType=REGULAR}
is_completed := HiveColumnHandle{clientId=hive, name=is_completed, hiveType=boolean, hiveColumnIndex=51, columnType=REGULAR}
is_cash_trip := HiveColumnHandle{clientId=hive, name=is_cash_trip, hiveType=boolean, hiveColumnIndex=54, columnType=REGULAR}
HiveColumnHandle{clientId=hive, name=datestr, hiveType=string, hiveColumnIndex=-1, columnType=PARTITION_KEY}
:: [[2017-07-10]]
- RemoteSource[3] => [simplified_shape:varchar]
Fragment 3 [SOURCE]
Output layout: [simplified_shape]
Output partitioning: BROADCAST []
- Project => [simplified_shape:varchar]
- Filter[(""geo_uuid"" IN ('125c7767-a4a9-409d-8eb8-ad81864b1087', '157fa16d-585c-4b20-b2b7-752983b7c498', '17e4bc4f-f60c-42a5-ac71-c8eeded95fa2', '19ae9b3a-3c3c-4a6a-82fd-93983bdff5a9', '1a155ca4-670c-454e-a671-0f01ae87b12e', '29a95999-8c0e-40f1-9f5c-65e3e68c6041', '45b481e6-17c9-49b4-9b61-4384c312da05', '47c79d04-fc74-4dee-a121-dd57bbd0a4ac', '5b2861c4-73aa-48e6-bc64-f2c0ffea9266', '62369526-597a-47f8-9fd2-8224f1a5d309', '670d84ae-0c30-40dc-a3c1-077bc7aacadb', '79e27cf1-eaae-459d-a32d-16cb29f68ab1', '93ab398c-4701-45eb-ab47-18fcaf801b65', 'bdb90883-7334-473d-98d4-7a9c01e50f10', 'c3689129-7e14-4e0c-8b28-b647ea360897', 'c378eaa8-20fe-46d8-89d0-6516f2e1d786', 'cc6dd23f-311a-464d-b8bd-c693758392e2', 'e102664b-cc52-44b9-8f07-5e345f46db10', 'ee87fa90-9a31-44df-84f3-eb16f4853d5b', 'f97be38e-cf8a-4ac3-a1fe-4f53e88a0977'))] => [geo_uuid:varchar(36), simplified_shape:varchar]
- TableScan[hive:hive:map_services:geofences_all, originalConstraint = (""geo_uuid"" IN ('93ab398c-4701-45eb-ab47-18fcaf801b65', '19ae9b3a-3c3c-4a6a-82fd-93983bdff5a9', 'c3689129-7e14-4e0c-8b28-b647ea360897', '125c7767-a4a9-409d-8eb8-ad81864b1087', '45b481e6-17c9-49b4-9b61-4384c312da05', 'f97be38e-cf8a-4ac3-a1fe-4f53e88a0977', '17e4bc4f-f60c-42a5-ac71-c8eeded95fa2', 'c378eaa8-20fe-46d8-89d0-6516f2e1d786', 'e102664b-cc52-44b9-8f07-5e345f46db10', '79e27cf1-eaae-459d-a32d-16cb29f68ab1', 'bdb90883-7334-473d-98d4-7a9c01e50f10', '62369526-597a-47f8-9fd2-8224f1a5d309', 'cc6dd23f-311a-464d-b8bd-c693758392e2', '670d84ae-0c30-40dc-a3c1-077bc7aacadb', '47c79d04-fc74-4dee-a121-dd57bbd0a4ac', '29a95999-8c0e-40f1-9f5c-65e3e68c6041', 'ee87fa90-9a31-44df-84f3-eb16f4853d5b', '1a155ca4-670c-454e-a671-0f01ae87b12e', '157fa16d-585c-4b20-b2b7-752983b7c498', '5b2861c4-73aa-48e6-bc64-f2c0ffea9266'))] => [geo_uuid:varchar(36), simplified_shape:varchar]
LAYOUT: hive
geo_uuid := HiveColumnHandle{clientId=hive, name=geo_uuid, hiveType=varchar(36), hiveColumnIndex=0, columnType=REGULAR}
simplified_shape := HiveColumnHandle{clientId=hive, name=simplified_shape, hiveType=string, hiveColumnIndex=5, columnType=REGULAR}
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment