[crush-tools] r523 committed - Fix some example code that referenced a deprecated binary....

2 views
Skip to first unread message

crush...@googlecode.com

unread,
Nov 8, 2012, 3:47:59 PM11/8/12
to crush...@googlegroups.com
Revision: 523
Author: jeremy...@gmail.com
Date: Thu Nov 8 12:47:36 2012
Log: Fix some example code that referenced a deprecated binary.

Issue 19
Reported by: mtrojanovich

http://code.google.com/p/crush-tools/source/detail?r=523

Modified:
/trunk/src/aggregate/example.html
/trunk/src/funiq/example.html
/trunk/src/grepfield/example.html
/trunk/src/mergekeys/example.html
/trunk/src/pivot/example.html
/trunk/src/reorder/example.html
/trunk/src/subtotal/example.html

=======================================
--- /trunk/src/aggregate/example.html Thu Jun 19 21:54:11 2008
+++ /trunk/src/aggregate/example.html Thu Nov 8 12:47:36 2012
@@ -2,7 +2,7 @@
# assume that columns 4 and 8 are advertiser-id and ad-id, respectively,
and
# column 2 is user-id, columns 14 and 15 are quantity and revenue

-<a href="gzdog.html">gzdog</a> Activity_123456_10-31-2005.log.gz |
+<a href="zcat.html">zcat</a> Activity_123456_10-31-2005.log.gz |
<b>aggregate</b> -k 4,8 -p -c 2 -s 14,15 &gt; 2005-10-31.log

# 2005-10-31.log now contains advertiser-id, ad-id, the number of users,
and
=======================================
--- /trunk/src/funiq/example.html Thu Jun 19 21:54:11 2008
+++ /trunk/src/funiq/example.html Thu Nov 8 12:47:36 2012
@@ -1,7 +1,8 @@
# deduplicate an impression file to get only the last impression of the day
-# per user
-<a href="gzdog.html">gzdog</a> Impression_123456_10-31-2005.log.gz |
+# per user (Time in field 1, User-ID in field 2)
+
+<a href="zcat.html">zcat</a> Impression_123456_10-31-2005.log.gz |
(read header; echo $header; \
sort -k 2,2 -k 1r,1r -t `<a href="tochar.html">tochar</a> 0xfe`) |
- <b>funiq</b> -d `<a href="tochar.html">tochar</a> 0xfe` -f 2 >
2005-10-31.log
+ <b>funiq</b> -d `<a href="tochar.html">tochar</a> 0xfe` -f 2 &gt;
2005-10-31.log

=======================================
--- /trunk/src/grepfield/example.html Thu Jun 19 21:54:11 2008
+++ /trunk/src/grepfield/example.html Thu Nov 8 12:47:36 2012
@@ -5,7 +5,7 @@
delim=`<a
href="bash_functions.html#get_header_delim">get_header_delim</a> "$header"`
event_id_index=`<a
href="bash_functions.html#get_header_index">get_header_index</a> "Event-ID" "$header" "$delim"`

-<a href="gzdog.html">gzdog</a> $dtfile |
+<a href="zcat.html">zcat</a> $dtfile |
<b>grepfield</b> -f $event_id_index '[12]' \
> $wdir/tmp/$$_matched_activities.log

=======================================
--- /trunk/src/mergekeys/example.html Thu Jun 19 21:54:11 2008
+++ /trunk/src/mergekeys/example.html Thu Nov 8 12:47:36 2012
@@ -1,25 +1,23 @@

-# merges impressions and clicks from the db for a given site with the
+# merges impressions and clicks from a db for a given site with the
# conversion numbers from data transfer

# file delimiter
-d=`<a href="tochar.html">tochar</a> 0xfe`
+export DELIMITER=`<a href="tochar.html">tochar</a> 0xfe`

-# create headers for db results, using the dt-style header for Site-ID
-echo "Site-ID${d}Impressions${d}Clicks" &gt; $wdir/tmp/site_delivery.log
-
-DB_DSN=$SPUR_DSN <a href="dbstream.html">dbstream</a> -s \
- "select site_id, sum(metric_a), sum(metric_b) \
- from dfa_performance \
+DB_DSN=$SPUR_DSN <a href="dbstream.html">dbstream</a> -H -s \
+ 'select site_id "Site-ID",
+ sum(impressions) "Impressions",
+ sum(clicks) "Clicks" \
+ from fact_table \
where advertiser_id = 123456 \
and event_date = '01-JAN-29' \
- and event_type_id = 1 \
group by site_id \
order by site_id" \
&gt;&gt; $wdir/tmp/site_delivery.log

# assume Site-ID is field 8, Quantity is field 12
-<a href="gzdog.html">gzdog</a> $dt_dir/Activity_123456_01-01-2029.log.gz |
+<a href="zcat.html">zcat</a> $dt_dir/Activity_123456_01-01-2029.log.gz |
<a href="aggregate.html">aggregate</a> -p -k 8 -s 12 &gt;
$wdir/tmp/dt_conversions.log

<b>mergekeys</b> -o $wdir/tmp/imps_clicks_conversions.log
$wdir/tmp/site_delivery.log $wdir/tmp/dt_conversions.log
=======================================
--- /trunk/src/pivot/example.html Thu Jun 19 21:54:11 2008
+++ /trunk/src/pivot/example.html Thu Nov 8 12:47:36 2012
@@ -2,11 +2,11 @@
# this example keeps the ad-id field in place, and pivots the spot type
and cat fields
# into column headers, putting the quantity and revenue values under them.

-<a href="gzdog.html">gzdog</a>
NetworkActivity_3784_1233616_07-13-2006.log.gz |
+<a href="zcat.html">zcat</a> Activity_123456_07-13-2006.log.gz |
<b>pivot</b> -f 6 -p 18,19 -v 20,21 -k |
<a href="csvformat.html">csvformat</a>

-"Ad-ID","btedu202 - freer571: Quantity","btedu202 - freer571:
Revenue","btedu202 - homep803: Quantity","btedu202 - homep803:
Revenue","btedu202 - prima021: Quantity","btedu202 - prima021:
Revenue","btedu202 - searc686: Quantity","btedu202 - searc686:
Revenue","btedu202 - secon053: Quantity","btedu202 - secon053: Revenue"
+"Ad-ID","type0 - cat0: Quantity","type0 - cat0: Revenue","type0 - cat1:
Quantity","type0 - cat1: Revenue","type0 - cat2: Quantity","type0 - cat2:
Revenue","type0 - cat3: Quantity","type0 - cat3: Revenue","type0 - cat4:
Quantity","type0 - cat4: Revenue"
"","95","0.00","1088","0.00","54","0.00","81","0.00","44","0.00"
"39113739","0","0.00","2","0.00","1","0.00","1","0.00","1","0.00"
"39114031","0","0.00","1","0.00","0","0.00","0","0.00","0","0.00"
=======================================
--- /trunk/src/reorder/example.html Thu Jun 19 21:54:11 2008
+++ /trunk/src/reorder/example.html Thu Nov 8 12:47:36 2012
@@ -1,3 +1,3 @@
-<a href="gzdog.html">gzdog</a> $dtfile |
+<a href="zcat.html">zcat</a> $dtfile |
<b>reorder</b> -f 3-4,1 -d `<a href="tochar.html">tochar</a> 0xfe` \
&lt; $wdir/tmp/$$_tmpfile.log
=======================================
--- /trunk/src/subtotal/example.html Thu Jun 19 21:54:11 2008
+++ /trunk/src/subtotal/example.html Thu Nov 8 12:47:36 2012
@@ -5,7 +5,7 @@
# this command aggregates on those fields and inserts lines subtotaling
quantity
# and revenue for each distinct campaign id

-<a href="gzdog.html">gzdog</a> $dtfile |
+<a href="zcat.html">zcat</a> $dtfile |
<a href="aggregate.html">aggregate</a> -p -k 4-6 -s 15,16 |
<b>subtotal</b> -k 2 -s 4,5 -l 2

Reply all
Reply to author
Forward
0 new messages