ParseError when table name is prefixed with a # (Redshift) #1419
-
Hey, just got started using I just encountered a parsing issue when a table is prefixed with a Imagine a scenario where a temp table was created called
Error:
What would be some ways to handle this? Can I modify this parsing behavior with the Dialect interface e.g. modifying Redshift or subclassing it? Does something need to change deeper under the hood with how the parser works? At a high level, when the parser expects a Table, it should also allow for a Hash token as part of the Table Name (I think T-SQL even allows for double hashes iirc). I'm new to working with ASTs, let alone new to this specific project, but open to working on a PR, if applicable. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey, welcome and thanks for taking the time to report this issue! There was an easy fix for this so I went ahead and pushed it already (cc7691c). We'd already implemented this logic for T-SQL (https://github.com/tobymao/sqlglot/blob/main/sqlglot/dialects/tsql.py#L271). |
Beta Was this translation helpful? Give feedback.
Hey, welcome and thanks for taking the time to report this issue! There was an easy fix for this so I went ahead and pushed it already (cc7691c). We'd already implemented this logic for T-SQL (https://github.com/tobymao/sqlglot/blob/main/sqlglot/dialects/tsql.py#L271).