Spade A 0dc21f0aeb
feat: support random sample (#39532)
issue: #39541

This PR implements random sample, the syntax is:
```
filter="random_sample(factor)"
or 
filter="boolean_expression && random_sample(factor)"

where 
factor is a float between (0, 1) and 
boolean_expression is like
 "1 <= number < 10", "color in ["read, "blue"]" or others
```

---------

Signed-off-by: SpadeA-Tang <tangchenjie1210@gmail.com>
Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
2025-02-18 12:40:50 +08:00

80 lines
749 B
Plaintext

T__0=1
T__1=2
T__2=3
T__3=4
T__4=5
LBRACE=6
RBRACE=7
LT=8
LE=9
GT=10
GE=11
EQ=12
NE=13
LIKE=14
EXISTS=15
TEXTMATCH=16
PHRASEMATCH=17
RANDOMSAMPLE=18
ADD=19
SUB=20
MUL=21
DIV=22
MOD=23
POW=24
SHL=25
SHR=26
BAND=27
BOR=28
BXOR=29
AND=30
OR=31
ISNULL=32
ISNOTNULL=33
BNOT=34
NOT=35
IN=36
EmptyArray=37
JSONContains=38
JSONContainsAll=39
JSONContainsAny=40
ArrayContains=41
ArrayContainsAll=42
ArrayContainsAny=43
ArrayLength=44
BooleanConstant=45
IntegerConstant=46
FloatingConstant=47
Identifier=48
Meta=49
StringLiteral=50
JSONIdentifier=51
Whitespace=52
Newline=53
'('=1
')'=2
'['=3
','=4
']'=5
'{'=6
'}'=7
'<'=8
'<='=9
'>'=10
'>='=11
'=='=12
'!='=13
'+'=19
'-'=20
'*'=21
'/'=22
'%'=23
'**'=24
'<<'=25
'>>'=26
'&'=27
'|'=28
'^'=29
'~'=34
'$meta'=49