MCPcopy
hub / github.com/uber/aresdb / checkPrimaryKeys

Function checkPrimaryKeys

client/connector.go:250–259  ·  view source on GitHub ↗

checkPrimaryKeys checks whether primary key is missing

(schema *TableSchema, columnNames []string)

Source from the content-addressed store, hash-verified

248
249// checkPrimaryKeys checks whether primary key is missing
250func checkPrimaryKeys(schema *TableSchema, columnNames []string) error {
251 for _, columnID := range schema.Table.PrimaryKeyColumns {
252 pkColumn := schema.Table.Columns[columnID]
253 index := utils.IndexOfStr(columnNames, pkColumn.Name)
254 if index < 0 {
255 return utils.StackError(nil, "Missing primary key column")
256 }
257 }
258 return nil
259}
260
261// checkTimeColumnExistence checks if time column is missing for fact table
262func checkTimeColumnExistence(schema *TableSchema, columnNames []string) error {

Callers 1

prepareUpsertBatchMethod · 0.85

Calls 2

IndexOfStrFunction · 0.92
StackErrorFunction · 0.92

Tested by

no test coverage detected