Skip to content

Commit

Permalink
More capabilities to csv-spec files
Browse files Browse the repository at this point in the history
  • Loading branch information
astefan committed Oct 4, 2024
1 parent 786daa6 commit 5000836
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ wkt:keyword
;

centroidOfNull
required_capability: extend_aggs_on_constants_support
FROM airports
| eval z = TO_GEOPOINT(null)
| STATS centroidNull = ST_CENTROID_AGG(null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,7 @@ row foo="unused"
;

statsOfPropagateableConstOnIndex
required_capability: extend_aggs_on_constants_support
from employees
| eval mv=[1,2,3]
| stats avg = avg(mv),
Expand Down Expand Up @@ -2072,6 +2073,7 @@ COUNT_DISTINCT(c):long|COUNT_DISTINCT(null):long|COUNT_DISTINCT(null - 1):long|a
;

countDistinctWithGrouping
required_capability: extend_aggs_on_constants_support
from employees
| EVAL c = 5 + 6, d = 6 + null, e = [1,2,2]
| STATS `cd(5+6)`=COUNT_DISTINCT(c),
Expand All @@ -2088,6 +2090,7 @@ cd(5+6):long |cd(null):long |cd(null-1):long|cd(eval_null):long|cd(mv):long |
;

countWithGrouping
required_capability: extend_aggs_on_constants_support
from employees
| EVAL a = 5 + 6,
b = 6 + null,
Expand Down Expand Up @@ -2408,40 +2411,36 @@ m:integer |a:double |x:integer
valuesOfConstants
required_capability: extend_aggs_on_constants_support
row mv_int = [1,2,3,2], string = "abc", mv_string = ["bar","foo"], null_exp = 234 + null, to_be_casted_ip = "127.0.0.1", row_null = null
| stats values(null), values(mv_int), values(string), values(mv_string), values(null_exp), values(123 + null), values(to_be_casted_ip::ip), values(row_null)
;
| stats values(null), values(mv_int), values(string), values(mv_string), values(null_exp), values(123 + null), values(to_be_casted_ip::ip), values(row_null);

values(null):null|values(mv_int):integer|values(string):keyword|values(mv_string):keyword|values(null_exp):integer|values(123 + null):integer|values(to_be_casted_ip::ip):ip|values(row_null):null
null |[1, 2, 3] |abc |[bar, foo] |null |null |127.0.0.1 |null
;

byFoldableValueFromEval
from employees | eval y = 5 + 6 | stats max(salary) by y
;
from employees | eval y = 5 + 6 | stats max(salary) by y;

max(salary):integer|y:integer
74999 |11
;

byFoldableValueInline
from employees | stats max(salary) by 5+6
;
from employees | stats max(salary) by 5+6;

max(salary):integer| 5+6:integer
74999 |11
;

byFoldableValueInlineWithAlias
from employees | stats max(salary) by y=5+6
;
from employees | stats max(salary) by y=5+6;

max(salary):integer| y:integer
74999 |11
;

byAndMaxFoldableValues
from employees | eval x = [1,2,3], y = 5 + 6 | stats max(x) by y
;
required_capability: extend_aggs_on_constants_support
from employees | eval x = [1,2,3], y = 5 + 6 | stats max(x) by y;

max(x):integer|y:integer
3 |11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ count_distinct(salary, x*100):long
;

foldablePrecisionWithGroupings
required_capability: extend_aggs_on_constants_support
from employees | eval x = 82+8 | stats cd1=count_distinct(salary, x*100), cd2=count_distinct(salary, 10+10) by gender, languages | sort gender, languages;

cd1:long | cd2:long |gender:keyword |languages:integer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
madOfNulls
required_capability: extend_aggs_on_constants_support
row x = null::integer, y = null, z = 123 - null, a = [1,2,3], b = 5
| stats x = MEDIAN_ABSOLUTE_DEVIATION(x),
y = MEDIAN_ABSOLUTE_DEVIATION(y),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
percentileOfNull
required_capability: extend_aggs_on_constants_support
row x = null::integer, y = null, z = 123 - null
| stats percIntNull = percentile(y, 90),
percNull = percentile(y, 90),
Expand Down Expand Up @@ -286,6 +287,7 @@ constant_single:double
;

foldablePercentileValue
required_capability: extend_aggs_on_constants_support
from employees | eval x = 82+8 | stats percentile(salary, x), percentile(salary, 90);

percentile(salary, x):double|percentile(salary, 90):double
Expand All @@ -294,6 +296,7 @@ percentile(salary, x):double|percentile(salary, 90):double


foldablePercentileValue_WithGrouping
required_capability: extend_aggs_on_constants_support
from employees | eval x = 82+8 | stats percentile(salary, x), percentile(salary, 90) by languages | sort languages desc;

percentile(salary, x):double|percentile(salary, 90):double|languages:integer
Expand All @@ -318,6 +321,7 @@ null |null |null
;

nullPercentileValue_WithGrouping
required_capability: extend_aggs_on_constants_support
from employees
| eval x = null + 1
| stats pNull = percentile(salary_change, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ ROW d=-9.81, i=25324, l=TO_LONG(-9)

topRowWithNull
required_capability: agg_top
required_capability: extend_aggs_on_constants_support
ROW d=-9.81, i=25324, l=TO_LONG(-9), n=null
| EVAL x=d+1+null, y=i/2+n, z=l+3, t=null
| STATS double = TOP(x, 2, "asc"),
Expand All @@ -71,6 +72,7 @@ null |-6 |null |null |null |

topRowWithNull_WithBY
required_capability: agg_top
required_capability: extend_aggs_on_constants_support
ROW d=-9.81, i=25324, l=TO_LONG(-9), n=null, `by` = [1,2,3]
| EVAL x=d+1+null, y=i/2+n, z=l+3, t=null
| STATS double = TOP(x, 2, "asc"),
Expand Down

0 comments on commit 5000836

Please sign in to comment.