question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Struct is not parsing correctly

See original GitHub issue
SELECT
  my_struct.field1.field2
FROM
  `table`

my_struct is parsed as a table.

(SELECT expressions: 
  (DOT this: 
    (COLUMN this: 
      (IDENTIFIER this: field1, quoted: False), table: 
      (IDENTIFIER this: my_struct, quoted: False)), expression: 
    (IDENTIFIER this: field2, quoted: False)), from: 
  (FROM expressions: 
    (TABLE this: 
      (IDENTIFIER this: table, quoted: True))))

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
tobymaocommented, Jul 11, 2022

STRUCT_EXTRACT

let’s not close this yet, let me think about it for a day

        self.validate(
            "STRUCT_EXTRACT(STRUCT_EXTRACT(x, 'y'), 'abc')",
            "x.`y`.`abc`",
            read="duckdb",
            write="spark",
        )
0reactions
tobymaocommented, Jul 12, 2022

this cannot be done at the parser stage because i have no context of what the fields are, this would have to be done in the sqlglot optimizer, closing for now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parse Error from Converting Json String to Struct
@user3236289 your Json is not a valid Json. Also answer is true. To unmarshall Json, export your struct fields. So use capital letters....
Read more >
C Parser Does Not Parse A Simple Struct · Issue #1069 - GitHub
I encountered a simple struct that could not be parsed. The struct is defined in a XNU header file. All data types are...
Read more >
Input parser for functions - MATLAB - MathWorks
The parsing fails because the function receives arguments in the incorrect order and tries to assign name a value of 78 . This...
Read more >
The Basics — Construct 2.10 documentation - Read the Docs
A Struct is a collection of ordered and usually named fields (field means an instance of Construct class), that are parsed/built in that...
Read more >
Understanding Success Criterion 4.1.1: Parsing
If the content cannot be parsed into a data structure, then different user agents may present it differently or be completely unable to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found