Skip to content

[FORMATTING] Additional line breaks are added to "timestamp with timezone" #936

Closed

Description

@albertxtran

Input data

Which SQL and options did you provide as input?

select * from catalog.schema.table for timestamp as of cast('2023-01-01 00:00:00.000 UTC' as timestamp with time zone);

Expected Output

select
  *
from
  catalog.schema.table for timestamp as of cast(
    '2023-01-01 00:00:00.000 UTC' as timestamp with time zone
  );

Actual Output

select
  *
from
  catalog.schema.table for timestamp as of cast(
    '2023-01-01 00:00:00.000 UTC' as timestamp
    with
      time zone
  );

Usage

  • How are you calling / using the library?
import { format } from 'sql-formatter';

export function queryFormatter(query) {
  try {
    return format(query || '', { language: 'trino' });
  } catch (_) {
    return query;
  }
  • Which SQL Formatter version are you using? (The exact version number.)
    15.7.2

This issue is similar to this one and just needs to be fixed for trino: #618

Activity

  1. nene commented on Mar 12, 2026

    @nene
    Collaborator

    Thanks for reporting. Yep, should be a trivial fix.

  2. added a commit that references this issue on Mar 28, 2026
    911bfb0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions