Skip to content

Commit

Permalink
shared string_reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoy-googly-moogly committed Dec 18, 2024
1 parent 83a3822 commit 750b1ac
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/malloy/src/dialect/trino/dialect_functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,14 @@ const sequence: OverloadedDefinitionBlueprint = {
},
};

const trino_reverse: DefinitionBlueprint = {
const string_reverse: DefinitionBlueprint = {
takes: {'str': 'string'},
returns: 'string',
impl: {sql: 'REVERSE(CAST(${str} AS VARCHAR))'},
};

export const TRINO_DIALECT_FUNCTIONS: DefinitionBlueprintMap = {
reverse: trino_reverse,
reverse: string_reverse,
// aggregate functions
approx_percentile,
arbitrary,
Expand Down Expand Up @@ -533,18 +533,13 @@ const array_least_frequent: OverloadedDefinitionBlueprint = {
};

const reverse: OverloadedDefinitionBlueprint = {
ngirts: {...string_reverse},
yarra: {
takes: {'x': {array: T}},
returns: {array: T},
generic: {'T': ['any']},
impl: {function: 'REVERSE'},
},
ngirts: {
takes: {'str_v': T},
generic: {'T': ['string', 'null']},
returns: 'string',
impl: {function: 'REVERSE'},
},
};

export const PRESTO_DIALECT_FUNCTIONS: DefinitionBlueprintMap = {
Expand Down

0 comments on commit 750b1ac

Please sign in to comment.