MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / doBatchRowRequest

Method doBatchRowRequest

src/sdk/python/fedb/driver.py:210–246  ·  view source on GitHub ↗
(self, db, sql, commonCol, parameters)

Source from the content-addressed store, hash-verified

208
209
210 def doBatchRowRequest(self, db, sql, commonCol, parameters):
211 ok, requestRow = self.getRequestBuilder(db, sql)
212 if not ok:
213 return ok, "get request builder fail"
214 schema = requestRow.GetSchema()
215 commonCols = sql_router_sdk.ColumnIndicesSet(schema)
216 count = schema.GetColumnCnt()
217 commnColAddCount = 0
218 for i in range(count):
219 colName = schema.GetColumnName(i)
220 if colName in commonCol:
221 commonCols.AddCommonColumnIdx(i)
222 commonColAddCount+=1
223 if commnColAddCount != len(commonCol):
224 return False, "some common col is not in table schema"
225 requestRowBatch = sql_router_sdk.SQLRequestRowBatch(schema, commonCols)
226 if requestRowBatch is None:
227 return False, "generate sql request row batch fail"
228 if isinstance(parameters, dict):
229 ok, msg = self._append_request_row(requestRow, schema, parameters)
230 if not ok:
231 return ok, msg
232 requestRowBatch.AddRow(requestRow)
233 else:
234 for d in parameters:
235 ok, msg = self._append_request_row(requestRow, schema, d)
236 if not ok:
237 return ok, msg
238 requestRowBatch.AddRow(requestRow)
239 ok, requestRow = self.getRequestBuilder(db, sql)
240 if not ok:
241 return ok, "get request builder fail"
242 status = sql_router_sdk.Status()
243 rs = self.sdk.ExecuteSQLBatchRequest(db, sql, requestRowBatch, status)
244 if status.code != 0:
245 return False, status.msg
246 return True, rs

Callers 1

batch_row_requestMethod · 0.80

Implementers 1

SQLDriversrc/sdk/java/sql-jdbc/src/main/java/co

Calls 9

getRequestBuilderMethod · 0.95
AddCommonColumnIdxMethod · 0.95
_append_request_rowMethod · 0.95
AddRowMethod · 0.95
ColumnIndicesSetMethod · 0.80
SQLRequestRowBatchMethod · 0.80
GetSchemaMethod · 0.45
StatusMethod · 0.45

Tested by

no test coverage detected