Hello guys!
I am migrating most part of my codes from pandas to dask due to memory size limitations.
One point that I am struggling new is related to the “read sql” function.
I am trying to read a simple table :
df = dd.read_sql_table('SBB', f'ibm_db_sa://{usr}:{pwd}@XXX.xx.com.br:50100/XXXXX;', index_col='transaction_date')
When reading with pandas, I do not need a index col. I understand that Dask requires one so I coult read the data across parallel queries based on such index (I thought!).
1) Why can´t I use a simple orderable column instead of a indexed column (in my example, I could split the table based on the column date despite of the date columns is not a indexed table)?
2) If I try to read my table anyway, I am getting an error related do lack of access to some system tables. My question is why does dask try to read such information about my table? I see that is somenthing related to autoreflect from SQLA, but why does it need it? Why pandas does not need? :
--------------------------------------------------------------------------- Exception Traceback (most recent call last) File c:\Users\X\AppData\Local\Programs\Python\Python311\Lib\site-packages\ibm_db_dbi.py:1312, in Cursor._execute_helper(self, parameters) [1311](file:///C:/UsersX/AppData/Local/Programs/Python/Python311/Lib/site-packages/ibm_db_dbi.py:1311) try: -> [1312](file:///C:/Users/X/AppData/Local/Programs/Python/Python311/Lib/site-packages/ibm_db_dbi.py:1312) return_value = ibm_db.execute(self.stmt_handler, parameters) [1313](file:///C:/Users/X/AppData/Local/Programs/Python/Python311/Lib/site-packages/ibm_db_dbi.py:1313) if not return_value: Exception: Statement Execute Failed: [IBM][CLI Driver][DB2] SQL0551N The statement failed because the authorization ID does not have the required authorization or privilege to perform the operation. Authorization ID: "XXXX". Operation: "SELECT". Object: "SYSIBM.SYSTABCONST". SQLSTATE=42501 SQLCODE=-551 During handling of the above exception, another exception occurred: ProgrammingError Traceback (most recent call last) File
...
[SQL: SELECT "SYSIBM"."SYSKEYCOLUSE"."CONSTNAME", "SYSIBM"."SYSKEYCOLUSE"."COLNAME" FROM "SYSIBM"."SYSKEYCOLUSE", "SYSIBM"."SYSTABCONST" WHERE "SYSIBM"."SYSKEYCOLUSE"."CONSTNAME" = "SYSIBM"."SYSTABCONST"."CONSTNAME" AND "SYSIBM"."SYSTABCONST"."TBNAME" = ? AND "SYSIBM"."SYSTABCONST"."TBCREATOR" = ? AND "SYSIBM"."SYSTABCONST"."TYPE" = ? ORDER BY "SYSIBM"."SYSKEYCOLUSE"."CONSTNAME"] [parameters: ('SBB', 'schema', 'U')] (Background on this error at: https://sqlalche.me/e/20/f405)