Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import: No support of AWS Athena (Trino) DDLs #332

Closed
roykoand opened this issue Jul 17, 2024 · 4 comments
Closed

Import: No support of AWS Athena (Trino) DDLs #332

roykoand opened this issue Jul 17, 2024 · 4 comments

Comments

@roykoand
Copy link
Contributor

It's not an issue of this project but of the underlying dependency - simple_ddl_parser (https://github.com/xnuinside/simple-ddl-parser)

It does not have support of DDLs generated by AWS Athena (SHOW CREATE TABLE).

Using this DDL as an example:

CREATE EXTERNAL TABLE `database`.`table` (
    column1 string,
    column2 string
)
PARTITIONED BY
(
    column3 integer
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION 's3://somewhere-in-s3/prefix1'
TBLPROPERTIES (
  'parquet.compression'='GZIP'
)
$ datacontract import --format sql --source aws_athena_ddl.sql
...
DDLParserError: Unknown symbol "'"

If you delete everything except columns definitions, it's still providing an invalid output:

CREATE EXTERNAL TABLE `database`.`table` (
    column1 string,
    column2 string
)
PARTITIONED BY
(
    column3 integer
)
$ datacontract import --format sql --source aws_athena_ddl.sql
dataContractSpecification: 0.9.3
id: my-data-contract-id
info:
  title: My Data Contract
  version: 0.0.1
models:
  '`table`':
    type: table
    fields:
      column1:
        type: string
      column2:
        type: string
@jochenchrist
Copy link
Contributor

Thanks for reporting.
I think best way is to open n issue (and maybe even PR) at simple_ddl_parser

roykoand could you do so?

@roykoand
Copy link
Contributor Author

@jochenchrist Sure! Just created a feature request in their repo: xnuinside/simple-ddl-parser#272

@xnuinside
Copy link

fyi: was fixed in version 1.6.0 in simple-ddl-parser

@jochenchrist
Copy link
Contributor

Merged #372

@roykoand
Could you test with the current main version, if this solves your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants