Skip to content

Extend Table & Field Identifier parts #41

Description

@chippyash

In most standard SQL dialects a table identifier is of the form [<schema>.]<tablename> e.g. my_schema.my_table OR simply my_table.

Similarly a field (column) identifier is of the form [<schema>.][<tablename>.]<fieldname> e.g. my_schema.my_table.colname, my_table.colname or simply colname.

Your parser undestands that and will correctly parse these names. I have a use case to parse SQL (select) statements for the Trino SQL dialect that allows:

  • table indentifer: [<catalog>.][<schema>.]<tablename> e.g. rds.events.tasks
  • field indentifier: [<catalog>.][<schema>.][<tablename>.]<fieldname> e.g. rds.events.tasks.id

As it currently stands, parsing

SELECT category, ref, id FROM rds.events.tasks

results in a panic. panic: syntax error at position 58

Is there a way to extend the parser's capability to handle these extended names?

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions