server

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const ISO_FORMAT string = "2006-01-02T15:04:05.000Z"

Variables

View Source
var ANY_TYPES = map[string]bool{
	"BIGINT":     true,
	"HUGEINT":    true,
	"SMALLINT":   true,
	"INTEGER":    true,
	"TINYINT":    true,
	"UBIGINT":    true,
	"UINTEGER":   true,
	"UTINYINT":   true,
	"INT1":       true,
	"INT4":       true,
	"INT":        true,
	"SIGNED":     true,
	"SHORT":      true,
	"DOUBLE":     true,
	"DECIMAL":    true,
	"FLOAT8":     true,
	"NUMERIC":    true,
	"FLOAT":      true,
	"BOOLEAN":    true,
	"BOOL":       true,
	"LOGICAL":    true,
	"TIMESTAMP":  true,
	"TIME":       true,
	"DATETIME":   true,
	"DATE":       true,
	"INTERVAL":   true,
	"BYTE_ARRAY": true,
	"VARCHAR":    true,
	"CHAR":       true,
	"BPCHAR":     true,
	"TEXT":       true,
	"STRING":     true,
}
View Source
var BOOLEANS = map[string]bool{
	"BOOLEAN": true,
	"BOOL":    true,
	"LOGICAL": true,
}
View Source
var CATEGORICALS = map[string]bool{
	"BOOLEAN":    true,
	"BOOL":       true,
	"LOGICAL":    true,
	"BYTE_ARRAY": true,
	"VARCHAR":    true,
	"CHAR":       true,
	"BPCHAR":     true,
	"TEXT":       true,
	"STRING":     true,
}

copy of STRING_LIKES and BOOLEANS map

View Source
var DATES = map[string]bool{
	"DATE": true,
}
View Source
var DoubleQuotesRegexp *regexp.Regexp = regexp.MustCompile("\"")
View Source
var FLOATS = map[string]bool{
	"DOUBLE":  true,
	"DECIMAL": true,
	"FLOAT8":  true,
	"NUMERIC": true,
	"FLOAT":   true,
}
View Source
var INTEGERS = map[string]bool{
	"BIGINT":   true,
	"HUGEINT":  true,
	"SMALLINT": true,
	"INTEGER":  true,
	"TINYINT":  true,
	"UBIGINT":  true,
	"UINTEGER": true,
	"UTINYINT": true,
	"INT1":     true,
	"INT4":     true,
	"INT":      true,
	"SIGNED":   true,
	"SHORT":    true,
}
View Source
var INTERVALS = map[string]bool{
	"INTERVAL": true,
}
View Source
var NUMERICS = map[string]bool{
	"BIGINT":   true,
	"HUGEINT":  true,
	"SMALLINT": true,
	"INTEGER":  true,
	"TINYINT":  true,
	"UBIGINT":  true,
	"UINTEGER": true,
	"UTINYINT": true,
	"INT1":     true,
	"INT4":     true,
	"INT":      true,
	"SIGNED":   true,
	"SHORT":    true,
	"DOUBLE":   true,
	"DECIMAL":  true,
	"FLOAT8":   true,
	"NUMERIC":  true,
	"FLOAT":    true,
}

NUMERICS It's a copy of INTEGERS and FLOATS map until we have a better way to reference the maps directly

View Source
var STRING_LIKES = map[string]bool{
	"BYTE_ARRAY": true,
	"VARCHAR":    true,
	"CHAR":       true,
	"BPCHAR":     true,
	"TEXT":       true,
	"STRING":     true,
}
View Source
var TIMESTAMPS = map[string]bool{
	"TIMESTAMP": true,
	"TIME":      true,
	"DATETIME":  true,
	"DATE":      true,
}

TIMESTAMPS and DATES map fields

View Source
var TypesMap = map[string]map[string]bool{
	"INTEGERS":     INTEGERS,
	"FLOATS":       FLOATS,
	"NUMERICS":     NUMERICS,
	"BOOLEANS":     BOOLEANS,
	"TIMESTAMPS":   TIMESTAMPS,
	"INTERVALS":    INTERVALS,
	"CATEGORICALS": CATEGORICALS,
	"ANY_TYPES":    ANY_TYPES,
}

Functions

func EscapeDoubleQuotes added in v0.15.0

func EscapeDoubleQuotes(column string) string

func EscapeSingleQuotes added in v0.15.0

func EscapeSingleQuotes(value string) string

Types

type ColumnInfo added in v0.15.0

type ColumnInfo struct {
	Name    string
	Type    string
	Unknown int
}

type Server

type Server struct {
	api.UnsafeRuntimeServiceServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opts *ServerOptions, metastore drivers.Connection, logger *zap.Logger) (*Server, error)

func (*Server) CreateInstance

CreateInstance implements RuntimeService

func (*Server) CreateRepo

func (s *Server) CreateRepo(ctx context.Context, req *api.CreateRepoRequest) (*api.CreateRepoResponse, error)

CreateRepo implements RuntimeService

func (*Server) DeleteFile added in v0.15.0

func (s *Server) DeleteFile(ctx context.Context, req *api.DeleteFileRequest) (*api.DeleteFileResponse, error)

DeleteFile implements RuntimeService

func (*Server) DeleteFileAndMigrate added in v0.15.0

func (*Server) DeleteInstance

DeleteInstance implements RuntimeService

func (*Server) DeleteRepo

func (s *Server) DeleteRepo(ctx context.Context, req *api.DeleteRepoRequest) (*api.DeleteRepoResponse, error)

DeleteRepo implements RuntimeService

func (*Server) EstimateRollupInterval added in v0.15.0

Metrics APIs

func (*Server) EstimateSmallestTimeGrain added in v0.15.0

func (s *Server) EstimateSmallestTimeGrain(ctx context.Context, request *api.EstimateSmallestTimeGrainRequest) (*api.EstimateSmallestTimeGrainResponse, error)

func (*Server) GenerateTimeSeries added in v0.15.0

func (s *Server) GenerateTimeSeries(ctx context.Context, request *api.GenerateTimeSeriesRequest) (*api.TimeSeriesRollup, error)

func (*Server) GetCardinalityOfColumn added in v0.15.0

func (s *Server) GetCardinalityOfColumn(ctx context.Context, request *api.CardinalityOfColumnRequest) (*api.CategoricalSummary, error)

func (*Server) GetCatalogObject

GetCatalogObject implements RuntimeService

func (*Server) GetDescriptiveStatistics added in v0.15.0

func (s *Server) GetDescriptiveStatistics(ctx context.Context, request *api.DescriptiveStatisticsRequest) (*api.NumericSummary, error)

func (*Server) GetFile added in v0.15.0

func (s *Server) GetFile(ctx context.Context, req *api.GetFileRequest) (*api.GetFileResponse, error)

GetFile implements RuntimeService

func (*Server) GetInstance

func (s *Server) GetInstance(ctx context.Context, req *api.GetInstanceRequest) (*api.GetInstanceResponse, error)

GetInstance implements RuntimeService

func (*Server) GetNullCount added in v0.15.0

func (s *Server) GetNullCount(ctx context.Context, nullCountRequest *api.NullCountRequest) (*api.NullCountResponse, error)

func (*Server) GetNumericHistogram added in v0.15.0

func (s *Server) GetNumericHistogram(ctx context.Context, request *api.NumericHistogramRequest) (*api.NumericSummary, error)

func (*Server) GetRepo

func (s *Server) GetRepo(ctx context.Context, req *api.GetRepoRequest) (*api.GetRepoResponse, error)

GetRepo implements RuntimeService

func (*Server) GetRugHistogram added in v0.15.0

func (s *Server) GetRugHistogram(ctx context.Context, request *api.RugHistogramRequest) (*api.NumericSummary, error)

func (*Server) GetTimeRangeSummary added in v0.15.0

func (s *Server) GetTimeRangeSummary(ctx context.Context, request *api.TimeRangeSummaryRequest) (*api.TimeRangeSummary, error)

func (*Server) GetTopK added in v0.14.0

func (s *Server) GetTopK(ctx context.Context, topKRequest *api.TopKRequest) (*api.CategoricalSummary, error)

func (*Server) HTTPHandler added in v0.15.0

func (s *Server) HTTPHandler(ctx context.Context) (http.Handler, error)

HTTP handler serving REST gateway

func (*Server) ListCatalogObjects

ListCatalogObjects implements RuntimeService

func (*Server) ListConnectors

ListConnectors implements RuntimeService

func (*Server) ListFiles added in v0.15.0

func (s *Server) ListFiles(ctx context.Context, req *api.ListFilesRequest) (*api.ListFilesResponse, error)

ListFiles implements RuntimeService

func (*Server) ListInstances

func (s *Server) ListInstances(ctx context.Context, req *api.ListInstancesRequest) (*api.ListInstancesResponse, error)

ListInstances implements RuntimeService

func (*Server) ListRepos

func (s *Server) ListRepos(ctx context.Context, req *api.ListReposRequest) (*api.ListReposResponse, error)

ListRepos implements RuntimeService

func (*Server) MetricsViewMeta

MetricsViewMeta implements RuntimeService

func (*Server) MetricsViewTimeSeries

MetricsViewTimeSeries implements RuntimeService

func (*Server) MetricsViewToplist

MetricsViewToplist implements RuntimeService

func (*Server) MetricsViewTotals

MetricsViewTotals implements RuntimeService

func (*Server) Migrate

func (s *Server) Migrate(ctx context.Context, req *api.MigrateRequest) (*api.MigrateResponse, error)

Migrate implements RuntimeService

func (*Server) MigrateDelete

func (s *Server) MigrateDelete(ctx context.Context, req *api.MigrateDeleteRequest) (*api.MigrateDeleteResponse, error)

MigrateDelete implements RuntimeService

func (*Server) MigrateSingle

func (s *Server) MigrateSingle(ctx context.Context, req *api.MigrateSingleRequest) (*api.MigrateSingleResponse, error)

MigrateSingle implements RuntimeService NOTE: Everything here is an initial implementation with many flaws.

func (*Server) Ping

func (s *Server) Ping(ctx context.Context, req *api.PingRequest) (*api.PingResponse, error)

Ping implements RuntimeService

func (*Server) ProfileColumns added in v0.15.0

func (*Server) PutFile added in v0.15.0

func (s *Server) PutFile(ctx context.Context, req *api.PutFileRequest) (*api.PutFileResponse, error)

PutFile implements RuntimeService

func (*Server) PutFileAndMigrate added in v0.15.0

PutFileAndMigrate implements RuntimeService

func (*Server) Query

func (s *Server) Query(ctx context.Context, req *api.QueryRequest) (*api.QueryResponse, error)

Query implements RuntimeService

func (*Server) QueryDirect

func (s *Server) QueryDirect(ctx context.Context, req *api.QueryDirectRequest) (*api.QueryDirectResponse, error)

QueryDirect implements RuntimeService

func (*Server) RenameDatabaseObject added in v0.15.0

Table level profiling APIs

func (*Server) RenameFile added in v0.15.0

func (s *Server) RenameFile(ctx context.Context, req *api.RenameFileRequest) (*api.RenameFileResponse, error)

RenameFile implements RuntimeService

func (*Server) RenameFileAndMigrate added in v0.15.0

func (*Server) ServeGRPC added in v0.15.0

func (s *Server) ServeGRPC(ctx context.Context) error

Starts the gRPC server

func (*Server) ServeHTTP added in v0.15.0

func (s *Server) ServeHTTP(ctx context.Context) error

Starts the HTTP server

func (*Server) TableCardinality added in v0.15.0

func (s *Server) TableCardinality(ctx context.Context, req *api.CardinalityRequest) (*api.CardinalityResponse, error)

func (*Server) TableRows added in v0.15.0

func (s *Server) TableRows(ctx context.Context, req *api.RowsRequest) (*api.RowsResponse, error)

func (*Server) TriggerRefresh

TriggerRefresh implements RuntimeService

func (*Server) TriggerSync added in v0.15.0

func (s *Server) TriggerSync(ctx context.Context, req *api.TriggerSyncRequest) (*api.TriggerSyncResponse, error)

TriggerSync implements RuntimeService

func (*Server) UploadMultipartFile added in v0.15.0

func (s *Server) UploadMultipartFile(w http.ResponseWriter, req *http.Request, pathParams map[string]string)

UploadMultipartFile implements the same functionality as PutFile, but for multipart HTTP upload. It's mounted only on as a REST API and enables upload of large files (such as data files).

type ServerOptions

type ServerOptions struct {
	HTTPPort            int
	GRPCPort            int
	ConnectionCacheSize int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL