Skip to content

Commit 7fc0fee

Browse files
committed
Support underscores in Trino numeric literals
Trino accepts underscores as digit separators, for example 1_000_000, but the Trino dialect rejected them with a parse error. Assisted-by: Claude Code Opus 5.5 <noreply@anthropic.com>
1 parent 223a6ce commit 7fc0fee

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/languages/trino/trino.formatter.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ export const trino: DialectOptions = {
155155
// https://trino.io/docs/current/language/reserved.html
156156
identTypes: ['""-qq'],
157157
paramTypes: { positional: true },
158+
// https://trino.io/docs/current/language/types.html#integer
159+
underscoresInNumbers: true,
158160
operators: [
159161
'%',
160162
'->',

‎test/trino.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('TrinoFormatter', () => {
3333
const format: FormatFn = (query, cfg = {}) => originalFormat(query, { ...cfg, language });
3434

3535
behavesLikeSqlFormatter(format);
36-
supportsNumbers(format);
36+
supportsNumbers(format, { underscore: true });
3737
supportsComments(format);
3838
supportsCommentOn(format);
3939
supportsCreateView(format, { orReplace: true, materialized: true });

0 commit comments

Comments
 (0)