- commit
- 0c0663a64de2891e4dd4534a38bebc4a91b1757e
- parent
- 2d81318595b10e2fcdf9b0601923a0cc3156c6be
- author
- Dami <dami.etoile@gmail.com>
- kind
- feat risk score 0.2 of 3, Jev's estimate
| A | demos/ | 37 | +++++++++++++++++++++++ |
| A | demos/ | 48 | ++++++++++++++++++++++++++++++ |
| M | docs/ | 2 | + |
| A | docs/ | bin |
@@ -0,0 +1,37 @@
1+// Command gensales writes the sales the linked sources demo reads2+// (sources.tape): ten million rows of Parquet, an id, one of eight3+// categories, an amount and a date each, the same every time4+// (internal/stress's SalesParquet), into the file named on its command5+// line.6+package main7+8+import (9+ "flag"10+ "fmt"11+ "os"12+ "path/filepath"13+14+ "github.com/FelineStateMachine/012/internal/stress"15+)16+17+func main() {18+ rows := flag.Int("rows", 10_000_000, "how many rows to write")19+ flag.Parse()20+ if flag.NArg() != 1 {21+ fmt.Fprintln(os.Stderr, "usage: gensales [-rows n] out.parquet")22+ os.Exit(2)23+ }24+ out := flag.Arg(0)25+ dir, err := os.MkdirTemp(filepath.Dir(out), "gensales")26+ if err == nil {27+ defer os.RemoveAll(dir)28+ var name string29+ if name, err = stress.SalesParquet(dir, *rows); err == nil {30+ err = os.Rename(name, out)31+ }32+ }33+ if err != nil {34+ fmt.Fprintln(os.Stderr, "gensales:", err)35+ os.Exit(1)36+ }37+}@@ -0,0 +1,48 @@
1+# Linked sources: ten million rows of Parquet (made by gensales) linked2+# as a source (Data > Linked file > Link a source, here from the3+# palette), sorted by amount Z to A in the background, its rows4+# numbered past the grid's last, and read whole by a SUMIFS on5+# Sheet1.6+Output out/sources.gif7+Source lib/setup.tape8+9+Hide10+Type "go run ./gensales out/sales.parquet && clear && ../bin/012" Enter11+Wait+Screen@90s /Help/12+Show13+14+Sleep 500ms15+Ctrl+K16+Type@80ms "link a source"17+Sleep 400ms18+Enter19+Sleep 500ms20+Type@40ms "out/sales.parquet"21+Enter22+Sleep 800ms23+Down24+Up25+Sleep 1s26+Screenshot out/stills/sources-linked.png27+Sleep 400ms28+Right 229+Ctrl+K30+Type@80ms "sort sheet z to a"31+Sleep 400ms32+Enter33+Wait+Screen@30s /sorted by amount Z to A/34+Sleep 1.2s35+Screenshot out/stills/sources-sorted.png36+Sleep 400ms37+Ctrl+K38+Type@80ms "previous sheet"39+Sleep 400ms40+Enter41+Sleep 400ms42+Type "North"43+Tab44+Type@40ms `=SUMIFS(sales[amount],sales[cat],"north")`45+Enter46+Sleep 1.5s47+Screenshot out/stills/sources-formulas.png48+Sleep 1s@@ -17,6 +17,8 @@ source of ten million rows opens at once and takes a few MB.
1717 1818 ## Linking a source1919 20+21+2022 **Data > Linked file > Link a source** lists the Parquet files and2123 SQLite databases in the folder, or takes a path. For a database a2224 second list asks which table or view to read, or **A query…** to readBinary file.