Documentation ¶
Overview ¶
Code generated by generate_randomized_freepool.py. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func ActivateCache(ctx context.Context, name, uniquePath string)
- func BTSVShardPath(dir string, shard, nshards int) string
- func CheckCancellation(ctx context.Context)
- func Compare(ast ASTNode, v0, v1 Value) int
- func Debugf(ast ASTNode, format string, args ...interface{})
- func DefaultTableLen(ctx context.Context, t Table) int
- func DescribeValue(v Value) string
- func Errorf(ast ASTNode, format string, args ...interface{})
- func FileHash(ctx context.Context, path string, ast ASTNode) hash.Hash
- func FormatSeq(s sam.Seq) string
- func GenerateStableCachePath(name string) string
- func Init(opts Opts)
- func InitStruct(s Struct)
- func IsFileImmutable(path string) bool
- func Logf(ast ASTNode, format string, args ...interface{})
- func LookupCache(ctx context.Context, name string) (string, bool)
- func MarshalTableInline(ctx MarshalContext, enc *marshal.Encoder, t Table)
- func MarshalTableOutline(ctx MarshalContext, enc *marshal.Encoder, t Table)
- func MarshalTablePath(enc *marshal.Encoder, path string, fh FileHandler, hash hash.Hash)
- func NewBTSVTable(path string, ast ASTNode, hash hash.Hash) *btsvTable
- func NewactualArgFreePool(new func() []ActualArg, maxSize int) *actualArgFreePool
- func NewstructFieldFreePool(new func() []StructField, maxSize int) *structFieldFreePool
- func Panicf(ast ASTNode, format string, args ...interface{})
- func PrintValueList(vals []Value) string
- func Recover(cb func()) (err error)
- func RegisterFileHandler(fh FileHandler, pathRE ...string)
- func RegisterGlobalConst(name string, val Value)
- func RegisterTableUnmarshaler(magic UnmarshalMagic, cb UnmarshalTableCallback)
- func ScaleShardRange(start, limit, nshards, nitems int) (int, int)
- func TestClearCache()
- func TestMarshalValue(t *testing.T, val Value) (ctxData, valData []byte)
- func TestPrintValueLong(v Value) string
- func TestSetOverwriteFiles(v bool) bool
- func Unsafeint32sToBytes(recs []int32) (b []uint8)
- func Unsafeuint8sToBytes(recs []uint8) []uint8
- func WriteColumnarTSV(ctx context.Context, table Table, format string, gzipFiles, overwrite bool)
- func WriteTSV(ctx context.Context, path string, table Table, headerLine, gzip bool)
- type AIArg
- type AIType
- type ASTBlock
- type ASTColumnRef
- type ASTCondOp
- type ASTFuncall
- type ASTImplicitColumnRef
- type ASTLambda
- type ASTLiteral
- type ASTLogicalOp
- type ASTNode
- type ASTParamVal
- type ASTStatement
- type ASTStatementOrLoad
- type ASTStructFieldRef
- type ASTStructFieldRegex
- type ASTStructLiteral
- type ASTStructLiteralField
- type ASTUnknown
- type ASTVarRef
- type ActualArg
- func (arg *ActualArg) Bool() bool
- func (arg *ActualArg) Char() rune
- func (arg *ActualArg) DateTime() time.Time
- func (arg *ActualArg) Duration() time.Duration
- func (arg *ActualArg) Float() float64
- func (arg *ActualArg) Func() *Func
- func (arg *ActualArg) Int() int64
- func (arg *ActualArg) Str() string
- func (arg *ActualArg) Struct() Struct
- func (arg *ActualArg) Table() Table
- type BTSVShardWriter
- type ClosureFormalArg
- type CountMode
- type FileHandler
- type FormalArg
- type Func
- type FuncCallback
- type MarshalContext
- type NullStatus
- type NullTableScanner
- type Opts
- type PrefetchingTableScanner
- type PrintArgs
- type PrintMode
- type Session
- func (s *Session) Bindings() *bindings
- func (s *Session) Eval(ctx context.Context, expr ASTNode) Value
- func (s *Session) EvalFile(ctx context.Context, path string) Value
- func (s *Session) EvalStatements(ctx context.Context, statements []ASTStatementOrLoad) Value
- func (s *Session) Parse(filename string, text []byte) ([]ASTStatementOrLoad, error)
- func (s *Session) SetGlobal(name string, value Value)
- func (s *Session) SetGlobals(vars map[string]Value)
- type Struct
- type StructField
- type StructImpl
- type TSVColumn
- type TSVFormat
- type TSVTable
- func (t *TSVTable) Attrs(ctx context.Context) TableAttrs
- func (t *TSVTable) Hash() hash.Hash
- func (t *TSVTable) Len(ctx context.Context, mode CountMode) int
- func (t *TSVTable) Marshal(ctx MarshalContext, enc *marshal.Encoder)
- func (t *TSVTable) Prefetch(ctx context.Context)
- func (t *TSVTable) Scanner(ctx context.Context, start, limit, total int) TableScanner
- type Table
- func NewBAMTable(path string, ast ASTNode, hash hash.Hash) Table
- func NewFlatTable(ast ASTNode, tables []Table, subshard bool) Table
- func NewMinNTable(ctx context.Context, ast ASTNode, attrs TableAttrs, srcTable Table, ...) Table
- func NewNullTable() Table
- func NewSimpleTable(recs []Value, h hash.Hash, attrs TableAttrs) Table
- func NewTSVTable(path string, ast ASTNode, h hash.Hash, fh FileHandler, format *TSVFormat) Table
- func NewTableFromFile(ctx context.Context, path string, ast ASTNode, fh FileHandler) Table
- type TableAttrs
- type TableScanner
- type TmpVars
- type TypeCallback
- type UnmarshalContext
- type UnmarshalMagic
- type UnmarshalTableCallback
- type Value
- func MustStructValue(v Struct, colName symbol.ID) Value
- func NewBool(v bool) Value
- func NewChar(ch rune) Value
- func NewDate(t time.Time) Value
- func NewDateTime(t time.Time) Value
- func NewDuration(t time.Duration) Value
- func NewEnum(v string) Value
- func NewFileName(v string) Value
- func NewFloat(v float64) Value
- func NewFunc(f *Func) Value
- func NewInt(v int64) Value
- func NewMapFilterTable(ctx context.Context, ast ASTNode, srcTable Table, filterExpr *Func, ...) Value
- func NewNull(v NullStatus) Value
- func NewString(s string) Value
- func NewStruct(v Struct) Value
- func NewStructFragment(frag []StructField) Value
- func NewTable(v Table) Value
- func ParseDateTime(v string) Value
- func ParseDuration(v string) Value
- func RegisterBuiltinFunc(name, desc string, funcCB FuncCallback, typeCB TypeCallback, ...) Value
- func TestUnmarshalValue(t *testing.T, ctxData, valData []byte) Value
- func (v Value) Bool(ast ASTNode) bool
- func (v Value) Char(ast ASTNode) rune
- func (v Value) DateTime(ast ASTNode) time.Time
- func (v Value) Duration(ast ASTNode) time.Duration
- func (v Value) Float(ast ASTNode) float64
- func (v Value) Func(ast ASTNode) *Func
- func (v Value) Hash() hash.Hash
- func (v Value) Hash32() uint32
- func (v Value) Int(ast ASTNode) int64
- func (v Value) Marshal(ctx MarshalContext, enc *marshal.Encoder)
- func (v Value) MarshalBinary() ([]byte, error)
- func (v Value) Null() NullStatus
- func (v Value) Prefetch(ctx context.Context)
- func (v Value) Print(ctx context.Context, args PrintArgs)
- func (v Value) Str(ast ASTNode) string
- func (v Value) String() string
- func (v Value) Struct(ast ASTNode) Struct
- func (v Value) StructFragment() []StructField
- func (v Value) Table(ast ASTNode) Table
- func (v Value) Type() ValueType
- func (v *Value) Unmarshal(ctx UnmarshalContext, dec *marshal.Decoder)
- func (v *Value) UnmarshalBinary(data []byte) error
- func (v Value) Valid() bool
- type ValueType
Constants ¶
const ( DefaultCacheRoot = "s3://grail-query/cache4" DefaultLocalCacheRoot = "/tmp/grail-query/cache4" )
Default values for cacheRoot when using EC2 bigslice system and otherwise.
const OptionalCompression = `(\.gz|\.bz2|\.zst)?$`
OptionalCompression is a regexp that matches compressed-file suffixes.
Variables ¶
var ( // Shorthand for trivial types. AIAnyType = AIType{Any: true} AIBoolType = AIType{Type: BoolType} AIIntType = AIType{Type: IntType} AIFloatType = AIType{Type: FloatType} AIStringType = AIType{Type: StringType} AIStructType = AIType{Type: StructType} AITableType = AIType{Type: TableType} )
var ( // MinNMinRowsPerShard is the minimum number of rows per sortshard. MinNMinRowsPerShard = 1 << 18 // MinNMaxRowsPerShard is the maximum number of rows per sortshard. MinNMaxRowsPerShard = 1 << 20 // MinNParallelism is the maximum number of goroutines to create during // sorting. MinNParallelism = runtime.NumCPU() * 2 )
var ( // Null is a singleton instance of NA. Null = NewNull(PosNull) // True is a true Bool constant True = NewBool(true) // False is a false Bool constant False = NewBool(false) )
var BAMTableMaxShards = 512
BAMTableMaxShards sets the maximum physical shards created for a BAM scanner. Exposed only for testing.
TODO(marius): it might make more sense to compute a dynamic max shard by having a minimum shard size.
var ( // BackgroundContext is used in stringers, etc, when the user doesn't // explicitly pass a context. Copied from Opts.BackgroundContext in Init. BackgroundContext context.Context )
var ( // MaxTSVRowsInMemory defines the maximum number of TSV rows to read and cache // in memory. If a TSV file contains more rows than this limit, the file // contents are read incrementally in each scanner. // // This flag is exposed only for unittesting. MaxTSVRowsInMemory = 65536 )
var VerifyFileHash = false
If verifyFileHash = true, some table implementation will verify that the fileHash (see below) hasn't changed since it was first computed. The check is slow especially on S3, so it's disabled by default.
Functions ¶
func ActivateCache ¶
activateCache arranges so that future calls to lookupCache(name) will return uniquePath. This function is implemented by creating a symlink-like file that stores the uniquePath as the contents.
func BTSVShardPath ¶
BTSVShardPath computes the path of a btsv shard file.
REQUIRES: dir must end with ".btsv". 0 <= shard < nshards.
func CheckCancellation ¶
CheckCancellation checks if ctx has been cancelled and panics if so.
func Compare ¶
Compare compares the two values lexicographically. It returns -1,0,1 if v0<v1, v0==v1, v0>v1, respectively. It crashes if the two values are not of the same type. "ast" is for displaying error messages.
func Debugf ¶
Debugf is similar to log.Debug.Printf(...). Arg "ast" is the source-code location of the error. If "ast" is unknown, pass &ASTUnknown{}.
func DefaultTableLen ¶
DefaultTableLen computes the number of rows in the table accurately by scanning it.
func DescribeValue ¶
DescribeValue a shorthand for calling v.Print() with PrintArgs.Mode of PrintDescription.
func Errorf ¶
Logf is similar to log.Error.Printf(...). Arg "ast" is the source-code location of the error. If "ast" is unknown, pass &ASTUnknown{}.
func FileHash ¶
FileHash computes a hash from a pathname and the file's modtime. The resulting value can be used as the hash for a file-based Table.
func GenerateStableCachePath ¶
GenerateStableCachePath generates a stable path using "name" as a template. name should be of form "prefix.extension". The generated pathname is currently of the form cacheRoot/name but this may change in future implementations.
func Init ¶
func Init(opts Opts)
Init initializes the GQL runtime. It must be called once before using evaluating gql expressions.
func InitStruct ¶
func InitStruct(s Struct)
InitStruct initializes the itable pointer of the given struct. It must be called once when a new Struct object is created.
func IsFileImmutable ¶
IsFileImmutable checks if the pathname matches gql.Opts.ImmutableFilesRE.
func Logf ¶
Logf is similar to log.Printf(...). Arg "ast" is the source-code location of the error. If "ast" is unknown, pass &ASTUnknown{}.
func LookupCache ¶
LookupCache looks up "name" in the persistent cache. If found, it returns the abspathname of the data and true.
If the cache entry is not found, it generates a new unique file path. The caller should produce cache contents in the given file, then call activateCache once done to activate the cache entry.
Example:
path, found := lookupCache("foo.btsv") if !found { w := NewBTSVShardWriter(path, 0, 1, TableAttrs{}) .. fill w ... w.Close() activateCache("foo.btsv", path) } r := NewBTSVTable(path, ...) ... use r ...
func MarshalTableInline ¶
func MarshalTableInline(ctx MarshalContext, enc *marshal.Encoder, t Table)
MarshalTableInline marshals the given table contents directly. It shall be used only for small tables.
func MarshalTableOutline ¶
func MarshalTableOutline(ctx MarshalContext, enc *marshal.Encoder, t Table)
MarshalTableOutline marshals the given table by first writing its contents in btsv format in the cachedir, then marshaling the pathname of the generated btsv file.
func MarshalTablePath ¶
MarshalTablePath encodes a table as a tuple of <pathname, filehandler, hash>. It does not encode the table contents, so this function is suitable only for files that can be accessed from any machine (e.g., S3) and are immutable.
func NewBTSVTable ¶
NewBTSVTable creates a Table implementation for a btsv table stored in directory "path". path must end with *.btsv. hash is an optional hash of the inputs that derives the btsv table.
func NewactualArgFreePool ¶
NewactualArgFreePool creates a new free object pool. new should create a new object. It is called when the pool is empty on Get(). maxSize bounds the approx max number of objects that can be stored in the pool. Beyond this limit, Put() call will drop the objects.
func NewstructFieldFreePool ¶
func NewstructFieldFreePool(new func() []StructField, maxSize int) *structFieldFreePool
NewstructFieldFreePool creates a new free object pool. new should create a new object. It is called when the pool is empty on Get(). maxSize bounds the approx max number of objects that can be stored in the pool. Beyond this limit, Put() call will drop the objects.
func Panicf ¶
Logf is similar to log.Panicf.(...). Arg "ast" is the source-code location of the error. If "ast" is unknown, pass &ASTUnknown{}.
func PrintValueList ¶
PrintValueList prints a list of values in form "[val0, val1, ...]". Arg depth is used as PrintArgs.Depth.
func Recover ¶
func Recover(cb func()) (err error)
Recover runs the given function, catching any panic thrown by the function and turning it into an error. If the function finishes without panicking, CatchPanic returns nil.
func RegisterFileHandler ¶
func RegisterFileHandler(fh FileHandler, pathRE ...string)
RegisterFileHandler registers a file handler. This function is typically invoked in an init() function. Arg pathRE is the list of regexps that defines the pathame patterrs. If any of the patterns matches a path, the file handler is invoked to read and write the file.
func RegisterGlobalConst ¶
RegisterGlobalConst adds name->value binding in the global constant table. It panics if the name already exists. This function may be called after gql.Init(), but before evaluating any user expression.
func RegisterTableUnmarshaler ¶
func RegisterTableUnmarshaler(magic UnmarshalMagic, cb UnmarshalTableCallback)
RegisterTableUnmarshaler registers a magic number for table marshaler and unmarshaler. "cb" will be called to unmarshal a table with the given magic. The MarshalGOB method of the table type should use the same magic.
This function must be called in an init() function.
func ScaleShardRange ¶
func TestClearCache ¶
func TestClearCache()
TestClearCache deletes all the files in cacheRoot. For unittests only.
func TestPrintValueLong ¶
func TestSetOverwriteFiles ¶
TestSetOverwriteFiles temporarily overrides overwriteFiles. Return the old value. For unittests only.
func Unsafeint32sToBytes ¶
func Unsafeuint8sToBytes ¶
func WriteColumnarTSV ¶
WriteColumnarTSV writes the given table in 'columnar' format, that is, each column is written to a separate file. Prefix represents a path prefix (eg. an S3 prefix or a directory), and format is a template in go's text/template language that is used to generate the name of each of the columnar files. The template is executed executed with the following fields available:
Name string // Column header but with white space replaced by _ Number int // 1..<num-cols>
The first row of all of the files will contain the column header. If gzip is true then the output files will be gzip compressed and a .gz extension appended to all of the filenames. If overwrite is false and the file "path" exists, this function returns quickly without overwriting the file.
Types ¶
type AIArg ¶
type AIArg struct { Name symbol.ID // =symbol.Invalid iff the arg is positional. Type AIType // Set when the value is eagerly evaluated Env aiBindings // Env and Expr form a closure Expr ASTNode // Syntactic node. Nil iff the arg is optional and is omitted by the caller. Symbol symbol.ID // Set iff FormalArg.Symbol=true. DefaultValue Value // Copied from FormalArg.DefaultValue }
AIArg is the result of parsing & typechecking FormalFuncArg.
type AIType ¶
type AIType struct { // ValueType is the type of the node. Type ValueType // Literal is non-nil if the type refers to a compile-time constant. Literal *Value // Any is set when the type is unknown. An any type matches anything. Any bool // Formal args to the function. FormalArgs []FormalArg // TypeCB is called via ASTNode.Analyze to run a // function-implementation-specific typecheck. // // Note: the types of non-lazy args in []FormalArgs are checked by // ASTFunctionCall.Analeze, so TypeCB implementations don't need to check // them. TypeCB TypeCallback }
AIType is similar to ValueType, but it contains more detailed information, such as function signatures. It is used only during pre-execution program analysis, while ASTNode.Analyze is running. It is never persisted.
func (AIType) FuncReturnType ¶
FuncReturnType is the type of return values of the function. If t.Any, it returns AIAnyType.
REQUIRES: t.Is(FuncType).
type ASTBlock ¶
type ASTBlock struct { Pos scanner.Position Statements []ASTStatement }
ASTBlock represents an expression of form "{ assignments; expr }"
type ASTColumnRef ¶
type ASTColumnRef struct { // Pos is the location of this node in the source file. Pos scanner.Position // Col is the column name Col symbol.ID // Deprecated is true if this syntax node was created by a "$column" // expression, as opposed to "&column". Deprecated bool }
ASTColumnRef represents a "_.column" expression. It is produced as a result of rewriting &column.
func (*ASTColumnRef) String ¶
func (n *ASTColumnRef) String() string
String implements the ASTNode interface.
type ASTCondOp ¶
type ASTCondOp struct { // Pos is the position of the start of the expression. Pos scanner.Position // Cond is the conditional. Cond ASTNode // Then is the positive clause. Then ASTNode // Else is the negative clause. Else ASTNode }
ASTCondOp is an ASTNode implementation for "cond(if,then,else)".
type ASTFuncall ¶
type ASTFuncall struct { Pos scanner.Position Function ASTNode // function body. Raw []ASTParamVal // set by yacc. Args []AIArg // set in analyze Analyzed bool // true after analyze() runs. }
ASTFuncall is an ASTNode for function call 'func(arg0,arg1,...)'
func NewASTBuiltinFuncall ¶
func NewASTBuiltinFuncall(pos scanner.Position, f Value, args ...ASTNode) *ASTFuncall
NewASTBuiltinFuncall creates a new ASTFuncall object. Is is used for infix or prefix operators.
func NewASTFuncall ¶
func NewASTFuncall(fun ASTNode, args []ASTParamVal) *ASTFuncall
NewASTFuncall creates a new ASTFuncall.
func NewASTPipe ¶
func NewASTPipe(left ASTNode, right ASTNode) *ASTFuncall
NewASTPipe creates a syntax node for construct "left | fun(args)". It is translated into "fun(left, args)".
func (*ASTFuncall) String ¶
func (n *ASTFuncall) String() string
String implements the ASTNode interface.
type ASTImplicitColumnRef ¶
type ASTImplicitColumnRef struct { // Pos is the location of this node in the source file. Pos scanner.Position // Col is the column name. Col symbol.ID }
ASTImplicitColumnRef represents a "&column" expression. It can appear only in function-call arguments. "&column" is rewritten into "|_|{_.column}" by replaceImplicitColumnRef.
func (*ASTImplicitColumnRef) String ¶
func (n *ASTImplicitColumnRef) String() string
String implements the ASTNode interface.
type ASTLambda ¶
type ASTLambda struct { Pos scanner.Position Args []FormalArg // Body is the function body. Body ASTNode }
ASTLambda is an ASTNode for a user-defined function, "func(params...) {statements...}".
func NewASTLambda ¶
NewASTLambda creates a new ASTLambda node.
type ASTLiteral ¶
type ASTLiteral struct { // Pos is the source-code location of this node. Pos scanner.Position // Literal stores the const value. Literal Value // Org stores the original expression, if this node was created as a result of // constant-propagation optimization. Otherwise Org is nil. Org ASTNode }
ASTLiteral is an ASTNode for a literal value, such as 123, `foobar`.
func (*ASTLiteral) String ¶
func (n *ASTLiteral) String() string
String implements the ASTNode interface.
type ASTLogicalOp ¶
type ASTLogicalOp struct { // AndAnd is true for "&&", false for "||" AndAnd bool LHS, RHS ASTNode }
ASTLogicalOp is an ASTNode implementation for "||" and "&&" operators.
func (*ASTLogicalOp) String ¶
func (n *ASTLogicalOp) String() string
String returns a human-readable description.
type ASTNode ¶
type ASTNode interface { // String produces a human-readable description of the expression node. The // resulting string is only for logging; it may not be a valid GQL expression. String() string // contains filtered or unexported methods }
ASTNode represents an abstract syntax tree node. One ASTnode is created for a syntactic element found in the source script. Implementations of ASTNode must be threadsafe and GOB-encodable.
type ASTParamVal ¶
type ASTParamVal struct { Pos scanner.Position // Name is set to symbol.Intern("foo") if the actual arg is 'foo:=expr'. It is // symbol.Invalid for a positional arg. Name symbol.ID // Expr is the actual arg expression. Expr ASTNode // PipeSource is true if if this arg is a LHS of a pipe operator. E.g., take // expression `read("foo.tsv") | map($col==0)`. It is syntactically translated // into `map(read("foo.tsv"), $col==0)`. Its first arg, `read("foo.tsv")` is // marked as PipeSource. A pipesource argument is exempted from '&' expansion. PipeSource bool }
ASTParamVal represents a function-call parameter that appears in the source code.
func NewASTParamVal ¶
func NewASTParamVal(pos scanner.Position, name string, expr ASTNode) ASTParamVal
NewASTParamVal creates a new ASTParamVal.
type ASTStatement ¶
type ASTStatement struct { // Pos is the location of this node in the source file. Pos scanner.Position // LHS is set when the statement is of form "var := expr". LHS symbol.ID // Expr is the right-hand side of "var := expr". It is also set when the // statement is a naked expression. Expr ASTNode }
ASTStatement represents an assignment 'var:=expr' or an expression.
func NewASTStatement ¶
func NewASTStatement(pos scanner.Position, name string, expr ASTNode) ASTStatement
NewASTStatement creates a new ASTStatement.
func (ASTStatement) String ¶
func (s ASTStatement) String() string
type ASTStatementOrLoad ¶
type ASTStatementOrLoad struct { ASTStatement // Load is set when the statement is of form "load `path`". The value is the // pathname. Other fields are unset. LoadPath string }
ASTStatementOrLoad is a toplevel gql construct.
func (ASTStatementOrLoad) String ¶
func (s ASTStatementOrLoad) String() string
String returns a human-readable string.
type ASTStructFieldRef ¶
type ASTStructFieldRef struct { Parent ASTNode // Refers to the struct object. Field symbol.ID // Field in the struct. }
ASTStructFieldRef represents an expression "struct.field".
func NewASTStructFieldRef ¶
func NewASTStructFieldRef(parent ASTNode, name string) *ASTStructFieldRef
NewASTStructFieldRef creates a new ASTStructFieldRef.
func (*ASTStructFieldRef) String ¶
func (n *ASTStructFieldRef) String() string
String implements the ASTNode interface.
type ASTStructFieldRegex ¶
ASTStructFieldRegex is for evaluating expressions of form "struct./regex/". It evaluates into a value containing []StructField.
func NewASTStructFieldRegex ¶
func NewASTStructFieldRegex(pos scanner.Position, parent ASTNode, re string) *ASTStructFieldRegex
NewASTStructFieldRegex creates a new ASTStructFieldRegex.
func (*ASTStructFieldRegex) MarshalBinary ¶
func (n *ASTStructFieldRegex) MarshalBinary() ([]byte, error)
MarshalBinary implements the GOB interface.
func (*ASTStructFieldRegex) String ¶
func (n *ASTStructFieldRegex) String() string
String implements the ASTNode interface.
func (*ASTStructFieldRegex) UnmarshalBinary ¶
func (n *ASTStructFieldRegex) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the GOB interface.
type ASTStructLiteral ¶
type ASTStructLiteral struct { Pos scanner.Position Fields []ASTStructLiteralField }
ASTStructLiteral is an ASTNode that represents a struct literal '{f0:=val0,f1:=val1,...}.
func NewASTStructLiteral ¶
func NewASTStructLiteral(pos scanner.Position, fields []ASTStructLiteralField) *ASTStructLiteral
NewASTStructLiteral creates a new ASTStructLiteral.
func (*ASTStructLiteral) String ¶
func (n *ASTStructLiteral) String() string
String implements the ASTNode interface.
type ASTStructLiteralField ¶
type ASTStructLiteralField struct { Pos scanner.Position Name symbol.ID // column name. may be symbol.Invalid. Expr ASTNode }
ASTStructLiteralField represents a column within a struct literal expression '{f0:=val0,f1:=val1,...}.
func NewASTStructLiteralField ¶
func NewASTStructLiteralField(pos scanner.Position, name string, expr ASTNode) ASTStructLiteralField
NewASTStructLiteralField creates a new ASTStructLiteralField. name is the the column (field) name, and expr is an expression that refers to the struct.
type ASTUnknown ¶
type ASTUnknown struct{}
ASTUnknown implements ASTNode. It is a placeholder whose only purpose to report a source code location.
func (*ASTUnknown) String ¶
func (n *ASTUnknown) String() string
type ActualArg ¶
type ActualArg struct { Name symbol.ID // Formal arg name. Copied from FormalArg.Name Value Value // Set for eagerly evaluated arg. Expr ASTNode // Points to the source code element. Set unless the arg is optional and is not provided by the caller. Symbol symbol.ID // Set only for symbol arg. }
ActualArg represents an function-call argument.
1. If FormalArg.Symbol==true, only the Symbol field will be set.
2. Else Value and Expr are set. Value is the actual fully-evaluated arg value. Expr is useful primarily to show a informative error message.
func (*ActualArg) Bool ¶
Bool retrieves the bool value from arg.Value. A shorthand for arg.Value.Bool(arg.Expr).
func (*ActualArg) Char ¶
Char retrieves the char value from arg.Value. A shorthand for arg.Value.Char(arg.Expr).
func (*ActualArg) DateTime ¶
DateTime retrieves the char value from arg.Value. A shorthand for arg.Value.DateTime(arg.Expr).
func (*ActualArg) Duration ¶
Duration retrieves the duration value from arg.Value. A shorthand for arg.Value.Duration(arg.Expr).
func (*ActualArg) Float ¶
Float retrieves the float64 value from arg.Value. A shorthand for arg.Value.Float(arg.Expr).
func (*ActualArg) Func ¶
Func retrieves the function closure from arg.Value. A shorthand for arg.Value.Func(arg.Expr).
func (*ActualArg) Int ¶
Int retrieves the int64 value from arg.Value. A shorthand for arg.Value.Int(arg.Expr).
func (*ActualArg) Str ¶
Str retrieves the string value from arg.Value. A shorthand for arg.Value.Str(arg.Expr).
type BTSVShardWriter ¶
type BTSVShardWriter struct {
// contains filtered or unexported fields
}
BTSVShardWriter creates a BTSV shard. Use NewBTSVShardWriter to create this object..
func NewBTSVShardWriter ¶
func NewBTSVShardWriter(ctx context.Context, dir string, shard, nshards int, attrs TableAttrs) *BTSVShardWriter
NewBTSVShardWriter creates a BTSVShardWriter object. The attrs is used only as table description in the index.
REQUIRES: path ends with ".btsv"
Example:
w := NewBTSVShardWriter("/tmp/foo.btsv", 0, 1, attrs) t := some Table s := t.Scanner(...) for s.Scan() { w.Append(s.Value()) } w.Close()
func (*BTSVShardWriter) Append ¶
func (b *BTSVShardWriter) Append(val Value)
Append adds a value to the btsv table.
func (*BTSVShardWriter) Close ¶
func (b *BTSVShardWriter) Close(ctx context.Context)
Close must be called exactly once at the end of writes. It finalizes the file contents.
type ClosureFormalArg ¶
type ClosureFormalArg struct { // Name is the default name of the arg Name symbol.ID // Override specifies the name of the argument to the (outer) function that // overrides the Name. For example, the builtin map() function has an optional // argument "row" that overrides the name of the arguments to filter and map // callbacks. For these callbacks, Name=symbol.Intern("_"), // Override=symbol.Intern("row"). Override symbol.ID }
ClosureFormalArg is the list of formal args for a closure. It is part of FormalArg
type FileHandler ¶
type FileHandler interface { // Name returns the file-type name, e.g., "tsv" for TSV handler, "bam" for BAM // handler. Name() string // Open opens the file and returns a Table that reads its contents. Arg "ast" // can be passed to functions such as Logf, Panicf to report the source-code // location on error. Open(ctx context.Context, path string, ast ASTNode, hash hash.Hash) Table // Write writes the contents of the table to the given file. "nshard" the // number of file shards to create. It is meaningful only for btsv files. // "overwrite" is true iff. the caller wishes to overwrite the file if it // exits already. // // Arg "ast" can be passed to functions such as Logf, Panicf to report the // source-code location on error. Write(ctx context.Context, path string, ast ASTNode, table Table, nShard int, overwrite bool) }
FileHandler defines methods for reading a file into a Table and writing a table into a file.
func GetFileHandlerByName ¶
func GetFileHandlerByName(name string) FileHandler
GetFileHandlerByName finds the FileHandler object with the given name.
func GetFileHandlerByPath ¶
func GetFileHandlerByPath(path string) FileHandler
GetFileHandlerByName finds the FileHandler for the given file. It works only by examining the path name. It does not read file contents. If multiple handlers match the path name, the one with the longest match will be used.
func TSVFileHandler ¶
func TSVFileHandler() FileHandler
type FormalArg ¶
type FormalArg struct { // Name must be set for a named argument. For positional args, this field is // only informational. Name symbol.ID // Positional is true if the caller need not name the arg in form // "arg:=value". Positional bool // Required is true if the arg must be provided by the caller. Required bool // Variadic causes this arg to consume all the remaining, unnamed actual args Variadic bool // Closure is true if the argument is treated as a lambda body with the args // specified in ClosureArgs. A Closure argument is translated into a // user-defined function during the analysis phase. Closure bool ClosureArgs []ClosureFormalArg // Joinclosure is a special kind of closure that's used to specify the join // condition and map arg for the join function. The formal args to these // callbacks need to be extraced from the 1st arg to join ({t0:table0, ..., // tN:tableN}). JoinClosure bool // If Symbol=true, the actual arg must be a naked symbol that specifies a // variable name. It is used, e.g., as the "row:=foobar" arg in map() and // filter(). Symbol bool // DefaultSymbol is set as the value of the symbol arg if it is not provided // by the caller. // // INVARIANT: If DefaultSymbol!=symbol.Invalid then Symbol==true. DefaultSymbol symbol.ID // DefaultValue is set as the arg value if it is not provided by the caller. // It is meaningful only for non-lazy, non-symbol args. DefaultValue Value // The list of types allowed as the arg. Meaningful only if !Symbol. This // field is optional. The parser will check for type conformance if len(Types) // len(Types)>0. This field may be nil, in which case it is up to the // typecheck callback to validate arg types. Types []ValueType }
FormalArg is a description of an argument to a function.
type Func ¶
type Func struct {
// contains filtered or unexported fields
}
Func represents a function closure. It is stored in Value.
func NewUserDefinedFunc ¶
NewUserDefinedFunc creates a new user-defined function. "ast" is used only to show debug messages on error.
type FuncCallback ¶
FuncCallback is the function body. ast is syntax the tree node of the call, used only to report the source-code location on error. args is the arguments to the function.
type MarshalContext ¶
type MarshalContext struct {
// contains filtered or unexported fields
}
Types MarshalContext and UnmarshalContext store state needed while marshaling or unmarshaling a table. They keep track of call frames referenced by closures, so that reference cycles involving closure -> frame -> a closure stored in the frame -> frame ... can be terminated.
Map keys are the set of frames referenced transitively by closures. Keys are callFrame.hash().
type NullStatus ¶
type NullStatus int
NullStatus is the return value of Value.Null()
const ( // PosNull is the standard status of a null value. PosNull sorts after // any non-null value. PosNull NullStatus = 1 // NotNull is a placeholder for a non-null value. NotNull NullStatus = 0 // NegNull value is created after negating a null value (expression "-NA" will // create such a value). NegNull sorts before any non-null avlue. NegNull NullStatus = -1 )
type NullTableScanner ¶
type NullTableScanner struct{}
NullScanner implements TableScanner for NA. Its Scan() always returns false.
func (*NullTableScanner) Scan ¶
func (n *NullTableScanner) Scan() bool
func (*NullTableScanner) Value ¶
func (n *NullTableScanner) Value() Value
type Opts ¶
type Opts struct { // BackgroundContext is the default context used in stringers and other // non-critical codepaths. // If unset, context.Background() is used. BackgroundContext context.Context // CacheDir is directory that stores materialized tables for caching. If // unset, gql.DefaultCacheRoot is used when bsSession != nil. Else // gql.DefaultLocalCacheRoot is used. CacheDir string // OverwriteFiles controls whether write() function overwrites existing files. OverwriteFiles bool // BigsliceSession is an initialized bigslice session. If unset, a local // bigslice executor will be created. BigsliceSession *exec.Session // ImmutableFilesRE x lists regexps of paths of files that can be assumed to // be immutable. Immutable files can be hashed quickly using just their // pathnames, so they improve performance of gql. // // If nil, "^s3://grail-clinical.*" and "^s3://grail-results.*" are used. ImmutableFilesRE []*regexp.Regexp }
Opts is passed to gql.Init
type PrefetchingTableScanner ¶
type PrefetchingTableScanner struct {
// contains filtered or unexported fields
}
PrefetchingTableScanner is a TableScanner that wraps another TableScanner and prefetches rows.
func (*PrefetchingTableScanner) Scan ¶
func (s *PrefetchingTableScanner) Scan() bool
Scan implements the TableScanner interface.
func (*PrefetchingTableScanner) Value ¶
func (s *PrefetchingTableScanner) Value() Value
Value implements the TableScanner interface.
type PrintArgs ¶
type PrintArgs struct { // Out is the output destination Out termutil.Printer // Mode defines how the value is printed Mode PrintMode // TmpVars collects names of subtables in case they are not printed in-line. // The user can later print the subtable contents by typing these names. If // TmpVars is nil, a nested table will be printed as "[omitted]". TmpVars *TmpVars // MaxInlinedTableLen is the threshold for printing a nested table inline. // When a table's compact representation exceeds this length (bytes), it is // printed as "tmpNN" or "[omitted]" depending on whether TmpVars!=nil. // // If MaxInlinedTableLen <= 0, it is set to 78. MaxInlinedTableLen int }
PrintArgs define parameters to Value.Print method.
type PrintMode ¶
type PrintMode int
PrintMode specifies how a value is printed in the Value.Print method.
const ( // PrintValues prints the values. Tables are pretty printed. PrintValues PrintMode = iota // PrintCompact is similar to PrintValues, but it prints tables in more // compact form. Suitable for use in unittests. PrintCompact // PrintDescription prints the description of the value, not the actual value. THe // descrtiption includes such as the value type and columns (for a table). PrintDescription )
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a GQL session. It contains global variable bindings.
func TestNewSession ¶
func TestNewSession() *Session
func (*Session) Bindings ¶
func (s *Session) Bindings() *bindings
Bindings returrs the bindings for the global symbols.
func (*Session) EvalFile ¶
EvalFile reads a script and evaluates it. Returns the value computed by the last expression.
func (*Session) EvalStatements ¶
func (s *Session) EvalStatements(ctx context.Context, statements []ASTStatementOrLoad) Value
EvalStatements evaluates the statement and returns the value of the expression within. If st is of form "var := expr", binds var to the result of the expression so that subsequent Eval calls can refer to the variable.
func (*Session) Parse ¶
func (s *Session) Parse(filename string, text []byte) ([]ASTStatementOrLoad, error)
Parse parses the given text. filename is embedded in an error messages. It returns io.EOF if the text is incomplete. If the text is unparsable for other reasons, it returns non-nil errors other than io.EOF.
func (*Session) SetGlobal ¶
SetGlobal sets the global variable value.
REQUIRES: the variable must not exist already, otherwise the process crashes.
func (*Session) SetGlobals ¶
SetGlobals sets a set of global variables.
REQUIRES: each variable must not exist already, otherwise the process crashes.
type Struct ¶
type Struct interface { // Len returns the number of fields (columns) in the struct. Len() int // Field returns the name and the value of the i'th field. // // REQUIRES: 0 <= i < Len() Field(i int) StructField // Value returns the value for the specified column. It returns false if the // column is not found. Value(colName symbol.ID) (Value, bool) }
Struct is a collection of name->value mappings. Its analogous to a row in a relational database.
To reduce heap allocation, every struct implementation embeds the the itable pointer in its first word. Take the following code snippet as an example:
v := &structN{values: ...} initStruct(v) var s Struct = v
The memory layout will look like below:
s (Struct) +------+ | iptr | --------------------------------------->+-------+ +------+ +-----------+ / |random | | data | ----------> | structImpl|-----------/ |itable | +------+ +-----------+ |stuff |
| values | +-------+ +-----------+ v (structN)
The first word of *v will point to the itable of type structN. Function initStruct() plumbs these the fields. The Value object stores only the data pointer to the struct. Struct can be reconstructed from Value by first reading the data pointer, then reading the first word of the data for itable.
For more details about Go interface implementation, see https://research.swtch.com/interfaces.
func NewSimpleStruct ¶
func NewSimpleStruct(values ...StructField) Struct
NewSimpleStruct creates a new struct from the given list of fields. "t" must be of type StructKind, and its field descriptions must match the values'.
type StructField ¶
StructField represents a field (column) in a struct (row).
type StructImpl ¶
type StructImpl struct {
// contains filtered or unexported fields
}
type TSVColumn ¶
type TSVColumn struct { // Name is the column name Name string // Type is the type of the cells in the column. Type ValueType // Description is an optional description of the column. Description string `json:",omitempty"` }
TSVColumn defines a column in a TSV-like file.
type TSVFormat ¶
type TSVFormat struct { // HeaderLines is the number of comment lines at the beginning of the file. // The value is typically 0 or 1. HeaderLines int // List of columns in each row. Columns []TSVColumn }
TSVFormat defines the format of a TSV file. JSON encodable.
type TSVTable ¶
type TSVTable struct {
// contains filtered or unexported fields
}
TSVTable implements Table for a TSV file.
func (*TSVTable) Attrs ¶
func (t *TSVTable) Attrs(ctx context.Context) TableAttrs
Attrs implements the Table interface
func (*TSVTable) Marshal ¶
func (t *TSVTable) Marshal(ctx MarshalContext, enc *marshal.Encoder)
Marshal implements the Table interface.
type Table ¶
type Table interface { // Attrs obtains the table metadata. Any of the attr fields may be empty. Attrs(ctx context.Context) TableAttrs // Scanner creates a table scanner. The parameters are used to scan the part // [start,limit) of the table, where range [0,total) represents the whole // table. // // For example, Scanner(0,2,3) reads the 2/3rds of the table, and // Scanner(2,3,3) reads the remaining 1/3rd of the table. Note that the // scanner implementation need not guarantee that the shard size is uniform // (but they strive to). Also, it need not always range-shard the table -- it // can hash-shard the table, it that's more convenient. // // REQUIRES: 0 <= start <= limit <= total. Scanner(ctx context.Context, start, limit, total int) TableScanner // Len returns the number of rows in the table. When mode==Approx, this method // should return the approx number of rows quickly. The Approx mode is used to // guide sharding and parallelizing policies. When mode==Exact, this method // must compute the exact # of rows in the table. Len(ctx context.Context, mode CountMode) int // Hash computes a hash value for this table. Hash() hash.Hash // Marshal produces a string that can be fed to parser to reconstruct this table. Marshal(ctx MarshalContext, enc *marshal.Encoder) // Prefetch is called to fetch the contents in the background, if possible. // This method shall never block. Prefetch(ctx context.Context) }
Table is a collection of Structs. It can be stored in a Value. It is analogous to a table in a relational database. Thread safe.
func NewBAMTable ¶
NewBAMTable returns a new BAM table backed by the BAM or PAM file at the provided path.
TODO(marius): support selecting out fields from reading so that these can be pushed down to the underlying iterators.
func NewFlatTable ¶
NewFlatTable creates a flatten() table.
func NewMinNTable ¶
func NewMinNTable(ctx context.Context, ast ASTNode, attrs TableAttrs, srcTable Table, sortKey *Func, minn int64, shards int) Table
NewMinNTable creates a table that yields the smallest minn rows in srcTable. If minn<0, it is treated as ∞. The row order is determined by applying sortKey to each row, then comparing the results lexicographically.
func NewNullTable ¶
func NewNullTable() Table
func NewSimpleTable ¶
func NewSimpleTable(recs []Value, h hash.Hash, attrs TableAttrs) Table
NewSimpleTable creates a trivial table that stores all the rows in memory.
func NewTSVTable ¶
NewTSVTable creates a Table for reading the given TSV file. "h" is the hash of the input sources that generate this table. "fh" is typically a tsvFileHandler and is used to parse the file and serialize the table. "format" is an optional format spec for the file. If format=nil, this function guesses the column types from the file contents.
func NewTableFromFile ¶
NewTableFromFile creates a Table object that reads from the given file. If the file type is not specified, this function attempts to derive it from the path name. The hash of the table is computed from the pathname and the file's attributes.
type TableAttrs ¶
type TableAttrs struct { // Name is a short description of the the table, "tsv", "mapfilter", etc. Name string // Path is the file from which the contents were read. It is "" for a computed // table. Path string // List of columns in the table. Columns []TSVColumn // Description can be any string. Description string }
TableAttrs represents a metadata about a table. It is used only for debugging and display purposes, so all the fields are optional.
type TableScanner ¶
type TableScanner interface { // Scan fetches the next value. It returns false on EOF. Scan() bool // Value returns the current value. // // REQUIRES: the last Scan() call returned true. Value() Value }
TableScanner is an interface for reading a table. Thread compatible.
func NewPrefetchingTableScanner ¶
func NewPrefetchingTableScanner(ctx context.Context, s TableScanner, depth int) TableScanner
NewPrefetchingTableScanner creates a TableScanner that wraps another scanner and prefetches up to "depth" rows.
type TmpVars ¶
type TmpVars struct {
// contains filtered or unexported fields
}
TmpVars is used by Value.Print to give names to nested tables when values are printed on screen. TmpVars is a singleton object. Thread compatible.
type TypeCallback ¶
TypeCallback is called when a script is parsed. ast is the syntax tree node of the call. It should check if the args[] conforms to the the function's input spec. It returns (function return type, free variables read by lazy args passed to the function>
type UnmarshalContext ¶
type UnmarshalContext struct {
// contains filtered or unexported fields
}
UnmarshalContext stores state needed while unmarshaling a table. The map stores the set of frames referenced transitively by closures. Keys are callFrame.hash().
type UnmarshalMagic ¶
type UnmarshalMagic [2]byte
UnmarshalMagic identifies a magic number prefixed before a serialized Table or Struct. It is used to look up the unmarshal callback.
type UnmarshalTableCallback ¶
UnmarshalTableCallback reconstruct a table object from a binary stream produced by Table.MarshalGOB
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is a unified representation of a value in gql. It can represent scalar values such as int64 and float64, as well as a Table or Struct. A value is immutable once constructed.
func MustStructValue ¶
MustStructValue returns the value for the specified column. It panics if the column is not found.
func NewDuration ¶
NewDuration creates a value of DurationType.
func NewMapFilterTable ¶
func NewMapFilterTable( ctx context.Context, ast ASTNode, srcTable Table, filterExpr *Func, mapExprs []*Func, nshards int) Value
NewMapFilterTable creates a Table that implements map() or filter(). It reads from srcTable. It removes rows for which filterExpr(row)=false. If filterExpr=nil, then it is assumed to be just "true". Then it emits expr(row) for each expr∈mapExprs. If len(mapExprs)=0, then it emits each matched row as is.
if nshards>0, the table runs on multiple machines using bigslice.
func NewNull ¶
func NewNull(v NullStatus) Value
NewNull creates a new null value.
REQUIRES: v != NotNull.
func NewStructFragment ¶
func NewStructFragment(frag []StructField) Value
NewStructFragment creates a new Value of type StructFragmentType.
func ParseDateTime ¶
ParseDateTime creates a Date or DateTime from a string. It only accepts ISO8601-format strings.
func ParseDuration ¶
ParseDuration constructs a Value object from a human-readable duration string. The duration format is defined in time.ParseDuration.
func RegisterBuiltinFunc ¶
func RegisterBuiltinFunc(name, desc string, funcCB FuncCallback, typeCB TypeCallback, formalArgs ...FormalArg) Value
RegisterBuiltinFunc registers a builtin function. It should be called inside init(). Note when specifying the list of FormatlArgs certain restrictions are imposed by the parser. In particular, all positional arguments must be listed before named ones.
func (Value) Bool ¶
Bool extracts a boolean value. "ast" is used only to report source code location on error.
REQUIRES: v.Type()==BoolType
func (Value) Char ¶
Char extracts the character value. "ast" is used only to report source code location on error.
REQUIRES: v.Type()==CharType.
func (Value) DateTime ¶
DateTime extracts the time/date value."ast" is used only to report source code location on error.
REQUIRES: v.Type() is one of {DateTimeType, DateType}
func (Value) Duration ¶
Int extracts an integer value. "ast" is used only to report source code location on error.
REQUIRES: v.Type()==DurationType
func (Value) Float ¶
Float extracts a float64 value. "ast" is used only to report source code location on error.
REQUIRES: v.Type()==FloatType
func (Value) Int ¶
Int extracts an integer value. "ast" is used only to report source code location on error.
REQUIRES: v.Type()==IntType
func (Value) Marshal ¶
func (v Value) Marshal(ctx MarshalContext, enc *marshal.Encoder)
Marshal encodes the value into the given buffer.
func (Value) MarshalBinary ¶
MarshalBinary implements the GOB interface. This function should be called only for static literals embedded in an ASTNode.
Call Marshal() for dynamically constructed Values, especially Table objects, that may contain *Funcs.
func (Value) Null ¶
func (v Value) Null() NullStatus
Null checks whether the value is null. If v is not null, it returns NotNull. Else, it returns either PosNull or NegNull.
func (Value) Prefetch ¶
Prefetch is called to fetch the contents in the background, if possible. This method never blocks.
func (Value) Str ¶
Str extracts the string value. "ast" is used only to report source code location on error.
REQUIRES: v.Type() is one of {StringType,FileNameType,EnumType}.
func (Value) String ¶
String produces a human-readable string of the value. It is a shorthand for v.Print() with mode PrintCompact
func (Value) Struct ¶
Struct extracts a struct from the value. "ast" is used only to report source code location on error.
REQUIRES: v.Type() == StructType,NullType
TODO(saito) do we need to special-case null type here?
func (Value) StructFragment ¶
func (v Value) StructFragment() []StructField
StructFragment extracts a []StructField created by "expr./columnregex/" construct.
func (Value) Table ¶
Table extracts a table from the value. "ast" is used only to report source code location on error.
REQUIRES: v.Type() == TableType,NullType
TODO(saito) do we need to special-case null type here?
func (*Value) Unmarshal ¶
func (v *Value) Unmarshal(ctx UnmarshalContext, dec *marshal.Decoder)
Unmarshal decodes the buffer encoded using Marshal.
func (*Value) UnmarshalBinary ¶
UnmarshalBinary implements the GOB interface. This function should be called only for static literals embedded in an ASTNode.
Call Marshal() for dynamically constructed Values, especially Table objects, that may contain *Funcs.
type ValueType ¶
type ValueType byte
ValueType defines the type of a Value object.
const ( // InvalidType is a sentinel. It is not a valid value. InvalidType ValueType = iota // NullType represents a missing value NullType // BoolType represents a true or a false BoolType // IntType represents an int64 value IntType // FloatType represents an float64 value FloatType // StringType represents a UTF-8-encoded string StringType // FileNameType represents a UTF-8-encoded filename. FileNameType is a legacy // type. It is effectively the same as StringType. FileNameType // FileNameType represents an enum value. EnumType is a legacy type. It is // effectively the same as StringType. EnumType // CharType represents a UTF-8 character. CharType // DateType represents time.Time, but at a date granurality. DateType // DateTimeType represents time.Time. DateTimeType // DurationType represents time.Duration. DurationType UnusedType // Available for future use. // StructType stores a Struct StructType // StructFragmentType stores []StructField. It is a result of expanding a // regex struct pattern. StructFragmentType // TableType stores a Table TableType // FuncType stores a Func FuncType )
Caution: these values must be stable. They are saved on disk.
func (ValueType) LikeString ¶
LikeString checks if the value's representation is a string.
func (ValueType) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*ValueType) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
Source Files ¶
- actual_arg_pool.go
- ai.go
- ast.go
- ast_util.go
- bam_table.go
- bed_table.go
- bitmap.go
- btsv_table.go
- btsv_tmp_pool.go
- builtin_cogroup.go
- builtin_collapse.go
- builtin_concat.go
- builtin_count.go
- builtin_filter.go
- builtin_firstn.go
- builtin_flatten.go
- builtin_force.go
- builtin_gather.go
- builtin_join.go
- builtin_joinbed.go
- builtin_map.go
- builtin_minn.go
- builtin_ops.go
- builtin_optional_field.go
- builtin_pick.go
- builtin_read.go
- builtin_readdir.go
- builtin_reduce.go
- builtin_sort.go
- builtin_table.go
- builtin_table_attrs.go
- builtin_transpose.go
- builtin_write.go
- cache.go
- call_frame_pool.go
- context.go
- doc_util.go
- eval.go
- file_handler.go
- func.go
- gql.go
- lex.go
- log.go
- map_filter_table.go
- marshal_context.go
- minn_table.go
- panic.go
- parallel_map_filter_table.go
- parallel_reduce_table.go
- prefetching_table_scanner.go
- randomized_freepool_internal.go
- shard_util.go
- struct.go
- struct12.go
- struct16.go
- struct2.go
- struct4.go
- struct8.go
- struct_field_pool.go
- table.go
- test_util.go
- tsv_col.go
- tsv_format.go
- tsv_table.go
- unsafe.go
- value.go
- value_type.go
- value_type_marshaler.go
- valuetype_string.go
- y.go