Skip to content

Commit 4055a43

Browse files
committed
Third lookup error #102
1 parent 80ad4ef commit 4055a43

File tree

6 files changed

+58
-0
lines changed

6 files changed

+58
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"test" : [ {
3+
"animal" : "mammal"
4+
}, {
5+
"animal" : "bird"
6+
}, {
7+
"animal" : "human"
8+
} ],
9+
"animals" : [ {
10+
"animal" : "dog",
11+
"classification" : {
12+
"type" : "mammal"
13+
}
14+
}, {
15+
"animal" : "parrot",
16+
"classification" : {
17+
"type" : "bird"
18+
}
19+
}, {
20+
"animal" : "human",
21+
"classification" : {
22+
"type" : "human"
23+
}
24+
} ]
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{ "metadata" : {
2+
"real" :
3+
{
4+
"test" : [ { "animal" : "Jake" },
5+
{ "animal" :"Blacky"},
6+
{ "animal" : "Jens"} ]
7+
}
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dog mammal
2+
cat mammal
3+
parrot bird
4+
shark fish
5+
dragon fictional animal
6+
unicorn fictional animal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Jake dog
2+
Blacky parrot
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
set_array("animals[]")
2+
do list(path: "metadata.real.test[]", "var": "$f")
3+
lookup("$f.animal", "./mapfile_2.tsv", "sep_char":"\t")
4+
copy_field("$f.animal", "animals[].$append.animal")
5+
copy_field("$f.animal", "animals[].$last.classification.type")
6+
end
7+
8+
lookup("animals[].*.classification.type", "./mapfile.tsv", "sep_char":"\t")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FLUX_DIR + "input.json"
2+
|open-file
3+
|as-records
4+
|decode-json
5+
|fix(FLUX_DIR + "test.fix")
6+
|encode-json(prettyPrinting="true")
7+
|write(FLUX_DIR + "output-metafix.json")
8+
;

0 commit comments

Comments
 (0)