File: select_mixture_of_array_literals.sql

package info (click to toggle)
sqlfluff 3.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,000 kB
  • sloc: python: 106,131; sql: 34,188; makefile: 52; sh: 8
file content (15 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- Created this test case in response to issue #989. As of April 25, 2021 and PR #998,
-- this query PARSES without error, but the word ARRAY is parsing as a column name, and
-- the angle brackets  < and > are being incorrectly parsed as comparison operators.
-- This is being tracked in a separate issue, 999, not #989, since it's less severe
-- (incorrect parse vs parse failure).
SELECT
    [],
    [false],
    ARRAY<BOOLEAN>[false],
    ['a'] AS strcol1,
    ARRAY<string>['b'] AS strcol2,
    [1.0] AS numcol1,
    ARRAY<NUMERIC>[1.4] AS numcol2,
    [STRUCT("Rudisha" AS name, [23.4, 26.3, 26.4, 26.1] AS splits)] AS struct1,
    col1.obj1[safe_offset(1)].a AS struct_safe_offset