Using Timeseries.fromObjStream


#1

I’m having some issues with using Timeseries.fromObjStream Here’s what I’m calling:

 var stream = MyFileTimedDataPoint.fetchObjStream({
    filter: Filter.eq('parent.id', parentId),
    limit: -1,
    timeRange: {
      start: spec.start,
      end: spec.end
    }
  });

  var tsEvalOptions = TSEvalOptions.make({
    start: spec.start,
    end: spec.end,
    interval: spec.interval
  });

  var timeseriesSpec = AsTimeseriesSpec.make({
    treatment: treatment,
    startPath: "start",
    valuePath: "value"
  });

c3Viz(Timeseries.fromObjStream(stream, tsEvalOptions, timeseriesSpec))

I get the following error when running this code:

Error: Expecting specific type for fields with ‘any’, ‘anyof’ or ‘Obj’ type at JSON document at 1:21 at new C3.client.ActionError (http://localhost:8080/typesys/1/all.js?env=browser&compat:1130:13) at Object.request (http://localhost:8080/typesys/1/all.js?env=browser&compat:882:15) at Object.call (http://localhost:8080/typesys/1/all.js?env=browser&compat:567:27) at c3Call (http://localhost:8080/typesys/1/all.js?env=browser&compat:100:20) at Object._call (http://localhost:8080/typesys/1/all.js?env=browser&compat:2764:20) at Object.eval (eval at get (http://localhost:8080/typesys/1/all.js?env=browser&compat:3177:20), <anonymous>:5:15) at <anonymous>:1:12

Everything works fine when calling collect() on the stream and using fromObjs() though:

Timeseries.fromObjs(
  ObjArry.make({ value: stream.collect() }),
  tsEvalOptions,
  timeseriesSpec
);

Is there something I’m missing when using Timeseries.fromObjStream?


#2

This seems like it should work. It would help if we can get the actual stack trace from splunk for this. From the surface, it seems like there is a field with value type any, anyof or Obj but it has not been serialized correctly.