cube icon indicating copy to clipboard operation
cube copied to clipboard

Fix: Update CubeValidator.js to fix Quarter preaggregation & Updated Query Format Docs

Open PieterVanZyl-Dev opened this issue 2 years ago • 19 comments

Check List

  • [X] Tests has been run in packages where changes made if available
  • [X] Linter has been run for changed code
  • [X] Tests for the changes have been added if not covered yet
  • [X] Docs have been added / updated if required

Issue Reference this PR resolves

#3411

PieterVanZyl-Dev avatar Sep 13 '21 07:09 PieterVanZyl-Dev

Hey @PieterVanZyl-Dev ! Thanks for contributing it! Would really appreciate it if you add a test query in https://github.com/cube-js/cube.js/blob/master/packages/cubejs-testing/test/pre-aggregations-test-case.ts.

paveltiunov avatar Sep 13 '21 21:09 paveltiunov

@paveltiunov I have added a test case for this, I don't know if one will suffice or if I should add 3 (test quarter for mixed and with dimension as well)

PieterVanZyl-Dev avatar Sep 14 '21 06:09 PieterVanZyl-Dev

@PieterVanZyl-Dev Great! I guess it'd be beneficial to add also pre-aggregation with quarter granularity to the fixture schema.

paveltiunov avatar Sep 20 '21 05:09 paveltiunov

Codecov Report

Patch coverage: 100.00% and no project coverage change

Comparison is base (2769200) 42.49% compared to head (e9bba00) 42.49%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3415   +/-   ##
=======================================
  Coverage   42.49%   42.49%           
=======================================
  Files         153      153           
  Lines       20175    20175           
  Branches     5052     5052           
=======================================
  Hits         8574     8574           
  Misses      11284    11284           
  Partials      317      317           
Flag Coverage Δ
cube-backend 42.49% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...bejs-schema-compiler/src/compiler/CubeValidator.js 96.82% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Sep 20 '21 05:09 codecov[bot]

I'll probably have to pull latest and update

Looks like someone optimized cubeValidator before this PR made it in

(Which was something I wanted to do too)

It's not very DRY to have the same regex in multiple places if you can declare it once

I'll update this tomorrow (my personal PC is currently getting an upgrade)

PieterVanZyl-Dev avatar Sep 21 '21 05:09 PieterVanZyl-Dev

@paveltiunov @ovr

Please just check this PR when you have a chance

PieterVanZyl-Dev avatar Oct 04 '21 08:10 PieterVanZyl-Dev

@PieterVanZyl-Dev Seems like the test is failing. Could you please look into it?

paveltiunov avatar Oct 20 '21 01:10 paveltiunov

@PieterVanZyl-Dev Test is failing because Cube Store lacks quarter granularity support. We'd need to add this support as well.

paveltiunov avatar Nov 26 '21 00:11 paveltiunov

@PieterVanZyl-Dev Thanks for the fix and help here! Is there anything I (and my company) can help with to move this one forward? Thank you!

henriblancke avatar Feb 01 '22 15:02 henriblancke

@PieterVanZyl-Dev quarter support has arrived to Cube Store. Could you please rebase this PR and remove the angular part. Tests should be passing then.

paveltiunov avatar Feb 02 '22 06:02 paveltiunov

Great I'll do that on my side later today.

PieterVanZyl-Dev avatar Feb 02 '22 06:02 PieterVanZyl-Dev

@paveltiunov

● postgresql-cubestore › HTTP Transport › Rolling with Quarter granularity

Error: Internal: This feature is not implemented: Invalid input syntax for type interval: "1 quarter"

  147 |         }
  148 |
> 149 |         const error = new RequestError(body.error, body); // TODO error class
      |                       ^
  150 |         if (callback) {
  151 |           callback(error);
  152 |         } else {

  at _callee5$ (../cubejs-client-core/src/index.js:149:23)
  at tryCatch (../../node_modules/regenerator-runtime/runtime.js:63:40)
  at Generator.invoke [as _invoke] (../../node_modules/regenerator-runtime/runtime.js:294:22)
  at Generator.next (../../node_modules/regenerator-runtime/runtime.js:119:21)
  at asyncGeneratorStep (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
  
  
  I'm assuming we're waiting for a version bump on cubestore ?

PieterVanZyl-Dev avatar Feb 03 '22 06:02 PieterVanZyl-Dev

@PieterVanZyl-Dev Yep. Could you please rebase your PR?

paveltiunov avatar Mar 01 '22 05:03 paveltiunov

Will this PR be merged soon?

b-jan avatar May 05 '22 16:05 b-jan

Will this PR be merged soon?

It looks like we're waiting for @PieterVanZyl-Dev to rebase...

rpaik avatar May 05 '22 21:05 rpaik

I also need to use quarter in the trailing of a rolling window. Should it be added here?

rollingWindow.trailing = 1 quarter) does not match regexp: /^(-?\d+) (minute|hour|day|week|month|year)$/

b-jan avatar May 18 '22 15:05 b-jan

Another bug it may solve is the following:

When you write a pre-aggregation, you pick the granularity of the time dimension. If I pick 'day', but want to query my data with granularity 'quarter'. This errors happens : error:Error: Internal: This feature is not implemented: Invalid input syntax for type interval: "1 quarter"

b-jan avatar May 27 '22 12:05 b-jan

@paveltiunov This is blocking me from deploying a quarter feature in production :(

b-jan avatar May 27 '22 15:05 b-jan

hello team. A strong +1 for this PR, we're looking forward to using this feature and would appreciate updates

alepietrobon avatar Sep 07 '22 08:09 alepietrobon

Hey @paveltiunov, is there anything I can do to help get this across the finish line? We would really like quarter granularity as well.

nholmes3 avatar Jan 04 '23 18:01 nholmes3

Closing this PR due to this: https://github.com/cube-js/cube.js/pull/6285

buntarb avatar Mar 13 '23 20:03 buntarb