使用 Connectorx 阅读 Sql Table?
Read Sql Table using Connectorx?
我正在使用 connectorX 库读取 sql 表并保存为 csv 但遇到奇怪的错误
密码是
import connectorx as cx
MYSQL_READER_HOST = cfg.sql['host']
MYSQL_READER_USERNAME = cfg.sql['user']
MYSQL_READER_PASSWORD = cfg.sql['passwd']
MYSQL_DB_NAME = cfg.sql['db']
tables = ['table1','table2']
for table in tables: #line 52 of my code
print(f'\t => \t Storing {table}')
query = "select /*+ MAX_EXECUTION_TIME(100000000) */ * from "+ table+";"
table = cx.read_sql(f'mysql://{MYSQL_READER_USERNAME}:{MYSQL_READER_PASSWORD}@{MYSQL_READER_HOST}/{MYSQL_DB_NAME}' ,query,partition_num=10)
table.to_csv(os.path.join(store_dir, table + '.csv'), index=False)
我面临的错误
Fatal Python error: none_dealloc: deallocating None
Python runtime state: initialized
Current thread 0x00003d60 (most recent call first):
File "C:\Users\LunchON\Desktop\download_script\util_scripts\data_download_connector_x.py", line 52 in <module>
可以试试版本>=0.2.4-alpha.4
吗?这个问题应该已经解决 https://github.com/sfu-db/connector-x/issues/201
我正在使用 connectorX 库读取 sql 表并保存为 csv 但遇到奇怪的错误 密码是
import connectorx as cx
MYSQL_READER_HOST = cfg.sql['host']
MYSQL_READER_USERNAME = cfg.sql['user']
MYSQL_READER_PASSWORD = cfg.sql['passwd']
MYSQL_DB_NAME = cfg.sql['db']
tables = ['table1','table2']
for table in tables: #line 52 of my code
print(f'\t => \t Storing {table}')
query = "select /*+ MAX_EXECUTION_TIME(100000000) */ * from "+ table+";"
table = cx.read_sql(f'mysql://{MYSQL_READER_USERNAME}:{MYSQL_READER_PASSWORD}@{MYSQL_READER_HOST}/{MYSQL_DB_NAME}' ,query,partition_num=10)
table.to_csv(os.path.join(store_dir, table + '.csv'), index=False)
我面临的错误
Fatal Python error: none_dealloc: deallocating None
Python runtime state: initialized
Current thread 0x00003d60 (most recent call first):
File "C:\Users\LunchON\Desktop\download_script\util_scripts\data_download_connector_x.py", line 52 in <module>
可以试试版本>=0.2.4-alpha.4
吗?这个问题应该已经解决 https://github.com/sfu-db/connector-x/issues/201