0

我正在使用teradatasql带有 python 的模块进行插入查询并收到此错误。我正在尝试同时运行多个脚本,但我想我不能同时执行多个插入查询?

Traceback (most recent call last):

  File "C:\Users\LAMKAJO\Desktop\Work J\Depot Capacity\Script\pac.py", line 446, in <module>
    new_main.run()

  File "C:\Users\LAMKAJO\Desktop\Work J\Depot Capacity\Script\pac.py", line 440, in run
    tc.map(self.city_calc, self.mp_city_lst)

  File "C:\Users\LAMKAJO\AppData\Local\Continuum\anaconda3\lib\multiprocessing\pool.py", line 268, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()

  File "C:\Users\LAMKAJO\AppData\Local\Continuum\anaconda3\lib\multiprocessing\pool.py", line 657, in get
    raise self._value

  File "C:\Users\LAMKAJO\AppData\Local\Continuum\anaconda3\lib\multiprocessing\pool.py", line 121, in worker
    result = (True, func(*args, **kwds))

  File "C:\Users\LAMKAJO\AppData\Local\Continuum\anaconda3\lib\multiprocessing\pool.py", line 44, in mapstar
    return list(map(*args))

  File "C:\Users\LAMKAJO\Desktop\Work J\Depot Capacity\Script\pac.py", line 242, in city_calc
    self.city_cluster_wk_hrs(df_lrcity,loc_sep[0],loc_sep[1])

  File "C:\Users\LAMKAJO\Desktop\Work J\Depot Capacity\Script\pac.py", line 231, in city_cluster_wk_hrs
    cur.executemany(self.insert_sql_query,dtframe.values.tolist())

  File "C:\Users\LAMKAJO\AppData\Local\Continuum\anaconda3\lib\site-packages\teradatasql\__init__.py", line 896, in executemany
    raise OperationalError (sErr)

OperationalError: [Version 17.0.0.2] [Session 8085885] [Teradata SQL Driver] [Error 528] A failure occurred while executing rows 1 through 12 of a batch request.
 at gosqldriver/teradatasql.(*teradataConnection).makeDriverErrorCode TeradataConnection.go:1120
 at gosqldriver/teradatasql.newTeradataRows TeradataRows.go:396
 at gosqldriver/teradatasql.(*teradataStatement).QueryContext TeradataStatement.go:122
 at gosqldriver/teradatasql.(*teradataConnection).QueryContext TeradataConnection.go:2083
 at database/sql.ctxDriverQuery ctxutil.go:48
 at database/sql.(*DB).queryDC.func1 sql.go:1464
 at database/sql.withLock sql.go:3032
 at database/sql.(*DB).queryDC sql.go:1459
 at database/sql.(*Conn).QueryContext sql.go:1701
 at main.goCreateRows goside.go:654
 at main._cgoexpwrap_212fad278f55_goCreateRows _cgo_gotypes.go:357
 at runtime.call64 asm_amd64.s:574
 at runtime.cgocallbackg1 cgocall.go:316
 at runtime.cgocallbackg cgocall.go:194
 at runtime.cgocallback_gofunc asm_amd64.s:826
 at runtime.goexit asm_amd64.s:2361
Caused by [Version 17.0.0.2] [Session 8085885] [Teradata SQL Driver] Failure receiving Start Response message header
 at gosqldriver/teradatasql.(*teradataConnection).makeDriverError TeradataConnection.go:1101
 at gosqldriver/teradatasql.(*teradataConnection).sendAndReceive TeradataConnection.go:1397
 at gosqldriver/teradatasql.(*TeradataRows).executeSQLRequest TeradataRows.go:526
 at gosqldriver/teradatasql.newTeradataRows TeradataRows.go:388
 at gosqldriver/teradatasql.(*teradataStatement).QueryContext TeradataStatement.go:122
 at gosqldriver/teradatasql.(*teradataConnection).QueryContext TeradataConnection.go:2083
 at database/sql.ctxDriverQuery ctxutil.go:48
 at database/sql.(*DB).queryDC.func1 sql.go:1464
 at database/sql.withLock sql.go:3032
 at database/sql.(*DB).queryDC sql.go:1459
 at database/sql.(*Conn).QueryContext sql.go:1701
 at main.goCreateRows goside.go:654
 at main._cgoexpwrap_212fad278f55_goCreateRows _cgo_gotypes.go:357
 at runtime.call64 asm_amd64.s:574
 at runtime.cgocallbackg1 cgocall.go:316
 at runtime.cgocallbackg cgocall.go:194
 at runtime.cgocallback_gofunc asm_amd64.s:826
 at runtime.goexit asm_amd64.s:2361
Caused by read tcp 10.199.17.157:54103->10.229.115.22:1025: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
4

0 回答 0