mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-13 08:01:02 +00:00
skip null field when ingest data
This commit is contained in:
parent
13aeaebe35
commit
7b7f471a18
2 changed files with 15 additions and 1 deletions
|
|
@ -1694,6 +1694,9 @@ func (h *Handler) InputJSONDataParser(req map[string]interface{}, index *Index,
|
|||
for _, action := range field.Actions {
|
||||
frame := action.Frame
|
||||
timestamp := timestampFrame[action.Frame]
|
||||
if req[field.Name] == nil {
|
||||
continue
|
||||
}
|
||||
bit, err := HandleAction(action, req[field.Name], colValue, timestamp)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error handling action: %s, err: %s", action.ValueDestination, err)
|
||||
|
|
|
|||
|
|
@ -1274,6 +1274,16 @@ var defaultBody = `
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"null_value",
|
||||
"actions":[
|
||||
{
|
||||
"frame":"add-ons",
|
||||
"valueDestination":"value-to-row"
|
||||
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"time_value",
|
||||
"actions":[
|
||||
|
|
@ -1307,7 +1317,8 @@ func TestHandler_CreateInput(t *testing.T) {
|
|||
"cabType": "yellow",
|
||||
"distanceMiles": 8,
|
||||
"withPet": true,
|
||||
"time_value": "2017-03-20T19:35"
|
||||
"time_value": "2017-03-20T19:35",
|
||||
"null_value": null
|
||||
}]`)
|
||||
h := test.NewHandler()
|
||||
h.Holder = hldr.Holder
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue