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

Fix #2946: Presto Ingestion issues fix #2986

Merged
merged 5 commits into from Feb 26, 2022

Conversation

ulixius9
Copy link
Member

@ulixius9 ulixius9 commented Feb 25, 2022

Describe your changes :

Fix #2946: Presto Ingestion issues fix

The error [2022-02-25 12:43:58,436] ERROR {metadata.ingestion.source.sql_source:170} - Failed to generate sample data for dbgen_version - (pyhive.exc.DatabaseError) {'message': "Could not serialize column 'dv_create_time' of type 'time(3)' at position 1:3" is a bug with presto and has been fixed in later version of trino.

Although while ingesting presto I noticed datatype related errors

/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'char(16)' of column 'w_warehouse_id'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'varchar(20)' of column 'w_warehouse_name'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'char(10)' of column 'w_street_number'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'varchar(60)' of column 'w_street_name'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'char(15)' of column 'w_street_type'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'char(10)' of column 'w_suite_number'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'varchar(60)' of column 'w_city'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'varchar(30)' of column 'w_county'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'char(2)' of column 'w_state'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'char(10)' of column 'w_zip'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'varchar(20)' of column 'w_country'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))
/Users/mayursingal/Desktop/ulixius1/OpenMetadata/venv/lib/python3.8/site-packages/pyhive/sqlalchemy_presto.py:151: SAWarning: Did not recognize type 'decimal(5,2)' of column 'w_gmt_offset'
  util.warn("Did not recognize type '%s' of column '%s'" % (row.Type, row.Column))

which I've fixed in this PR

Type of change :

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my own.
  • I have tagged my reviewers below.
  • I have commented on my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • All new and existing tests passed.

Reviewers

@harshach @ayush-shah @pmbrull

from metadata.generated.schema.entity.services.databaseService import (
DatabaseServiceType,
)
from metadata.ingestion.ometa.openmetadata_rest import MetadataServerConfig
from metadata.ingestion.source.sql_source import SQLSource
from metadata.ingestion.source.sql_source_common import SQLConnectionConfig

_type_map = {
"boolean": types.Boolean,
"tinyint": mysql.MSTinyInteger,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ulixius9 why are we pointing this to mysql?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sqlalchemy does not support tiny integer datatype, so the sqlalchemy_presto is internally referring to tiny integer datatype of mysql.

@ayush-shah ayush-shah merged commit b211435 into open-metadata:main Feb 26, 2022
@sonarcloud
Copy link

sonarcloud bot commented Feb 26, 2022

[open-metadata-ingestion] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

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

Successfully merging this pull request may close these issues.

Presto Ingestion fails with datetime column
3 participants