davidagold / StructuredQueries.jl

Query representations for Julia
Other
53 stars 5 forks source link

Fairly large refactor #26

Closed davidagold closed 7 years ago

davidagold commented 7 years ago

This PR refactors... well, nearly everything. The main impetus for the present work was the complexity associated with doing half of the graph generation at macroexpand-time and half at run-time. Now, all of the graph-generation (except for generating the expressions defining QueryHelpers) occurs at run-time, which actually leads to a great simplification of the code responsible for generating QueryHelper objects.

In the previous regime, because the actual QueryNode graph was generated at macroexpand time, leaf DataNode objects could not wrap actual data sources (e.g. DataFrames) when they were created. This required an awkward system of "setting" actual sources in a DataNode at collect-time. Not only is this system awkward, but it did not scale well as the number of data sources involved in a query increased beyond one. This PR obviates that system. It also does away with the whole "dummy source" system, which, as noted here, is superfluous.

Query objects now only wrap QueryNode graphs -- they do not wrap sources and hence the Query type is no longer parametric. Since the original collect machinery slightly depended on dispatching on the type parameter S, this will need to be rethought. That should be a fairly straightforward revision.

codecov-io commented 7 years ago

Current coverage is 70.83% (diff: 94.52%)

Merging #26 into master will increase coverage by 8.92%

@@             master        #26   diff @@
==========================================
  Files            28         24     -4   
  Lines           336        240    -96   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits            208        170    -38   
+ Misses          128         70    -58   
  Partials          0          0          

Powered by Codecov. Last update 3f14806...e3bc32f