mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-22 15:37:59 +00:00
695 lines
19 KiB
Text
695 lines
19 KiB
Text
|
|
================================================================
|
|
OLD NULL-HANDLING
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $z = $x + $y ./reg_test/input/null-vs-empty.dkvp
|
|
x=1,y=2,s=hello,z=3
|
|
x=1,y=,s=,z=
|
|
x=,y=,s=hurrah,z=
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $z = $y + $y ./reg_test/input/null-vs-empty.dkvp
|
|
x=1,y=2,s=hello,z=4
|
|
x=1,y=,s=,z=
|
|
x=,y=,s=hurrah,z=
|
|
|
|
|
|
---------------------------------------------------------------- FIXME FOR SRECS
|
|
mlr put $z = $x + $nosuch ./reg_test/input/null-vs-empty.dkvp
|
|
x=1,y=2,s=hello,z=1
|
|
x=1,y=,s=,z=1
|
|
x=,y=,s=hurrah,z=
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $t = sub($s, "ell", "X") ./reg_test/input/null-vs-empty.dkvp
|
|
x=1,y=2,s=hello,t=hXo
|
|
x=1,y=,s=,t=
|
|
x=,y=,s=hurrah,t=hurrah
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $t = sub($s, "ell", "") ./reg_test/input/null-vs-empty.dkvp
|
|
x=1,y=2,s=hello,t=ho
|
|
x=1,y=,s=,t=
|
|
x=,y=,s=hurrah,t=hurrah
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $t = sub($nosuch, "ell", "X") ./reg_test/input/null-vs-empty.dkvp
|
|
x=1,y=2,s=hello,t=
|
|
x=1,y=,s=,t=
|
|
x=,y=,s=hurrah,t=
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $t = gsub($s, "l", "X") ./reg_test/input/null-vs-empty.dkvp
|
|
x=1,y=2,s=hello,t=heXXo
|
|
x=1,y=,s=,t=
|
|
x=,y=,s=hurrah,t=hurrah
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $t = gsub($s, "l", "") ./reg_test/input/null-vs-empty.dkvp
|
|
x=1,y=2,s=hello,t=heo
|
|
x=1,y=,s=,t=
|
|
x=,y=,s=hurrah,t=hurrah
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $t = gsub($nosuch, "l", "X") ./reg_test/input/null-vs-empty.dkvp
|
|
x=1,y=2,s=hello,t=
|
|
x=1,y=,s=,t=
|
|
x=,y=,s=hurrah,t=
|
|
|
|
|
|
================================================================
|
|
NULLITY PREDICATES
|
|
|
|
mlr --opprint filter isnull($x) ./reg_test/input/nullvals.dkvp
|
|
a x y z
|
|
b - 6 -
|
|
b - - -
|
|
|
|
mlr --opprint filter isnull($y) ./reg_test/input/nullvals.dkvp
|
|
a x y z
|
|
b 5 - -
|
|
b - - -
|
|
|
|
mlr --opprint filter isnull($z) ./reg_test/input/nullvals.dkvp
|
|
a x y z
|
|
b 1 2 -
|
|
b 3 4 -
|
|
b 5 - -
|
|
b - 6 -
|
|
b - - -
|
|
|
|
mlr --opprint filter isnull($nosuch) ./reg_test/input/nullvals.dkvp
|
|
a x y z
|
|
b 1 2 -
|
|
b 3 4 -
|
|
b 5 - -
|
|
b - 6 -
|
|
b - - -
|
|
|
|
mlr --opprint filter isnotnull($x) ./reg_test/input/nullvals.dkvp
|
|
a x y z
|
|
b 1 2 -
|
|
b 3 4 -
|
|
b 5 - -
|
|
|
|
mlr --opprint filter isnotnull($y) ./reg_test/input/nullvals.dkvp
|
|
a x y z
|
|
b 1 2 -
|
|
b 3 4 -
|
|
b - 6 -
|
|
|
|
mlr --opprint filter isnotnull($z) ./reg_test/input/nullvals.dkvp
|
|
|
|
mlr --opprint filter isnotnull($nosuch) ./reg_test/input/nullvals.dkvp
|
|
|
|
mlr --opprint put $f=isnull($x) ./reg_test/input/nullvals.dkvp
|
|
a x y z f
|
|
b 1 2 - false
|
|
b 3 4 - false
|
|
b 5 - - false
|
|
b - 6 - true
|
|
b - - - true
|
|
|
|
mlr --opprint put $f=isnull($y) ./reg_test/input/nullvals.dkvp
|
|
a x y z f
|
|
b 1 2 - false
|
|
b 3 4 - false
|
|
b 5 - - true
|
|
b - 6 - false
|
|
b - - - true
|
|
|
|
mlr --opprint put $f=isnull($z) ./reg_test/input/nullvals.dkvp
|
|
a x y z f
|
|
b 1 2 - true
|
|
b 3 4 - true
|
|
b 5 - - true
|
|
b - 6 - true
|
|
b - - - true
|
|
|
|
mlr --opprint put $f=isnull($nosuch) ./reg_test/input/nullvals.dkvp
|
|
a x y z f
|
|
b 1 2 - true
|
|
b 3 4 - true
|
|
b 5 - - true
|
|
b - 6 - true
|
|
b - - - true
|
|
|
|
mlr --opprint put $f=isnotnull($x) ./reg_test/input/nullvals.dkvp
|
|
a x y z f
|
|
b 1 2 - true
|
|
b 3 4 - true
|
|
b 5 - - true
|
|
b - 6 - false
|
|
b - - - false
|
|
|
|
mlr --opprint put $f=isnotnull($y) ./reg_test/input/nullvals.dkvp
|
|
a x y z f
|
|
b 1 2 - true
|
|
b 3 4 - true
|
|
b 5 - - false
|
|
b - 6 - true
|
|
b - - - false
|
|
|
|
mlr --opprint put $f=isnotnull($z) ./reg_test/input/nullvals.dkvp
|
|
a x y z f
|
|
b 1 2 - false
|
|
b 3 4 - false
|
|
b 5 - - false
|
|
b - 6 - false
|
|
b - - - false
|
|
|
|
mlr --opprint put $f=isnotnull($nosuch) ./reg_test/input/nullvals.dkvp
|
|
a x y z f
|
|
b 1 2 - false
|
|
b 3 4 - false
|
|
b 5 - - false
|
|
b - 6 - false
|
|
b - - - false
|
|
|
|
|
|
================================================================
|
|
TRI-SPLIT-NULL HANDLING
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put -q @sum += $x; end{emitp @sum} ./reg_test/input/abixy
|
|
sum=4.536294
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put -q @sum[$a] += $x; end{emitp @sum, "a"} ./reg_test/input/abixy
|
|
a=pan,sum=0.849416
|
|
a=eks,sum=1.751863
|
|
a=wye,sum=0.777892
|
|
a=zee,sum=1.125680
|
|
a=hat,sum=0.031442
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $nonesuch = @nonesuch ./reg_test/input/abixy
|
|
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,nonesuch=
|
|
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,nonesuch=
|
|
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,nonesuch=
|
|
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,nonesuch=
|
|
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,nonesuch=
|
|
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697,nonesuch=
|
|
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694,nonesuch=
|
|
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006,nonesuch=
|
|
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059,nonesuch=
|
|
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864,nonesuch=
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put -q @sum += $x; end{emitp @sum} ./reg_test/input/abixy-het
|
|
sum=3.963005
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put -q @sum[$a] += $x; end{emitp @sum, "a"} ./reg_test/input/abixy-het
|
|
a=pan,sum=0.849416
|
|
a=eks,sum=1.751863
|
|
a=wye,sum=
|
|
a=zee,sum=1.125680
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $nonesuch = @nonesuch ./reg_test/input/abixy-het
|
|
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,nonesuch=
|
|
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,nonesuch=
|
|
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,nonesuch=
|
|
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,nonesuch=
|
|
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729,nonesuch=
|
|
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697,nonesuch=
|
|
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694,nonesuch=
|
|
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006,nonesuch=
|
|
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059,nonesuch=
|
|
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864,nonesuch=
|
|
|
|
mlr put -q @sum += $x; @sumtype = typeof(@sum); @xtype = typeof($x); emitf @sumtype, @xtype, @sum; end{emitp @sum} ./reg_test/input/abixy
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=0.346790
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.105470
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.310073
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.691473
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=2.264762
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=2.791888
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=3.403672
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=4.002226
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=4.033668
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=4.536294
|
|
sum=4.536294
|
|
|
|
mlr put -q @sum += $x; @sumtype = typeof(@sum); @xtype = typeof($x); emitf @sumtype, @xtype, @sum; end{emitp @sum} ./reg_test/input/abixy-het
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=0.346790
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.105470
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.310073
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.691473
|
|
sumtype=MT_FLOAT,xtype=MT_ABSENT,sum=1.691473
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=2.218599
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=2.830383
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=3.428937
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=3.460379
|
|
sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=3.963005
|
|
sum=3.963005
|
|
|
|
mlr put $z = $x + $y ./reg_test/input/typeof.dkvp
|
|
x=1,y=2,z=3
|
|
x=1,y=,z=
|
|
x=,y=2,z=
|
|
x=,y=,z=
|
|
|
|
mlr put $z = $x + $y ./reg_test/input/typeof.dkvp
|
|
x=1,y=2,z=3
|
|
x=1,y=,z=
|
|
x=,y=2,z=
|
|
x=,y=,z=
|
|
|
|
mlr put $z = $x + $u ./reg_test/input/typeof.dkvp
|
|
x=1,y=2,z=1
|
|
x=1,y=,z=1
|
|
x=,y=2,z=
|
|
x=,y=,z=
|
|
|
|
mlr put @s = @s + $y; emitp @s ./reg_test/input/typeof.dkvp
|
|
s=2
|
|
x=1,y=2
|
|
s=
|
|
x=1,y=
|
|
s=
|
|
x=,y=2
|
|
s=
|
|
x=,y=
|
|
|
|
mlr put @s = @s + $y; emitp @s ./reg_test/input/typeof.dkvp
|
|
s=2
|
|
x=1,y=2
|
|
s=
|
|
x=1,y=
|
|
s=
|
|
x=,y=2
|
|
s=
|
|
x=,y=
|
|
|
|
mlr put @s = @s + $u; emitp @s ./reg_test/input/typeof.dkvp
|
|
s=
|
|
x=1,y=2
|
|
s=
|
|
x=1,y=
|
|
s=
|
|
x=,y=2
|
|
s=
|
|
x=,y=
|
|
|
|
mlr put $z = $x + $y; $x=typeof($x);$y=typeof($y);$z=typeof($z) ./reg_test/input/typeof.dkvp
|
|
x=MT_INT,y=MT_INT,z=MT_INT
|
|
x=MT_INT,y=MT_VOID,z=MT_VOID
|
|
x=MT_VOID,y=MT_INT,z=MT_VOID
|
|
x=MT_VOID,y=MT_VOID,z=MT_VOID
|
|
|
|
mlr put $z = $x + $y; $x=typeof($x);$y=typeof($y);$z=typeof($z) ./reg_test/input/typeof.dkvp
|
|
x=MT_INT,y=MT_INT,z=MT_INT
|
|
x=MT_INT,y=MT_VOID,z=MT_VOID
|
|
x=MT_VOID,y=MT_INT,z=MT_VOID
|
|
x=MT_VOID,y=MT_VOID,z=MT_VOID
|
|
|
|
mlr put $z = $x + $u; $x=typeof($x);$y=typeof($y);$z=typeof($z) ./reg_test/input/typeof.dkvp
|
|
x=MT_INT,y=MT_INT,z=MT_INT
|
|
x=MT_INT,y=MT_VOID,z=MT_INT
|
|
x=MT_VOID,y=MT_INT,z=MT_VOID
|
|
x=MT_VOID,y=MT_VOID,z=MT_VOID
|
|
|
|
mlr put @s = @s + $y; $x=typeof($x);$y=typeof($y);$z=typeof($z);$s=typeof(@s) ./reg_test/input/typeof.dkvp
|
|
x=MT_INT,y=MT_INT,z=MT_ABSENT,s=MT_INT
|
|
x=MT_INT,y=MT_VOID,z=MT_ABSENT,s=MT_VOID
|
|
x=MT_VOID,y=MT_INT,z=MT_ABSENT,s=MT_VOID
|
|
x=MT_VOID,y=MT_VOID,z=MT_ABSENT,s=MT_VOID
|
|
|
|
mlr put @s = @s + $y; $x=typeof($x);$y=typeof($y);$z=typeof($z);$s=typeof(@s) ./reg_test/input/typeof.dkvp
|
|
x=MT_INT,y=MT_INT,z=MT_ABSENT,s=MT_INT
|
|
x=MT_INT,y=MT_VOID,z=MT_ABSENT,s=MT_VOID
|
|
x=MT_VOID,y=MT_INT,z=MT_ABSENT,s=MT_VOID
|
|
x=MT_VOID,y=MT_VOID,z=MT_ABSENT,s=MT_VOID
|
|
|
|
mlr put @s = @s + $u; $x=typeof($x);$y=typeof($y);$z=typeof($z);$s=typeof(@s) ./reg_test/input/typeof.dkvp
|
|
x=MT_INT,y=MT_INT,z=MT_ABSENT,s=MT_VOID
|
|
x=MT_INT,y=MT_VOID,z=MT_ABSENT,s=MT_VOID
|
|
x=MT_VOID,y=MT_INT,z=MT_ABSENT,s=MT_VOID
|
|
x=MT_VOID,y=MT_VOID,z=MT_ABSENT,s=MT_VOID
|
|
|
|
|
|
================================================================
|
|
ABSENT-HANDLING
|
|
|
|
|
|
---------------------------------------------------------------- FIXME FOR SRECS
|
|
mlr put $a = $a * 2 ./reg_test/input/absent.dkvp
|
|
a=2,b=2
|
|
a=,b=4
|
|
x=,b=6,a=2
|
|
a=14,b=8
|
|
|
|
|
|
---------------------------------------------------------------- FIXME FOR SRECS
|
|
mlr put $new = $a * 2 ./reg_test/input/absent.dkvp
|
|
a=1,b=2,new=2
|
|
a=,b=4,new=
|
|
x=,b=6,new=2
|
|
a=7,b=8,new=14
|
|
|
|
|
|
---------------------------------------------------------------- ok for oosvars
|
|
mlr put $new = @nonesuch * 2 ./reg_test/input/absent.dkvp
|
|
a=1,b=2,new=2
|
|
a=,b=4,new=2
|
|
x=,b=6,new=2
|
|
a=7,b=8,new=2
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put begin {@somesuch = 10 }; $new = @somesuch * 2 ./reg_test/input/absent.dkvp
|
|
a=1,b=2,new=20
|
|
a=,b=4,new=20
|
|
x=,b=6,new=20
|
|
a=7,b=8,new=20
|
|
|
|
|
|
---------------------------------------------------------------- FIXME FOR SRECS
|
|
mlr put $new = @nonesuch * $a ./reg_test/input/absent.dkvp
|
|
a=1,b=2,new=1
|
|
a=,b=4,new=
|
|
x=,b=6,new=
|
|
a=7,b=8,new=7
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put begin {@somesuch = 10 }; $new = @somesuch * $a ./reg_test/input/absent.dkvp
|
|
a=1,b=2,new=10
|
|
a=,b=4,new=
|
|
x=,b=6,new=10
|
|
a=7,b=8,new=70
|
|
|
|
|
|
---------------------------------------------------------------- FIXME AND COMPARE TO ABOVE
|
|
mlr put @sum = @sum + $a; emit @sum; end { emit @sum } ./reg_test/input/absent.dkvp
|
|
sum=1
|
|
a=1,b=2
|
|
sum=
|
|
a=,b=4
|
|
sum=
|
|
x=,b=6
|
|
sum=
|
|
a=7,b=8
|
|
sum=
|
|
|
|
|
|
---------------------------------------------------------------- FIXME AND COMPARE TO ABOVE
|
|
mlr put @product = @product * $a; emit @product; end { emit @product } ./reg_test/input/absent.dkvp
|
|
product=1
|
|
a=1,b=2
|
|
product=
|
|
a=,b=4
|
|
product=
|
|
x=,b=6
|
|
product=
|
|
a=7,b=8
|
|
product=
|
|
|
|
|
|
---------------------------------------------------------------- FIXME AND COMPARE TO ABOVE
|
|
mlr put begin { @sum = 10 }; @sum = @sum + $a; emit @sum; end { emit @sum } ./reg_test/input/absent.dkvp
|
|
sum=11
|
|
a=1,b=2
|
|
sum=
|
|
a=,b=4
|
|
sum=
|
|
x=,b=6
|
|
sum=
|
|
a=7,b=8
|
|
sum=
|
|
|
|
|
|
---------------------------------------------------------------- FIXME AND COMPARE TO ABOVE
|
|
mlr put begin { @product = 10 }; @product = @product * $a; emit @product; end { emit @product } ./reg_test/input/absent.dkvp
|
|
product=10
|
|
a=1,b=2
|
|
product=
|
|
a=,b=4
|
|
product=
|
|
x=,b=6
|
|
product=
|
|
a=7,b=8
|
|
product=
|
|
|
|
|
|
================================================================
|
|
COMPARE OLD TESTS TO NEW
|
|
|
|
|
|
---------------------------------------------------------------- raw input
|
|
mlr cat ./reg_test/input/abixy-het
|
|
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
|
|
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
|
|
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
|
|
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
|
|
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729
|
|
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
|
|
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694
|
|
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006
|
|
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
|
|
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put -q @sum += $x; end{emitp @sum} ./reg_test/input/abixy-het
|
|
sum=3.963005
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put -q @sum[$a] += $x; end{emitp @sum, "a"} ./reg_test/input/abixy-het
|
|
a=pan,sum=0.849416
|
|
a=eks,sum=1.751863
|
|
a=wye,sum=
|
|
a=zee,sum=1.125680
|
|
|
|
|
|
---------------------------------------------------------------- ok
|
|
mlr put $nonesuch = @nonesuch ./reg_test/input/abixy-het
|
|
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,nonesuch=
|
|
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,nonesuch=
|
|
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,nonesuch=
|
|
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,nonesuch=
|
|
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729,nonesuch=
|
|
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697,nonesuch=
|
|
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694,nonesuch=
|
|
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006,nonesuch=
|
|
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059,nonesuch=
|
|
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864,nonesuch=
|
|
|
|
|
|
---------------------------------------------------------------- raw input
|
|
mlr cat ./reg_test/input/absent.dkvp
|
|
a=1,b=2
|
|
a=,b=4
|
|
x=,b=6
|
|
a=7,b=8
|
|
|
|
|
|
---------------------------------------------------------------- FIXME AND COMPARE TO ABOVE
|
|
mlr put @sum = @sum + $a; emit @sum; end { emit @sum } ./reg_test/input/absent.dkvp
|
|
sum=1
|
|
a=1,b=2
|
|
sum=
|
|
a=,b=4
|
|
sum=
|
|
x=,b=6
|
|
sum=
|
|
a=7,b=8
|
|
sum=
|
|
|
|
|
|
---------------------------------------------------------------- FIXME AND COMPARE TO ABOVE
|
|
mlr put @product = @product * $a; emit @product; end { emit @product } ./reg_test/input/absent.dkvp
|
|
product=1
|
|
a=1,b=2
|
|
product=
|
|
a=,b=4
|
|
product=
|
|
x=,b=6
|
|
product=
|
|
a=7,b=8
|
|
product=
|
|
|
|
|
|
---------------------------------------------------------------- FIXME AND COMPARE TO ABOVE
|
|
mlr put begin { @sum = 10 }; @sum = @sum + $a; emit @sum; end { emit @sum } ./reg_test/input/absent.dkvp
|
|
sum=11
|
|
a=1,b=2
|
|
sum=
|
|
a=,b=4
|
|
sum=
|
|
x=,b=6
|
|
sum=
|
|
a=7,b=8
|
|
sum=
|
|
|
|
|
|
---------------------------------------------------------------- FIXME AND COMPARE TO ABOVE
|
|
mlr put begin { @product = 10 }; @product = @product * $a; emit @product; end { emit @product } ./reg_test/input/absent.dkvp
|
|
product=10
|
|
a=1,b=2
|
|
product=
|
|
a=,b=4
|
|
product=
|
|
x=,b=6
|
|
product=
|
|
a=7,b=8
|
|
product=
|
|
|
|
|
|
---------------------------------------------------------------- COMPARE
|
|
mlr put emit @sum; @sum += $x; emit @sum; end { emit @sum } ./reg_test/input/abixy-het
|
|
sum=0.346790
|
|
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
|
|
sum=0.346790
|
|
sum=1.105470
|
|
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
|
|
sum=1.105470
|
|
sum=1.310073
|
|
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
|
|
sum=1.310073
|
|
sum=1.691473
|
|
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
|
|
sum=1.691473
|
|
sum=1.691473
|
|
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729
|
|
sum=1.691473
|
|
sum=2.218599
|
|
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
|
|
sum=2.218599
|
|
sum=2.830383
|
|
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694
|
|
sum=2.830383
|
|
sum=3.428937
|
|
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006
|
|
sum=3.428937
|
|
sum=3.460379
|
|
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
|
|
sum=3.460379
|
|
sum=3.963005
|
|
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864
|
|
sum=3.963005
|
|
|
|
|
|
---------------------------------------------------------------- COMPARE
|
|
mlr put emit @sum; @sum += $a; emit @sum; end { emit @sum } ./reg_test/input/absent.dkvp
|
|
sum=1
|
|
a=1,b=2
|
|
sum=1
|
|
sum=
|
|
a=,b=4
|
|
sum=
|
|
sum=
|
|
x=,b=6
|
|
sum=
|
|
sum=
|
|
a=7,b=8
|
|
sum=
|
|
|
|
mlr put emit @sum; $ostype=typeof(@sum);$xtype=typeof($x);@sum += $x; $nstype=typeof(@sum);emit @sum; end { emit @sum } ./reg_test/input/abixy-het
|
|
sum=0.346790
|
|
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,ostype=MT_UNINIT,xtype=MT_FLOAT,nstype=MT_FLOAT
|
|
sum=0.346790
|
|
sum=1.105470
|
|
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,ostype=MT_FLOAT,xtype=MT_FLOAT,nstype=MT_FLOAT
|
|
sum=1.105470
|
|
sum=1.310073
|
|
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,ostype=MT_FLOAT,xtype=MT_FLOAT,nstype=MT_FLOAT
|
|
sum=1.310073
|
|
sum=1.691473
|
|
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,ostype=MT_FLOAT,xtype=MT_FLOAT,nstype=MT_FLOAT
|
|
sum=1.691473
|
|
sum=1.691473
|
|
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729,ostype=MT_FLOAT,xtype=MT_ABSENT,nstype=MT_FLOAT
|
|
sum=1.691473
|
|
sum=2.218599
|
|
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697,ostype=MT_FLOAT,xtype=MT_FLOAT,nstype=MT_FLOAT
|
|
sum=2.218599
|
|
sum=2.830383
|
|
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694,ostype=MT_FLOAT,xtype=MT_FLOAT,nstype=MT_FLOAT
|
|
sum=2.830383
|
|
sum=3.428937
|
|
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006,ostype=MT_FLOAT,xtype=MT_FLOAT,nstype=MT_FLOAT
|
|
sum=3.428937
|
|
sum=3.460379
|
|
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059,ostype=MT_FLOAT,xtype=MT_FLOAT,nstype=MT_FLOAT
|
|
sum=3.460379
|
|
sum=3.963005
|
|
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864,ostype=MT_FLOAT,xtype=MT_FLOAT,nstype=MT_FLOAT
|
|
sum=3.963005
|
|
|
|
mlr put emit @sum; $ostype=typeof(@sum);$atype=typeof($a);@sum += $a; $nstype=typeof(@sum);emit @sum; end { emit @sum } ./reg_test/input/absent.dkvp
|
|
sum=1
|
|
a=1,b=2,ostype=MT_UNINIT,atype=MT_INT,nstype=MT_INT
|
|
sum=1
|
|
sum=
|
|
a=,b=4,ostype=MT_INT,atype=MT_VOID,nstype=MT_VOID
|
|
sum=
|
|
sum=
|
|
x=,b=6,ostype=MT_VOID,atype=MT_ABSENT,nstype=MT_VOID
|
|
sum=
|
|
sum=
|
|
a=7,b=8,ostype=MT_VOID,atype=MT_INT,nstype=MT_VOID
|
|
sum=
|
|
|
|
|
|
================================================================
|
|
NARROW IN
|
|
|
|
|
|
----------------------------------------------------------------
|
|
mlr cat
|
|
x=1
|
|
x=
|
|
x=7
|
|
|
|
mlr put $osum=@sum; $ostype=typeof(@sum);$xtype=typeof($x);@sum += $x; $nstype=typeof(@sum);$nsum=@sum; end { emit @sum }
|
|
x=1,osum=,ostype=MT_UNINIT,xtype=MT_INT,nstype=MT_INT,nsum=1
|
|
x=,osum=1,ostype=MT_INT,xtype=MT_VOID,nstype=MT_VOID,nsum=
|
|
x=7,osum=,ostype=MT_VOID,xtype=MT_INT,nstype=MT_VOID,nsum=
|
|
sum=
|
|
|
|
|
|
----------------------------------------------------------------
|
|
mlr cat
|
|
x=1
|
|
xxx=
|
|
x=7
|
|
|
|
mlr put $osum=@sum; $ostype=typeof(@sum);$xtype=typeof($x);@sum += $x; $nstype=typeof(@sum);$nsum=@sum; end { emit @sum }
|
|
x=1,osum=,ostype=MT_UNINIT,xtype=MT_INT,nstype=MT_INT,nsum=1
|
|
xxx=,osum=1,ostype=MT_INT,xtype=MT_ABSENT,nstype=MT_INT,nsum=1
|
|
x=7,osum=1,ostype=MT_INT,xtype=MT_INT,nstype=MT_INT,nsum=8
|
|
sum=8
|
|
|
|
|
|
----------------------------------------------------------------
|
|
mlr cat
|
|
x=1
|
|
x=
|
|
y=
|
|
x=7
|
|
|
|
mlr --ofs tab put $xtype=typeof($x);$sum = $x + 10; $stype=typeof($sum)
|
|
x=1 xtype=MT_INT sum=11 stype=MT_INT
|
|
x= xtype=MT_VOID sum= stype=MT_VOID
|
|
y= xtype=MT_ABSENT sum=10 stype=MT_INT
|
|
x=7 xtype=MT_INT sum=17 stype=MT_INT
|
|
|