Permalink
Browse files

Updated CutLoadFunc to Pig 0.7.0.

Added a snippet directory for working with book code snippets.
  • Loading branch information...
1 parent 8e7bf60 commit 594cb96b4ed3ead94b6b8e31594df108ff8a13a7 @tomwhite committed Jul 19, 2010
Showing with 758 additions and 86 deletions.
  1. +7 −2 .gitignore
  2. +1 −1 build.xml
  3. +1 −1 input/pig/types/B
  4. +2 −0 snippet/README
  5. +18 −0 snippet/bin/check_expected.sh
  6. +14 −0 snippet/bin/check_manuscript.py
  7. +32 −0 snippet/bin/grunter.sh
  8. +26 −0 snippet/bin/phragmite_pig.py
  9. +6 −0 snippet/expected/ch11/grunt/combine_schema.xml
  10. +14 −0 snippet/expected/ch11/grunt/combine_union.xml
  11. +11 −0 snippet/expected/ch11/grunt/foreach_generate.xml
  12. +3 −0 snippet/expected/ch11/grunt/group_all.xml
  13. +5 −0 snippet/expected/ch11/grunt/group_dump.xml
  14. +4 −0 snippet/expected/ch11/grunt/group_expression.xml
  15. +7 −0 snippet/expected/ch11/grunt/join_cogroup.xml
  16. +6 −0 snippet/expected/ch11/grunt/join_cogroup_flatten.xml
  17. +6 −0 snippet/expected/ch11/grunt/join_cogroup_inner.xml
  18. +7 −0 snippet/expected/ch11/grunt/join_cogroup_join.xml
  19. +11 −0 snippet/expected/ch11/grunt/join_dump.xml
  20. +1 −0 snippet/expected/ch11/grunt/join_frj.xml
  21. +6 −0 snippet/expected/ch11/grunt/join_join.xml
  22. +2 −0 snippet/expected/ch11/grunt/max_temp_describe_records.xml
  23. +4 −0 snippet/expected/ch11/grunt/max_temp_dump_grouped_records.xml
  24. +6 −0 snippet/expected/ch11/grunt/max_temp_dump_records.xml
  25. +8 −0 snippet/expected/ch11/grunt/max_temp_filter_records.xml
  26. +2 −0 snippet/expected/ch11/grunt/max_temp_load.xml
  27. +2 −0 snippet/expected/ch11/grunt/max_temp_max_temp.xml
  28. +3 −0 snippet/expected/ch11/grunt/max_temp_result.xml
  29. +11 −0 snippet/expected/ch11/grunt/missing_fields.xml
  30. +3 −0 snippet/expected/ch11/grunt/null_corrupt.xml
  31. +4 −0 snippet/expected/ch11/grunt/null_count.xml
  32. +8 −0 snippet/expected/ch11/grunt/null_dump.xml
  33. +9 −0 snippet/expected/ch11/grunt/null_split.xml
  34. +16 −0 snippet/expected/ch11/grunt/null_undetected.xml
  35. +3 −0 snippet/expected/ch11/grunt/schema_absent.xml
  36. +9 −0 snippet/expected/ch11/grunt/schema_absent_projected.xml
  37. +4 −0 snippet/expected/ch11/grunt/schema_names_only.xml
  38. +4 −0 snippet/expected/ch11/grunt/schema_one_type_only.xml
  39. +4 −0 snippet/expected/ch11/grunt/schema_types.xml
  40. +1 −0 snippet/expected/ch11/grunt/set_debug_on.xml
  41. +4 −0 snippet/expected/ch11/grunt/sort_dump.xml
  42. +4 −0 snippet/expected/ch11/grunt/sort_limit.xml
  43. +1 −0 snippet/expected/ch11/grunt/sort_no_order.xml
  44. +5 −0 snippet/expected/ch11/grunt/sort_order.xml
  45. +6 −0 snippet/expected/ch11/grunt/store_colon_delimited.xml
  46. +6 −0 snippet/expected/ch11/grunt/stream_cut.xml
  47. +2 −0 snippet/expected/ch11/grunt/udfs_invoke_long.xml
  48. +2 −0 snippet/expected/ch11/grunt/udfs_invoke_short.xml
  49. +9 −0 snippet/expected/ch11/grunt/udfs_load.xml
  50. +1 −0 snippet/expected/ch11/grunt/udfs_register.xml
  51. +15 −0 snippet/expected/ch11/grunt/udfs_schema.xml
  52. +0 −3 src/main/ch11/grunt/group.grunt
  53. +0 −3 src/main/ch11/grunt/join.grunt
  54. +0 −6 src/main/ch11/grunt/max_temp.grunt
  55. +0 −3 src/main/ch11/grunt/tuples.grunt
  56. +1 −9 src/main/ch11/grunt/types.grunt
  57. +0 −3 src/main/ch11/grunt/udfs.grunt
  58. +40 −55 src/main/ch11/java/com/hadoopbook/pig/CutLoadFunc.java
  59. +107 −0 src/main/ch15/java/MaxWidgetId.java
  60. +264 −0 src/main/ch15/java/Widget.java
View
@@ -1,2 +1,7 @@
-build
-lib
+/*.jar
+/*.log
+/build
+/lib
+/out
+/output
+snippet/actual
View
@@ -92,7 +92,7 @@
<mkdir dir="${classes.dir}"/>
- <javac destdir="${classes.dir}" debug="true" deprecation="false" optimize="false" failonerror="true" includes="${src.includes}" excludes="ch11/,ch12/">
+ <javac destdir="${classes.dir}" debug="true" deprecation="false" optimize="false" failonerror="true" includes="${src.includes}" excludes="ch12/,ch15/">
<src path="${src.dir}"/>
<classpath refid="classpath"/>
</javac>
View
@@ -1 +1 @@
-[1#pomegranate]
+[a#pomegranate]
View
@@ -0,0 +1,2 @@
+This directory contains tools for generating code snippets for the book and
+testing that they are as expected.
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+bin=`dirname "$0"`
+bin=`cd "$bin"; pwd`
+
+actual="$bin"/../actual
+expected="$bin"/../expected
+
+for f in $expected/ch11/grunt/*.xml; do
+ echo $f
+ f_actual=$actual/ch11/grunt/`basename $f`
+ diff $f $f_actual > /dev/null
+ if [ $? != 0 ]; then
+ echo "Expected file $f different to actual $f_actual:"
+ diff $f $f_actual
+ exit 1
+ fi
+done
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+
+# Check that the expected (or actual) snippets are in the manuscript. E.g.
+# bin/check_manuscript.py ~/workspace/htdg2/ch11.xml expected/ch11/grunt/*
+
+import sys
+
+manuscript = open(sys.argv[1], 'r').read()
+
+for snippet_file in sys.argv[2:]:
+ index = manuscript.find(open(snippet_file, 'r').read())
+ if index == -1:
+ print "Snippet not found", snippet_file
+ sys.exit(1)
View
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -x
+set -e
+
+bin=`dirname "$0"`
+bin=`cd "$bin"; pwd`
+
+actual="$bin"/../actual
+
+cd "$bin"/../..
+
+rm -rf $actual/ch11/grunt
+mkdir -p $actual/ch11/grunt
+
+for f in src/main/ch11/grunt/*.grunt; do
+ out=$f.output.txt
+ pig -x local < $f 2> /dev/null \
+ | grep -v INFO \
+ | grep -v '^grunt> $' \
+ | sed -e 's|&|\&amp;|g' \
+ -e 's|"|\&quot;|g' \
+ -e 's|>|\&gt;|g' \
+ -e 's|<|\&lt;|g' \
+ -e 's|^\(grunt&gt; \)\(.*\)|<prompt moreinfo="none">\1</prompt><userinput moreinfo="none">\2</userinput>|' \
+ -e 's|^\(&gt;&gt; \)\(.*\)|<prompt moreinfo="none">\1</prompt><userinput moreinfo="none">\2</userinput>|' \
+ > $out
+ cat $out
+ python "$bin"/phragmite_pig.py $out $actual/ch11/grunt
+ rm $out
+done
+
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+
+import re
+import sys
+
+filename = sys.argv[1]
+output_dir = sys.argv[2]
+
+fragments = {}
+active_fragments = set([])
+
+for line in open(filename, 'r'):
+ m = re.match(r".*--\s+vv\s+([^<]*)", line)
+ if m:
+ active_fragments.add(m.group(1).strip())
+ continue
+ m = re.match(r".*--\s+\^\^\s+([^<]*)", line)
+ if m:
+ active_fragments.remove(m.group(1).strip())
+ continue
+ for fragment in active_fragments:
+ fragments[fragment] = fragments.get(fragment, '') + line
+
+for fragment in fragments:
+ file = open(output_dir + "/" + fragment + ".xml", 'w')
+ file.write('<screen format="linespecific">' + fragments[fragment].strip() + "</screen>" )
@@ -0,0 +1,6 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DESCRIBE A;</userinput>
+A: {f0: int,f1: int}
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DESCRIBE B;</userinput>
+B: {f0: chararray,f1: chararray,f2: int}
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DESCRIBE C;</userinput>
+Schema for C unknown.</screen>
@@ -0,0 +1,14 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP A;</userinput>
+(2,3)
+(1,2)
+(2,4)
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP B;</userinput>
+(z,x,8)
+(w,y,1)
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">C = UNION A, B;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP C;</userinput>
+(z,x,8)
+(w,y,1)
+(2,3)
+(1,2)
+(2,4)</screen>
@@ -0,0 +1,11 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP A;</userinput>
+(Joe,cherry,2)
+(Ali,apple,3)
+(Joe,banana,2)
+(Eve,apple,7)
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">B = FOREACH A GENERATE $0, $2+1, 'Constant';</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP B;</userinput>
+(Joe,3,Constant)
+(Ali,4,Constant)
+(Joe,3,Constant)
+(Eve,8,Constant)</screen>
@@ -0,0 +1,3 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">C = GROUP A ALL;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP C;</userinput>
+(all,{(Joe,cherry),(Ali,apple),(Joe,banana),(Eve,apple)})</screen>
@@ -0,0 +1,5 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP A;</userinput>
+(Joe,cherry)
+(Ali,apple)
+(Joe,banana)
+(Eve,apple)</screen>
@@ -0,0 +1,4 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">B = GROUP A BY SIZE($1);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP B;</userinput>
+(5L,{(Ali,apple),(Eve,apple)})
+(6L,{(Joe,cherry),(Joe,banana)})</screen>
@@ -0,0 +1,7 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">D = COGROUP A BY $0, B BY $1;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP D;</userinput>
+(0,{},{(Ali,0)})
+(1,{(1,Scarf)},{})
+(2,{(2,Tie)},{(Joe,2),(Hank,2)})
+(3,{(3,Hat)},{(Eve,3)})
+(4,{(4,Coat)},{(Hank,4)})</screen>
@@ -0,0 +1,6 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">F = FOREACH E GENERATE FLATTEN(A), B.$0;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP F;</userinput>
+(1,Scarf,{})
+(2,Tie,{(Joe),(Hank)})
+(3,Hat,{(Eve)})
+(4,Coat,{(Hank)})</screen>
@@ -0,0 +1,6 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">E = COGROUP A BY $0 INNER, B BY $1;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP E;</userinput>
+(1,{(1,Scarf)},{})
+(2,{(2,Tie)},{(Joe,2),(Hank,2)})
+(3,{(3,Hat)},{(Eve,3)})
+(4,{(4,Coat)},{(Hank,4)})</screen>
@@ -0,0 +1,7 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">G = COGROUP A BY $0 INNER, B BY $1 INNER;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">H = FOREACH G GENERATE FLATTEN($1), FLATTEN($2);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP H;</userinput>
+(2,Tie,Joe,2)
+(2,Tie,Hank,2)
+(3,Hat,Eve,3)
+(4,Coat,Hank,4)</screen>
@@ -0,0 +1,11 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP A;</userinput>
+(2,Tie)
+(4,Coat)
+(3,Hat)
+(1,Scarf)
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP B;</userinput>
+(Joe,2)
+(Hank,4)
+(Ali,0)
+(Eve,3)
+(Hank,2)</screen>
@@ -0,0 +1 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">C = JOIN A BY $0, B BY $1 USING &quot;replicated&quot;;</userinput></screen>
@@ -0,0 +1,6 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">C = JOIN A BY $0, B BY $1;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP C;</userinput>
+(2,Tie,Joe,2)
+(2,Tie,Hank,2)
+(3,Hat,Eve,3)
+(4,Coat,Hank,4)</screen>
@@ -0,0 +1,2 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DESCRIBE records;</userinput>
+records: {year: chararray,temperature: int,quality: int}</screen>
@@ -0,0 +1,4 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">grouped_records = GROUP filtered_records BY year;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP grouped_records;</userinput>
+(1949,{(1949,111,1),(1949,78,1)})
+(1950,{(1950,0,1),(1950,22,1),(1950,-11,1)})</screen>
@@ -0,0 +1,6 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP records;</userinput>
+(1950,0,1)
+(1950,22,1)
+(1950,-11,1)
+(1949,111,1)
+(1949,78,1)</screen>
@@ -0,0 +1,8 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">filtered_records = FILTER records BY temperature != 9999 AND</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> (quality == 0 OR quality == 1 OR quality == 4 OR quality == 5 OR quality == 9);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP filtered_records;</userinput>
+(1950,0,1)
+(1950,22,1)
+(1950,-11,1)
+(1949,111,1)
+(1949,78,1)</screen>
@@ -0,0 +1,2 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">records = LOAD 'input/ncdc/micro-tab/sample.txt'</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> AS (year:chararray, temperature:int, quality:int);</userinput></screen>
@@ -0,0 +1,2 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">max_temp = FOREACH grouped_records GENERATE group,</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> MAX(filtered_records.temperature);</userinput></screen>
@@ -0,0 +1,3 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP max_temp;</userinput>
+(1949,111)
+(1950,22)</screen>
@@ -0,0 +1,11 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">A = LOAD 'input/pig/corrupt/missing_fields';</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP A;</userinput>
+(2,Tie)
+(4,Coat)
+(3)
+(1,Scarf)
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">B = FILTER A BY SIZE(*) &gt; 1;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP B;</userinput>
+(2,Tie)
+(4,Coat)
+(1,Scarf)</screen>
@@ -0,0 +1,3 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">corrupt_records = FILTER records BY temperature is null;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP corrupt_records;</userinput>
+(1950,,1)</screen>
@@ -0,0 +1,4 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">grouped = GROUP corrupt_records ALL;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">all_grouped = FOREACH grouped GENERATE group, COUNT(corrupt_records);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP all_grouped;</userinput>
+(all,1L)</screen>
@@ -0,0 +1,8 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">records = LOAD 'input/ncdc/micro-tab/sample_corrupt.txt'</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> AS (year:chararray, temperature:int, quality:int);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP records;</userinput>
+(1950,0,1)
+(1950,22,1)
+(1950,,1)
+(1949,111,1)
+(1949,78,1)</screen>
@@ -0,0 +1,9 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">SPLIT records INTO good_records IF temperature is not null,</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> bad_records IF temperature is null;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP good_records;</userinput>
+(1950,0,1)
+(1950,22,1)
+(1949,111,1)
+(1949,78,1)
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP bad_records;</userinput>
+(1950,,1)</screen>
@@ -0,0 +1,16 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">records = LOAD 'input/ncdc/micro-tab/sample_corrupt.txt'</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> AS (year:chararray, temperature, quality:int);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP records;</userinput>
+(1950,0,1)
+(1950,22,1)
+(1950,e,1)
+(1949,111,1)
+(1949,78,1)
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">filtered_records = FILTER records BY temperature != 9999 AND</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> (quality == 0 OR quality == 1 OR quality == 4 OR quality == 5 OR quality == 9);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">grouped_records = GROUP filtered_records BY year;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">max_temp = FOREACH grouped_records GENERATE group,</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> MAX(filtered_records.temperature);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP max_temp;</userinput>
+(1949,111.0)
+(1950,22.0)</screen>
@@ -0,0 +1,3 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">records = LOAD 'input/ncdc/micro-tab/sample.txt';</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DESCRIBE records;</userinput>
+Schema for records unknown.</screen>
@@ -0,0 +1,9 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">projected_records = FOREACH records GENERATE $0, $1, $2;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP projected_records;</userinput>
+(1950,0,1)
+(1950,22,1)
+(1950,-11,1)
+(1949,111,1)
+(1949,78,1)
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DESCRIBE projected_records;</userinput>
+projected_records: {bytearray,bytearray,bytearray}</screen>
@@ -0,0 +1,4 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">records = LOAD 'input/ncdc/micro-tab/sample.txt'</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> AS (year, temperature, quality);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DESCRIBE records;</userinput>
+records: {year: bytearray,temperature: bytearray,quality: bytearray}</screen>
@@ -0,0 +1,4 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">records = LOAD 'input/ncdc/micro-tab/sample.txt'</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> AS (year, temperature:int, quality:int);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DESCRIBE records;</userinput>
+records: {year: bytearray,temperature: int,quality: int}</screen>
@@ -0,0 +1,4 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">records = LOAD 'input/ncdc/micro-tab/sample.txt'</userinput>
+<prompt moreinfo="none">&gt;&gt; </prompt><userinput moreinfo="none"> AS (year:int, temperature:int, quality:int);</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DESCRIBE records;</userinput>
+records: {year: int,temperature: int,quality: int}</screen>
@@ -0,0 +1 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">set debug on</userinput></screen>
@@ -0,0 +1,4 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP A;</userinput>
+(2,3)
+(1,2)
+(2,4)</screen>
@@ -0,0 +1,4 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">D = LIMIT B 2;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP D;</userinput>
+(1,2)
+(2,4)</screen>
@@ -0,0 +1 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">C = FOREACH B GENERATE *;</userinput></screen>
@@ -0,0 +1,5 @@
+<screen format="linespecific"><prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">B = ORDER A BY $0, $1 DESC;</userinput>
+<prompt moreinfo="none">grunt&gt; </prompt><userinput moreinfo="none">DUMP B;</userinput>
+(1,2)
+(2,4)
+(2,3)</screen>
Oops, something went wrong.

0 comments on commit 594cb96

Please sign in to comment.