Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions integ-test/src/test/resources/clickbench/queries/q29.ppl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ AVG(length(Referer)) AS l, COUNT(*) AS c, MIN(Referer)
FROM hits WHERE Referer <> '' GROUP BY k HAVING COUNT(*) > 100000 ORDER BY l DESC LIMIT 25;
*/
source=hits
| Referer != ''
| eval k = regexp_replace(Referer, '^https?://(?:www\.)?([^/]+)/.*$', '\1')
| stats bucket_nullable=false avg(length(Referer)) as l, count() as c, min(Referer) by k
| where c > 1
| where Referer != ''
| eval k = replace(Referer, '^https?://(?:www\\.)?([^/]+)/.*$', '\\1')
| stats avg(length(Referer)) as l, count() as c, min(Referer) by k
| where c > 100000
| sort - l
| head 25
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ public static byte[] convertToSubstraitAndSerialize(RelNode relNode) {
private static SubstraitRelVisitor createVisitor(RelNode relNode) {
//Mapping of Function names in Calcite to Substrait
List<FunctionMappings.Sig> customSigs = List.of(
new FunctionMappings.Sig(SqlStdOperatorTable.MIN, "min"),
new FunctionMappings.Sig(PPLBuiltinOperators.EXTRACT, "date_part"),
new FunctionMappings.Sig(PPLBuiltinOperators.STRFTIME, "date_format"),
new FunctionMappings.Sig(PPLBuiltinOperators.DATE_FORMAT, "date_format"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ scalar_functions:
value: precision_timestamp<P>
return: i64

aggregate_functions:
- name: min
description: Find the minimum value of a string
impls:
- args:
- name: x
value: string
return: i64
Loading