dolphindb 2.0.1030 → 2.0.1031

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser.js CHANGED
@@ -2697,15 +2697,15 @@ export class DDB {
2697
2697
  segments: [],
2698
2698
  };
2699
2699
  let schema;
2700
- let first_message = true;
2701
2700
  const { value: colnames } = await this.call('publishTable', [
2702
2701
  'localhost',
2703
2702
  new DdbInt(0),
2704
2703
  this.streaming.table,
2705
2704
  (this.streaming.action ||= `api_js_${new Date().getTime()}`),
2706
- // new DdbInt(-1), // offset
2707
- // filter
2708
- // allow exists
2705
+ ...this.streaming?.filters?.column ? [
2706
+ new DdbVoid(),
2707
+ this.streaming.filters.column // filter
2708
+ ] : []
2709
2709
  ], {
2710
2710
  skip_connection_check: true,
2711
2711
  // 先准备好收到 websocket message 的 callback
@@ -2715,12 +2715,10 @@ export class DDB {
2715
2715
  const i_topic_end = buffer.indexOf(0, 17);
2716
2716
  // 首个 message 一定是 table schema, 后续消息是 column 片段组成的 any vector
2717
2717
  const data = DdbObj.parse(buffer.subarray(i_topic_end + 1), this.le);
2718
- if (first_message) {
2718
+ if (!schema) {
2719
2719
  schema = data;
2720
- first_message = false;
2721
2720
  return;
2722
2721
  }
2723
- assert(schema, t('流数据订阅后一定先返回 schema'));
2724
2722
  const { rows } = data.value[0];
2725
2723
  win.rows += rows;
2726
2724
  win.segments.push(data);