@cubejs-client/core 1.6.38 → 1.6.40

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.
@@ -3034,9 +3034,9 @@ var CubeApi = /*#__PURE__*/function () {
3034
3034
  }, {
3035
3035
  key: "patchQueryInternal",
3036
3036
  value: function patchQueryInternal(query, responseFormat) {
3037
- if (responseFormat === 'compact' && query.responseFormat !== 'compact') {
3037
+ if ((responseFormat === 'compact' || responseFormat === 'columnar') && query.responseFormat !== responseFormat) {
3038
3038
  return _objectSpread(_objectSpread({}, query), {}, {
3039
- responseFormat: 'compact'
3039
+ responseFormat: responseFormat
3040
3040
  });
3041
3041
  } else {
3042
3042
  return query;
@@ -3088,6 +3088,26 @@ var CubeApi = /*#__PURE__*/function () {
3088
3088
  });
3089
3089
  response.results[j].data = data;
3090
3090
  });
3091
+ } else if (response.results[0].query.responseFormat && response.results[0].query.responseFormat === 'columnar') {
3092
+ response.results.forEach(function (result, j) {
3093
+ var _columns$0$length, _columns$;
3094
+ var _ref9 = result.data,
3095
+ columns = _ref9.columns,
3096
+ members = _ref9.members;
3097
+ var rowCount = (_columns$0$length = (_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.length) !== null && _columns$0$length !== void 0 ? _columns$0$length : 0;
3098
+ var data = [];
3099
+ var _loop = function _loop(i) {
3100
+ var row = {};
3101
+ members.forEach(function (m, k) {
3102
+ row[m] = columns[k][i];
3103
+ });
3104
+ data.push(row);
3105
+ };
3106
+ for (var i = 0; i < rowCount; i++) {
3107
+ _loop(i);
3108
+ }
3109
+ response.results[j].data = data;
3110
+ });
3091
3111
  }
3092
3112
  }
3093
3113
  return new ResultSet(response, {
@@ -3157,14 +3177,14 @@ var CubeApi = /*#__PURE__*/function () {
3157
3177
  options = _objectSpread({
3158
3178
  castNumerics: this.castNumerics
3159
3179
  }, options);
3160
- if (responseFormat === 'compact') {
3180
+ if (responseFormat === 'compact' || responseFormat === 'columnar') {
3161
3181
  if (Array.isArray(query)) {
3162
3182
  var patched = query.map(function (q) {
3163
- return _this5.patchQueryInternal(q, 'compact');
3183
+ return _this5.patchQueryInternal(q, responseFormat);
3164
3184
  });
3165
3185
  return [patched, options];
3166
3186
  } else {
3167
- var _patched = this.patchQueryInternal(query, 'compact');
3187
+ var _patched = this.patchQueryInternal(query, responseFormat);
3168
3188
  return [_patched, options];
3169
3189
  }
3170
3190
  }