Commit graph

7709 commits

Author SHA1 Message Date
tgruben
170dda1145
Merge branch 'master' into ingesttool 2021-09-03 09:11:25 -05:00
rachithrr
43b34c7d84 CORE-747: Build tooling to provide datagen-like functionality that uses the API
Featurebase
2021-09-02 10:18:50 -04:00
Ben Johnson
408e3f84b3
Merge pull request #1679 from molecula/sql-where
CORE-808: Handle SQL WHERE clause
2021-08-26 08:44:15 -06:00
Ben Johnson
6bf854862b Handle SQL WHERE clause 2021-08-26 08:25:16 -06:00
seebs
397f90896b
Prototype ingest API
This is the prototype of the new JSON ingest API. It's not for external use yet, it's still experimental.
2021-08-20 13:26:36 -05:00
Seebs
bb1d52a385 ingest and ingest/codec testing work
This is a design to let us write test cases for ingest with schema setup
and data in the json formats we want to use, and results as alternating
queries and expected results, so we can just create new test files and
run the tests against them. We also have to report back what we created
when creating things.

In the process of developing this, I noticed that the documentation describes
ingest schema as allowing more than one schema operation, but we didn't support
this, and also it wouldn't do much good because there was no way to do partial
things like "just add a field". Fixed.

Also we implement comparison for ops, so the test output is actually
a test rather than just some data to visually eyeball.

In the process, realize that the handling of timestamps was wrong; we said that we
take them as raw numbers relative to the epoch, not as raw Unix timestamps.

Also a couple of related cleanups caught by doing the testing.
2021-08-19 09:50:59 -05:00
nagamocha3000
3185fe4181 Add schema endpoint
This adds the schema and ingest endpoints. (Code actually by Brandon,
seebs just squashed the commits.)
2021-08-19 09:50:59 -05:00
Seebs
e167f1c7fa fancier shard-sorting
This is a rework of Nia's radix sort. Still using stdlib sort for the
tail ends of things, and should probably replace it at some point
because it's still woefully inefficient, but this gets decent
performance, and lets us do the fancy thing of doing quick partial
sorting by record-key-only to get to shards, then deciding whether
to sort by value-then-record (as for a set field) or just by record
(as for int fields), which lets us reduce the amount of re-sorting
the same data by different criteria we do.

We also use a messy code-duplication basically-bubblesort for the
inner loops because it's much cheaper for small N.

This also lets us use field-aware sorting for shards, sorting them
correctly for a corresponding field type, and add corresponding API
support and fragment support for an option to tell the fragment
code that we already ordered things in the order that's most
efficient there, to avoid a second sort that we don't otherwise
need.
2021-08-19 09:50:59 -05:00
Seebs
016765d8a2 Prototype ingest API
This partially-implemented prototype of the ingest API is based on our
programmatic ingest API reference. It has noticable limitations, most
crucially that it doesn't handle multi-node clusters right now. However,
it basically implements the expected semantics.

There's some noticeable performance issues to do with the high overhead
of sorting bits in order to import them efficiently, but this is fixable.

We also add the hooks to the internal client, and make the finisher logic
a bit smarter.

Much of this code was originally by Nia Weiss, but it's been merged
and restructured a bit to get things broken into logical commits.
2021-08-19 09:50:59 -05:00
Matthew Jaffee
61f3fa23b0
Merge pull request #1676 from seebs/prep
ingest API prep work
2021-08-19 09:08:28 -05:00
Seebs
423cddbdbb avoid allocations in viewsByTime
This is sort of horrible, but viewsByTime was about 25% of total CPU time in
the ingest path, NOT including increased GC overhead. This overoptimized
approach to letting us recycle a buffer, and use the same buffer for multiple
time views at once, reduces that to about 2.5%. Sorry for the mess.

We also streamline the process of building the per-view data sets a bit,
and streamline it a lot in the non-time-quantum case.
2021-08-18 13:45:36 -05:00
Seebs
f019cc7409 make import correctly reflect that it needs a single shard always
In fact, we have a number of things assuming that values passed to Import
always fit within a single known shard, so, drop all the extra complexity
around this, drop the computation of fancy view/shard keys, and so on.

There's a lot of room left to improve this probably but it's at least
better, I think.

Unfortunately, there's a handful of things, basically all of which are
test cases, which were relying on this, so, we also add functionality
for splitting import requests by shards. But this allows us to stop
duplicating each shard's inputs one at a time... which turns out to
mean that we now care that the import operation can write back to the
import request. This only affects test cases, so we adopt a crufty
hack involving cloning import requests in those rare cases, and also
when reusing the same column IDs to write to the existence field that
we'd be using later to write to another field.

Note that even if we weren't overwriting the column IDs with positions,
we'd be sorting the column/row ID lists by row-then-column, which means
we'd still be corrupting the column ID lists. This may want to change
at some point.

We also reuse a single Tx for all the views, because DB-per-shard
means that should work fine, and reduces the cost of doing these
updates, probably.
2021-08-18 13:45:36 -05:00
Seebs
6af987a5ba fix error formatting/spelling
Go convention is that error messages don't end with periods and
don't start with capital letters.
2021-08-18 13:45:36 -05:00
Seebs
ab9b70d7e8 mapperLocal: actually leave loop on read from done channel
staticcheck points out that the break is otherwise an ineffective
break because it just ends the current case clause of the switch
it's in, which is true.
2021-08-18 13:45:36 -05:00
Seebs
1745a93aee allow "us" for microseconds in timestamp units
The convention of using a "u" for "micro" is pretty well-established and some
people will have trouble typing the Greek letter, accept that as a synonym.
2021-08-18 13:45:36 -05:00
Seebs
e768fc89ea stop using pointers to time.Time
We're reading timestamps as []int64, instead of allocating a time.Time
for each timestamp, just use the same logic to determine whether to use the
int64 timestamp that we would have used to decide whether to allocate it.
We still have to check the whole run, though, because we're providing a large
list of 0s instead of "no timestamps", for Reasons.
2021-08-18 13:45:36 -05:00
Seebs
35faa39b20 don't use nil qcx
A nil Qcx is a crime against existence and makes baby pandas cry.

Having taken out the hack that tried to accommodate this when tests did it,
we now have to fix the tests. Oh no.
2021-08-18 13:45:36 -05:00
Seebs
dab8dff9c2 make "subdivide list by shardwidth" available for reuse
We keep wanting this, and it's shardwidth-dependent code, and we keep rewriting it.
It should be in the shardwidth package.
2021-08-18 13:45:20 -05:00
Seebs
7b27a48d7c allow Molecula copyrights 2021-08-17 15:23:31 -05:00
Ben Johnson
409d59e297
Merge pull request #1675 from molecula/sql-count
CORE-806: Implement basic SQL COUNT(*) query
2021-08-17 14:12:40 -06:00
Ben Johnson
702f55964f Add apt-get update flag 2021-08-17 07:21:40 -06:00
Ben Johnson
5122c2decc Refactor SQL planner to inside Server 2021-08-16 13:12:16 -06:00
Ben Johnson
9b8dc3d7e6 Implement basic SQL COUNT(*) query 2021-08-13 10:41:39 -06:00
Matthew Jaffee
dac6234d0d
Merge pull request #1671 from jaffee/differentiate-map-error
differentiate error messages between opening file and mapping it
2021-08-09 12:27:22 -05:00
Matthew Jaffee
207634aea3 differentiate error messages between opening file and mapping it 2021-08-09 11:42:25 -05:00
Matthew Jaffee
54a4c2a587
Merge pull request #1663 from molecula/fully-disable-usage-endpoint
CORE-800 Disable /ui/usage endpoint completely when usage-duty-cycle is set to 0
2021-08-05 09:37:10 -05:00
Alan Bernstein
9565620f4d Disable /ui/usage endpoint completely when usage-duty-cycle is set to 0 2021-08-04 16:22:55 -05:00
Alan Bernstein
51cc29364c
Merge pull request #1669 from molecula/feature/syang/aggregate-sort
CLOUD-61: Add aggregate sort option to query builder
2021-08-02 20:46:58 -05:00
Stephanie Yang
1609582ba1 Update aggregate label to cardinality 2021-08-02 19:01:37 -05:00
Stephanie Yang
97df326ac6 update test and add additional test for aggregate sort 2021-08-02 19:01:37 -05:00
Stephanie Yang
b0633898a3 add ability to set an aggregate sort on int fields 2021-08-02 19:01:37 -05:00
Ben Johnson
009f4d6d71
Merge pull request #1668 from molecula/extract-max-memory
CORE-473: Add max memory limit to Extract() to prevent OOM
2021-08-02 15:44:27 -06:00
Ben Johnson
60d534c505 Limit translation memory & add max query memory config 2021-08-02 15:28:00 -06:00
Ben Johnson
d16978f5dc Add max memory limit to Extract() to prevent OOM
This commit changes the Extract() query to return an error if the
result set gets too large in order to prevent out-of-memory (OOM)
panics.
2021-08-02 08:20:12 -06:00
Stephanie Yang
317f1e0145
Merge pull request #1665 from molecula/refactor/syang/query-builder
CLOUD-136: Refactor query builder
2021-07-30 09:52:45 -05:00
Stephanie Yang
2947583a95 fix issue with editing saved queries 2021-07-29 12:03:32 -05:00
Stephanie Yang
8dc2105b63 add clear link for sort 2021-07-28 11:38:13 -05:00
Stephanie Yang
d8ac3251f6 replace old query builder 2021-07-28 11:21:54 -05:00
Stephanie Yang
fa353faf72 initial refactor commit 2021-07-28 11:21:54 -05:00
Alan Bernstein
6935ac2667
Merge pull request #1664 from molecula/fix-apt-404
Add apt-get update to dockerfile
2021-07-27 13:52:31 -05:00
Alan Bernstein
a7654ee750 Use -y for apt-get command 2021-07-27 10:21:08 -05:00
Alan Bernstein
9e56335ff9 Add apt-get update to dockerfile 2021-07-26 17:37:39 -05:00
Mahesh Arumugam
abb9b930bf
Merge pull request #1662 from molecula/rowcache-race-again
need to create rowCache lock at the top... otherwise it does nothing
2021-07-20 11:06:38 -07:00
Matthew Jaffee
0d7f1c49c4 need to create rowCache lock at the top... otherwise it does nothing 2021-07-20 12:15:35 -05:00
Matthew Jaffee
e42c96e996
Merge pull request #1661 from molecula/other-client-rowCache-race
fix other batch client rowCache race
2021-07-20 11:06:05 -05:00
Matthew Jaffee
d2e8c5f773 fix other batch client rowCache race 2021-07-20 10:36:17 -05:00
Matthew Jaffee
e450099579
Merge pull request #1660 from molecula/client-batch-race
Fix data race in batch import client by adding locking around rowCache
2021-07-20 09:40:28 -05:00
Matthew Jaffee
11686cac97 add locking around rowCache to avoid data race 2021-07-20 09:00:49 -05:00
Mahesh Arumugam
547d74b0fc
Merge pull request #1658 from molecula/ma/cloud-109
CLOUD-109 FeatureBase Renaming: changing go.mod module name for featurebase
2021-07-19 15:33:10 -07:00
Mahesh Arumugam
bce6d91618 Merge branch 'master' into ma/cloud-109 2021-07-19 14:42:36 -07:00