featurebase/dax/test/docker/client.go
pokeeffe-molecula eae8376181 Tighten up ORDER BY (fb 507) (#2318)
* tighten up checks for order by expressions fixed ordering by expressions

* added testing to cover order by cases

* Add DecimalAgg member to proto GroupCount definition

In DAX, where we have split the orchestrator from the executor, and the
orchestrator can run on a different host, there are cases where
`GroupCount`s can travel over the wire via the Internal Client. In these
cases, when the group count contains a decimal aggregate, we need to
send that value as the appropriate type.

* fixed missing cases in order by and case block eval

Co-authored-by: Travis Turner <travis@molecula.com>
(cherry picked from commit 158cc669d9)
2022-12-12 09:01:20 -08:00

37 lines
632 B
Go

package docker
import (
"context"
"os"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
)
// DefaultClient is the default docker Client
var DefaultClient *client.Client
func init() {
cli, err := client.NewClientWithOpts()
if err != nil {
panic(err)
}
if err := client.FromEnv(cli); err != nil {
panic(err)
}
cli.RegistryLogin(context.Background(), types.AuthConfig{})
DefaultClient = cli
}
func Getenv(key, fallback string) string {
value := os.Getenv(key)
if len(value) == 0 {
return fallback
}
return value
}
func Setenv(key, value string) error {
return os.Setenv(key, value)
}