-
Notifications
You must be signed in to change notification settings - Fork 155
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
DB2 sql_database source | dlt queries wrong system tables for iseries #1858
Comments
Hi @jeff-skoldberg-gmds
where "db2inst1" is name of the schema and also the name of the user (which is also the name of server instance). |
I should have mentioned, when I connect using the Traceback:
The IT department said I must use the specific driver, which avoids the licensing problem. They said I must use pyodbc with this driver: I'm able to read tables using sqlalchemy + pyodbc (not using dlt):
this works. Bringing this into to dlt...
The connection is definitely successful, but it fails at the schema reflection step, because this is iseries as/400, it uses different system tables. It is expecting tables in Then I discovered another adaptor: In theory this should tell sqlalchemy the correct system tables to use for schema reflection. But, it will not let you pass a database parameter which dlt requires. SummaryAt this point I understand it is a sqlalchemy issue and not a dlt issue. But I can at least query tables in sqlalchemy + pyodbc outside of dlt, so I would hope there is a way to do it with dlt. But schema reflection will always fail because of the type of DB2 isntance. Any further suggestions? |
Thanks for this info.
you'd need to
and see if it populates. there's still a chance the
|
@rudolfix , this is fantastic, it gives me a few things to try. I will update you. Thanks again. |
YES! This works:
|
Thanks @rudolfix for putting in this fix! I was wondering, at what point is the fix available via PyPi so I can install with |
dlt version
1.0.0
Describe the problem
I'm connecting to DB2 iseries using this basic code:
I get this traceback:
ChatGPT suggested the following:
This new error (SQL0204 - TABLES in SYSCAT type *FILE not found) indicates that the query you're running is targeting the wrong system catalog or metadata structure. IBM Db2 for i5/OS (also known as Db2 for iSeries or AS/400) uses a different system catalog structure compared to Db2 LUW (Linux/Unix/Windows), which is why the SYSCAT.TABLES catalog might not exist on your iSeries system.
The error happens because SQLAlchemy is trying to query the SYSCAT.TABLES catalog, which exists in Db2 LUW but does not exist in Db2 for i5/OS (IBM i).
Db2 for iSeries (IBM i) uses a different system catalog, which stores metadata differently (typically in the QSYS2 library).
What can we do to resolve this?
Expected behavior
No response
Steps to reproduce
run the pipeline pasted above while connected to iseries AS/400
Operating system
Linux
Runtime environment
Local
Python version
3.10
dlt data source
sql_database
dlt destination
No response
Other deployment details
duckdb until this works...
Additional information
No response
The text was updated successfully, but these errors were encountered: