Skip to content

Import from Oracle generates invalid logical type options: precision and scale #1074

@yelizp

Description

@yelizp

When I generate a contract from an Oracle ddl, using datacontract-cli import command as:
datacontract import --format sql --source dummy.sql --dialect oracle --output dummy.yaml

and then run datacontract-cli test as:
datacontract-cli test --server prod dummy.yaml

the command fails with:

ERROR:root:Run operation failed: [lint] Check that data contract YAML is valid - None - ResultEnum.failed - data.schema[0].properties[4].logicalTypeOptions must not contain {'precision', 'scale'} properties - datacontract
WARNING:root:Data Contract YAML is invalid. Validation error: data.schema[0].properties[4].logicalTypeOptions must not contain {'precision', 'scale'} properties

Below is the related schema property from the generated yaml:

  • name: CUSTOMER_NUMBER
    physicalType: NUMBER(9, 0)
    logicalType: number
    logicalTypeOptions:
    precision: 9
    scale: 0

If I remove the precision and scale manually, the test commands now fails stating:

data contract is invalid, found the following errors:

  1. CUSTOMER_NUMBER Check that field CUSTOMER_NUMBER has type NUMBER(9, 0): Type Mismatch, Expected Type: NUMBER(9, 0);
    Actual Type: NUMBER

Metadata

Metadata

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