featurebase/dax
Travis Turner f4385df2cf
Fix formatting in CLI results with custom SQLResonse.UnmarshalJSON (#2305)
* Fix formatting in CLI results with custom SQLResonse.UnmarshalJSON

When I started this, it was meant to be a quick fix to address the confusing
result formats we were seeing in the CLI. For example, all large integer values
were displayed in scientifc notation. This is because we were passing the result
types from JSON (in this case, float64) into pretty print. Similarly, `IDSets`
and `StringSets` where being printed using the default go Stringer for the types
[]int64 and []string respectively.

I started by writing a customer UnmarshalJSON() method for the `SQLResponse`
type. Part of this (the part which converts data types based on header types)
was already being used in dax tests, so this just formalizes that logic as part
of the `SQLResponse` type.

Then I realized that the sql3 tests (run against the `sql3` package) were
failing because sql3 is not actually returning the `IDSets` and `StringSets`
types. A future task is to formalize return types, define them, and modify sql3
to return them. Once that is done, we can remove the "typed" switch in the
`SQLResponse` json unmarshaller.

Another significant change is the modification to the `ExprDataType` interface:
```
type ExprDataType interface {
	exprDataType()
	TypeName() string
	TypeDescription() string
	TypeInfo() map[string]interface{}
}
```
I added two more methods in order to distinguish between a type (`DECIMAL`), its
description (`DECIMAL(2)`), and its type info (`"scale": int64(2)`). Currently,
the description can be used as the field definition in a CREATE TABLE statement,
but we may want to re-think that. Also, Decimal is the only type currently using
TypeInfo.

Finally, I tried to consilidate things around `dax.FieldType` instead of
comparing against parser types outside of sql3. We still have some sql3 parser
and planner types lurking about, but we can address those in future commits.

* Add some test coverage

* smoke test expected INT, now int

* minor fixes

* Introduce WireQueryResponse and related types

This also changes dax.FieldType to dax.BaseType.

* Populate WireQueryResponse correctly

Currently this is in the http handler, and in the queryer.

* Convert sql3 and dax tests to expect pilosa.WireQueryField in results

* fix PQL tests in the SQL defs

* Address a few of the skipped sql tests in dax
2022-11-21 18:43:53 -06:00
..
boltdb rename shard partition field (#2302) 2022-11-16 15:58:20 -06:00
computer Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
http Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
inmem rename shard partition field (#2302) 2022-11-16 15:58:20 -06:00
mds Fix formatting in CLI results with custom SQLResonse.UnmarshalJSON (#2305) 2022-11-21 18:43:53 -06:00
queryer Fix formatting in CLI results with custom SQLResonse.UnmarshalJSON (#2305) 2022-11-21 18:43:53 -06:00
server Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
snapshotter Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
test Fix formatting in CLI results with custom SQLResonse.UnmarshalJSON (#2305) 2022-11-21 18:43:53 -06:00
writelogger Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
address.go Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
address_test.go Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
dax.go Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
directive.go rename shard partition field (#2302) 2022-11-16 15:58:20 -06:00
docker-compose.yml Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
errors.go Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
Makefile Fix formatting in CLI results with custom SQLResonse.UnmarshalJSON (#2305) 2022-11-21 18:43:53 -06:00
node.go Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
README.md Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
role.go rename shard partition field (#2302) 2022-11-16 15:58:20 -06:00
snapshot.go Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
table.go Fix formatting in CLI results with custom SQLResonse.UnmarshalJSON (#2305) 2022-11-21 18:43:53 -06:00
table_test.go Fix formatting in CLI results with custom SQLResonse.UnmarshalJSON (#2305) 2022-11-21 18:43:53 -06:00
time.go Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
versioned_field.go rename shard partition field (#2302) 2022-11-16 15:58:20 -06:00
versioned_partition.go rename shard partition field (#2302) 2022-11-16 15:58:20 -06:00
versioned_shard.go rename shard partition field (#2302) 2022-11-16 15:58:20 -06:00
versionstore.go rename shard partition field (#2302) 2022-11-16 15:58:20 -06:00
workerjob.go Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
workerjob_test.go Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00

DAX

DAX encapsulates anything which covers all of the services which make up the "disaggregation of storage and compute" project. Initially, this will include integration tests which pull in things like Metadata Services (MDS), including the Controller, as well as FeatureBase and IDK-based ingesters.

Setting up the tests

The DAX test currently requires docker images for: featurebase and datagen.

If at any point you run into problems with go mod failing to reference a private repo, make sure that you have gitlab.com/molecula in your GOPRIVATE environment variable.

Note that during the docker image build step, go mod vendor is run, which creates a vendor directory in the root directory, and copies that to docker during the build stage. Just be aware of this; you may want to remove that vendor directory after you're done building docker images.

Possible Configuruation

The following were relevent when the dax code was in a separate repository. These may no longer be relevant.

I needed to but this in my ~/.profile file:

export GOPRIVATE=github.com/molecula,gitlab.com/molecula

And this in my ~/.gitconfig

[url "ssh://git@github.com/"]
	insteadOf = https://github.com/
[url "ssh://git@gitlab.com/"]
	insteadOf = https://gitlab.com/

Then make docker ran successfully.

Build the FeatureBase docker image

  • Check out the dax branch of the featurebase repository.
  • Run make docker-image-featurebase to build the docker image
  • You should now have an image in docker named dax/featurebase with the tag latest.

Build the Datagen docker image

  • cd <featurebase_repo_root>/idk
  • Run make docker-image-datagen to build the docker image
  • You should now have an image in docker named dax/datagen with the tag latest.

Running the tests

  • Check out the dax branch of the featurebase repository.
  • Change into the dax directory: cd dax
  • Run make test-integration.