From 0997079d1efeba25d0050eaefc0d8e8d3087ad43 Mon Sep 17 00:00:00 2001 From: Phil Rzewski Date: Wed, 13 Nov 2024 10:43:01 -0800 Subject: [PATCH] Remove language doc ztests (#4422) Co-authored-by: Noah Treuhaft --- docs/language/ztests/README.md | 4 -- .../ztests/language-background-1.yaml | 24 -------- .../ztests/language-background-2.yaml | 23 -------- .../ztests/language-background-3.yaml | 23 -------- .../ztests/language-background-4.yaml | 23 -------- .../ztests/language-background-5.yaml | 23 -------- .../ztests/language-background-6.yaml | 23 -------- .../ztests/language-background-7.yaml | 23 -------- .../ztests/language-background-8.yaml | 29 ---------- .../ztests/language-background-9.yaml | 32 ----------- ...nguage-directed-acyclic-flow-graphs-1.yaml | 51 ----------------- ...nguage-directed-acyclic-flow-graphs-2.yaml | 56 ------------------- ...nguage-directed-acyclic-flow-graphs-3.yaml | 47 ---------------- .../language/ztests/language-operators-1.yaml | 18 ------ docs/language/ztests/language-tldr-1.yaml | 23 -------- docs/language/ztests/language-tldr-2.yaml | 22 -------- 16 files changed, 444 deletions(-) delete mode 100644 docs/language/ztests/README.md delete mode 100644 docs/language/ztests/language-background-1.yaml delete mode 100644 docs/language/ztests/language-background-2.yaml delete mode 100644 docs/language/ztests/language-background-3.yaml delete mode 100644 docs/language/ztests/language-background-4.yaml delete mode 100644 docs/language/ztests/language-background-5.yaml delete mode 100644 docs/language/ztests/language-background-6.yaml delete mode 100644 docs/language/ztests/language-background-7.yaml delete mode 100644 docs/language/ztests/language-background-8.yaml delete mode 100644 docs/language/ztests/language-background-9.yaml delete mode 100644 docs/language/ztests/language-directed-acyclic-flow-graphs-1.yaml delete mode 100644 docs/language/ztests/language-directed-acyclic-flow-graphs-2.yaml delete mode 100644 docs/language/ztests/language-directed-acyclic-flow-graphs-3.yaml delete mode 100644 docs/language/ztests/language-operators-1.yaml delete mode 100644 docs/language/ztests/language-tldr-1.yaml delete mode 100644 docs/language/ztests/language-tldr-2.yaml diff --git a/docs/language/ztests/README.md b/docs/language/ztests/README.md deleted file mode 100644 index d8026dd929..0000000000 --- a/docs/language/ztests/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The automated tests in this directory ensure the correctess of examples shown -in the SuperPipe language docs that are not otherwise protected via -[mdtest](../../../mdtest/mdtest.go). See [super/2901](https://github.com/brimdata/super/pull/2901) -for details. diff --git a/docs/language/ztests/language-background-1.yaml b/docs/language/ztests/language-background-1.yaml deleted file mode 100644 index d7c2d1bf5d..0000000000 --- a/docs/language/ztests/language-background-1.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below is exactly as it appears in the top-level -# docs/language/README.md. - -zed: | - ? widget - -input: | - {"text": "this is a sentence with the word widget in it"} - {"text": "this search for WiDgEt is case insensitive"} - {"text": "it also looks for substrings so superwidgetythings will match"} - {"text": "whereas stuff without the word surely will not"} - -output: | - {text:"this is a sentence with the word widget in it"} - {text:"this search for WiDgEt is case insensitive"} - {text:"it also looks for substrings so superwidgetythings will match"} diff --git a/docs/language/ztests/language-background-2.yaml b/docs/language/ztests/language-background-2.yaml deleted file mode 100644 index 2509fa9b28..0000000000 --- a/docs/language/ztests/language-background-2.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below is exactly as it appears in the top-level -# docs/language/README.md. - -zed: | - ? widget |> price > 1000 - -input: | - {"text": "this is a sentence with the word widget in it", "price":999} - {"text": "this search for WiDgEt is case insensitive", "price":1001} - {"text": "it also looks for substrings so superwidgetythings will match","price": 1000.1} - {"text": "whereas stuff without the word surely will not", "price":1000.1} - -output: | - {text:"this search for WiDgEt is case insensitive",price:1001} - {text:"it also looks for substrings so superwidgetythings will match",price:1000.1} diff --git a/docs/language/ztests/language-background-3.yaml b/docs/language/ztests/language-background-3.yaml deleted file mode 100644 index 71f09c1c0f..0000000000 --- a/docs/language/ztests/language-background-3.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below is exactly as it appears in the top-level -# docs/language/README.md. - -zed: | - ? widget and price > 1000 - -input: | - {"text": "this is a sentence with the word widget in it", "price":999} - {"text": "this search for WiDgEt is case insensitive", "price":1001} - {"text": "it also looks for substrings so superwidgetythings will match","price": 1000.1} - {"text": "whereas stuff without the word surely will not", "price":1000.1} - -output: | - {text:"this search for WiDgEt is case insensitive",price:1001} - {text:"it also looks for substrings so superwidgetythings will match",price:1000.1} diff --git a/docs/language/ztests/language-background-4.yaml b/docs/language/ztests/language-background-4.yaml deleted file mode 100644 index c0eb4d5b3a..0000000000 --- a/docs/language/ztests/language-background-4.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below is exactly as it appears in the top-level -# docs/language/README.md. - -zed: | - ? widget price > 1000 - -input: | - {"text": "this is a sentence with the word widget in it", "price":999} - {"text": "this search for WiDgEt is case insensitive", "price":1001} - {"text": "it also looks for substrings so superwidgetythings will match","price": 1000.1} - {"text": "whereas stuff without the word surely will not", "price":1000.1} - -output: | - {text:"this search for WiDgEt is case insensitive",price:1001} - {text:"it also looks for substrings so superwidgetythings will match",price:1000.1} diff --git a/docs/language/ztests/language-background-5.yaml b/docs/language/ztests/language-background-5.yaml deleted file mode 100644 index 0a515a3131..0000000000 --- a/docs/language/ztests/language-background-5.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below has been modified from the way it appears in -# docs/language/README.md, as the "sort" is needed to produce deterministic -# test output from the aggregation. - -zed: | - summarize count() by color |> sort - -input: | - {"color":"brown","name":"kiwi","flavor":"sweet"} - {"color":"red","name":"apple","flavor":"tart"} - {"color":"brown","name":"coconut","flavor":"nutty"} - -output: | - {color:"red",count:1(uint64)} - {color:"brown",count:2(uint64)} diff --git a/docs/language/ztests/language-background-6.yaml b/docs/language/ztests/language-background-6.yaml deleted file mode 100644 index 9362b47a58..0000000000 --- a/docs/language/ztests/language-background-6.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below has been modified from the way it appears in -# docs/language/README.md, as the "sort" is needed to produce deterministic -# test output from the aggregation. - -zed: | - count() by color |> sort - -input: | - {"color":"brown","name":"kiwi","flavor":"sweet"} - {"color":"red","name":"apple","flavor":"tart"} - {"color":"brown","name":"coconut","flavor":"nutty"} - -output: | - {color:"red",count:1(uint64)} - {color:"brown",count:2(uint64)} diff --git a/docs/language/ztests/language-background-7.yaml b/docs/language/ztests/language-background-7.yaml deleted file mode 100644 index c76854f961..0000000000 --- a/docs/language/ztests/language-background-7.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the ZSuperPipeed below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below is exactly as it appears in the top-level -# docs/language/README.md. - -zed: | - where grep("widget") and price > 1000 - -input: | - {"text": "this is a sentence with the word widget in it", "price":999} - {"text": "this search for WiDgEt is case insensitive", "price":1001} - {"text": "it also looks for substrings so superwidgetythings will match","price": 1000.1} - {"text": "whereas stuff without the word surely will not", "price":1000.1} - -output: | - {text:"this search for WiDgEt is case insensitive",price:1001} - {text:"it also looks for substrings so superwidgetythings will match",price:1000.1} diff --git a/docs/language/ztests/language-background-8.yaml b/docs/language/ztests/language-background-8.yaml deleted file mode 100644 index 444ff2f2d9..0000000000 --- a/docs/language/ztests/language-background-8.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below is exactly as it appears in the top-level -# docs/language/README.md. - -zed: | - ? widget price > 1000 |> count() by color |> count >= 10 |> sort count - -input: | - {"color":"brown","widget":"kiwi","flavor":"sweet","price":1001} - {"color":"red","widget":"apple","flavor":"tart","price":1002} - {"color":"brown","widget":"coconut","flavor":"nutty","price":1003} - {"color":"brown","widget":"one","price":1004} - {"color":"brown","widget":"two","price":1005} - {"color":"brown","widget":"three","price":1006} - {"color":"brown","widget":"four","price":1007} - {"color":"brown","widget":"five","price":1008} - {"color":"brown","widget":"six","price":1009} - {"color":"brown","widget":"seven","price":1010} - {"color":"brown","widget":"eight","price":1011} - -output: | - {color:"brown",count:10(uint64)} diff --git a/docs/language/ztests/language-background-9.yaml b/docs/language/ztests/language-background-9.yaml deleted file mode 100644 index a4b3acb64d..0000000000 --- a/docs/language/ztests/language-background-9.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below is exactly as it appears in the top-level -# docs/language/README.md. - -zed: | - search widget and price > 1000 - |> summarize count() by color - |> where count >= 10 - |> sort count - -input: | - {"color":"brown","widget":"kiwi","flavor":"sweet","price":1001} - {"color":"red","widget":"apple","flavor":"tart","price":1002} - {"color":"brown","widget":"coconut","flavor":"nutty","price":1003} - {"color":"brown","widget":"one","price":1004} - {"color":"brown","widget":"two","price":1005} - {"color":"brown","widget":"three","price":1006} - {"color":"brown","widget":"four","price":1007} - {"color":"brown","widget":"five","price":1008} - {"color":"brown","widget":"six","price":1009} - {"color":"brown","widget":"seven","price":1010} - {"color":"brown","widget":"eight","price":1011} - -output: | - {color:"brown",count:10(uint64)} diff --git a/docs/language/ztests/language-directed-acyclic-flow-graphs-1.yaml b/docs/language/ztests/language-directed-acyclic-flow-graphs-1.yaml deleted file mode 100644 index 07c4925211..0000000000 --- a/docs/language/ztests/language-directed-acyclic-flow-graphs-1.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below has been modified from the way it appears in -# docs/language/README.md: -# -# from PoolOne |> fork ( -# => op1 |> op2 |> ... -# => op1 |> op2 |> ... -# ) |> merge ts |> ... -# -# Specifically, the "op1", "op2", and "..." have been filled in with real -# operations, and the "merge" has been replaced with a "sort" for now since -# merge has not yet been fully implemented -# (https://github.com/brimdata/super/issues/2906). - -script: | - export SUPER_DB_LAKE=test - super db init -q - super db create -q PoolOne - super db load -q -use PoolOne fruit.jsup - super db query -z -I split.spq - -inputs: - - name: fruit.jsup - data: | - {ts:2018-03-24T17:15:21Z,name:"apple",color:"red"} - {ts:2018-03-24T17:16:55Z,name:"banana",color:"yellow"} - {ts:2018-03-24T17:21:23Z,name:"avocado",color:"green"} - {ts:2018-03-24T17:23:29Z,name:"strawberry",color:"red"} - - name: split.spq - data: | - from PoolOne |> fork ( - => allfruit:=collect(name),allcolor:=collect(color) by every(5m) |> put numfruit:=len(allfruit) |> put numcolor:=len(allcolor) - => put color:=upper(color) |> put namelen:=len(name) |> put tag:="mytag" - ) |> sort ts |> rename time:=ts - -outputs: - - name: stdout - data: | - {time:2018-03-24T17:15:00Z,allfruit:["banana","apple"],allcolor:["yellow","red"],numfruit:2,numcolor:2} - {time:2018-03-24T17:15:21Z,name:"apple",color:"RED",namelen:5,tag:"mytag"} - {time:2018-03-24T17:16:55Z,name:"banana",color:"YELLOW",namelen:6,tag:"mytag"} - {time:2018-03-24T17:20:00Z,allfruit:["strawberry","avocado"],allcolor:["red","green"],numfruit:2,numcolor:2} - {time:2018-03-24T17:21:23Z,name:"avocado",color:"GREEN",namelen:7,tag:"mytag"} - {time:2018-03-24T17:23:29Z,name:"strawberry",color:"RED",namelen:10,tag:"mytag"} diff --git a/docs/language/ztests/language-directed-acyclic-flow-graphs-2.yaml b/docs/language/ztests/language-directed-acyclic-flow-graphs-2.yaml deleted file mode 100644 index 8a3158c701..0000000000 --- a/docs/language/ztests/language-directed-acyclic-flow-graphs-2.yaml +++ /dev/null @@ -1,56 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below has been modified from the way it appears in -# docs/language/README.md: -# -# from ( -# pool PoolOne => op1 |> op2 |> ... -# pool PoolTwo => op1 |> op2 |> ... -# ) |> join on key=key |> ... -# -# Specifically, the "op1", "op2", and "..." have been filled in with real -# operations, and a field assignment has been added to the join -# (https://github.com/brimdata/super/issues/2815). - -script: | - export SUPER_DB_LAKE=test - super db init -q - super db create -q -orderby color PoolOne - super db create -q -orderby price PoolTwo - super db load -q -use PoolOne fruit.jsup - super db load -q -use PoolTwo prices.jsup - super db query -z -I join.spq - -inputs: - - name: fruit.jsup - data: | - {key:"apple",color:"red"} - {key:"banana",color:"yellow"} - {key:"avocado",color:"green"} - {key:"strawberry",color:"red"} - - name: prices.jsup - data: | - {key:"apple",price:1.5} - {key:"banana",price:2.1} - {key:"avocado",price:3.} - {key:"strawberry",price:0.5} - - name: join.spq - data: | - from ( - pool PoolOne => put color:=upper(color) |> put namelen:=len(key) - pool PoolTwo => put price:=price+0.5 |> put tag:="mytag" - ) |> join on key=key priceinfo:=this |> drop priceinfo.key - -outputs: - - name: stdout - data: | - {key:"apple",color:"RED",namelen:5,priceinfo:{price:2.,tag:"mytag"}} - {key:"avocado",color:"GREEN",namelen:7,priceinfo:{price:3.5,tag:"mytag"}} - {key:"banana",color:"YELLOW",namelen:6,priceinfo:{price:2.6,tag:"mytag"}} - {key:"strawberry",color:"RED",namelen:10,priceinfo:{price:1.,tag:"mytag"}} diff --git a/docs/language/ztests/language-directed-acyclic-flow-graphs-3.yaml b/docs/language/ztests/language-directed-acyclic-flow-graphs-3.yaml deleted file mode 100644 index 6b1e93b081..0000000000 --- a/docs/language/ztests/language-directed-acyclic-flow-graphs-3.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below has been modified from the way it appears in -# docs/language/README.md: -# -# from ... |> switch color ( -# case "red" => op1 |> op2 |> ... -# case "blue" => op1 |> op2 |> ... -# default => op1 |> op2 |> ... -# ) |> ... -# -# Specifically, the "op1", "op2", and "..." have been filled in with real -# operations. - -script: | - export SUPER_DB_LAKE=test - super db init -q - super db create -q -orderby name fruit - super db load -q -use fruit fruit.jsup - super db query -z -I switch.spq - -inputs: - - name: fruit.jsup - data: | - {name:"apple",color:"red",price:1.5} - {name:"banana",color:"yellow",price:2.1} - {name:"blueberry",color:"blue",price:0.1} - - name: switch.spq - data: | - from fruit |> switch color ( - case "red" => put price:=price+0.5 |> put bigcolor:=upper(color) |> put tag:="expensive" - case "blue" => put price:=price+0.1 |> put colorlen:=len(color) |> put tag:="cheaper" - default => put price:=price-0.1 |> put promo:="discounted" |> put tag:="promoted" - ) |> sort name - -outputs: - - name: stdout - data: | - {name:"apple",color:"red",price:2.,bigcolor:"RED",tag:"expensive"} - {name:"banana",color:"yellow",price:2.,promo:"discounted",tag:"promoted"} - {name:"blueberry",color:"blue",price:0.2,colorlen:4,tag:"cheaper"} diff --git a/docs/language/ztests/language-operators-1.yaml b/docs/language/ztests/language-operators-1.yaml deleted file mode 100644 index ef42fc3131..0000000000 --- a/docs/language/ztests/language-operators-1.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -script: | - super compile -C '? widget |> count() by color |> COLOR := upper(color)' - -outputs: - - name: stdout - data: | - search widget - |> summarize - count() by color - |> put COLOR:=upper(color) diff --git a/docs/language/ztests/language-tldr-1.yaml b/docs/language/ztests/language-tldr-1.yaml deleted file mode 100644 index 0bfd34fed1..0000000000 --- a/docs/language/ztests/language-tldr-1.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below has been modified from the way it appears in -# docs/language/README.md, as the "sort" is needed to produce deterministic -# test output from the aggregation. - -zed: | - color=="brown" |> put characters:=len(name) |> count() by flavor,characters |> sort - -input: | - {"color":"brown","name":"kiwi","flavor":"sweet"} - {"color":"red","name":"apple","flavor":"tart"} - {"color":"brown","name":"coconut","flavor":"nutty"} - -output: | - {flavor:"sweet",characters:4,count:1(uint64)} - {flavor:"nutty",characters:7,count:1(uint64)} diff --git a/docs/language/ztests/language-tldr-2.yaml b/docs/language/ztests/language-tldr-2.yaml deleted file mode 100644 index 2563100fe8..0000000000 --- a/docs/language/ztests/language-tldr-2.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# ============================================================================ -# NOTE: This is a test to protect an example shown in the SuperPipe language -# docs. If you need to make changes to the SuperPipe below to make the tests pass -# again after a change, the docs likely need to be updated as well. -# -# See https://github.com/brimdata/super/pull/2901 for details -# ============================================================================ - -# The SuperPipe being tested below is exactly as it appears in the top-level -# docs/language/README.md. - -zed: | - put bigname:=upper(name) |> ? not /^APPLE$/ - -input: | - {"color":"brown","name":"kiwi","flavor":"sweet"} - {"color":"red","name":"apple","flavor":"tart"} - {"color":"brown","name":"coconut","flavor":"nutty"} - -output: | - {color:"brown",name:"kiwi",flavor:"sweet",bigname:"KIWI"} - {color:"brown",name:"coconut",flavor:"nutty",bigname:"COCONUT"}