Skip to content

Allow the possibility to optionnaly add "AS" in the From clause for CustomDialect #1784

Open
@rferraton

Description

@rferraton

Some dialect like Oracle do not support "AS" in the from clause and failed for some query :

eg that is working or Oracle :

SELECT SRC.*, SYSDATE AS CopyDate FROM TPCH_IN.ORDERS_FLAT SRC WHERE 1 = 1 AND O_ORDERKEY BETWEEN 100 and 1000

whereas this is not working (on Oracle)

SELECT SRC.*, SYSDATE AS CopyDate FROM TPCH_IN.ORDERS_FLAT AS SRC WHERE 1 = 1 AND O_ORDERKEY BETWEEN 100 and 1000

Currently the sqlparser force the addition of the keyword AS between the table and it's alias even the original query does not contains "AS" in its from clause.

I don't see the ability to create a custom dialect to avoid this behavior.

I am not sure but i think the "problem" could be here :

write!(f, "{} AS {}", self.ident, self.alias)

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