Skip to content

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

@albertxtran

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

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